Xpace
Xpace::Table Class Reference

#include <table.h>

Classes

class  cantCreateSource
 Can't create a Source. More...
 
class  cantOpen
 Can't open a Table. More...
 
class  Sink
 A write-only, forward cursor into a table. More...
 
struct  SourceDeleter
 management for a Source More...
 

Public Types

typedef Xpace::Source< uintSource
 read-only cursor into a table, parameterized on column More...
 
typedef std::unique_ptr< Source, SourceDeleterSourcePtr
 

Public Member Functions

 Table (const String &config, StoreAccess access=SA_readOnly)
 
 Table (const String &store, const String &refs, const String &map, StoreAccess access=SA_readOnly, bool overwrite=false, bool test=false, const String &name=String())
 
bool operator! () const
 
void close ()
 @ close the table, including its Sink (if any) More...
 
String getName () const
 
String getConfig () const
 @ return the table's configuration More...
 
String getColumnConfig (uint col) const
 Get a column's configuration. More...
 
String getColumnName (uint col) const
 Get a column name from a column number. More...
 
DerivedDataType getColumnType (uint col) const
 Get a column type from a column number. More...
 
uint getColumnNumber (const String &name) const
 Get a column from a column name. More...
 
uint64 getRowCount () const
 
uint64 getDocCount () const
 compatibility with Store More...
 
uint getColumnCount () const
 
SourcePtr createSource (uint64 row=0) const
 create a Source More...
 
SinkgetSink ()
 
bool forEachColumn (Sink *sink, const std::vector< uint > &columns=std::vector< uint >()) const
 Call a Sink for each column in this table. More...
 
bool forEach (Sink *sink, const std::vector< uint > &columns=std::vector< uint >(), StatusCallback status=defaultStatus) const
 Call a Sink for each cell in row/column order. More...
 

Static Public Member Functions

static const char * TAG ()
 Configuration tag for a Table. More...
 

Static Public Attributes

static const char * NAME_TAG
 Configuration tag for a Table's Name. More...
 

Detailed Description

Definition at line 25 of file table.h.

Member Typedef Documentation

read-only cursor into a table, parameterized on column

Definition at line 122 of file table.h.

typedef std::unique_ptr<Source, SourceDeleter> Xpace::Table::SourcePtr

Definition at line 130 of file table.h.

Constructor & Destructor Documentation

Xpace::Table::Table ( const String config,
StoreAccess  access = SA_readOnly 
)
explicit
Parameters
configthe Table's Configuration; must include TAG, dd, di, and dt
accesshow the Table will be opened
Exceptions
File_Cant_Open
File_Cant_Read
Xpace::Table::Table ( const String store,
const String refs,
const String map,
StoreAccess  access = SA_readOnly,
bool  overwrite = false,
bool  test = false,
const String name = String() 
)
Parameters
storethe Table's store file
refsthe Table's refs file (if any)
mapthe Table's map file (if any)
accesshow the Table will be opened
overwritestart fresh if true; append if false
testcompare on read if true; append on read if false
nameif overwrite, name the table this

Member Function Documentation

static const char* Xpace::Table::TAG ( )
static

Configuration tag for a Table.

bool Xpace::Table::operator! ( ) const
Returns
true if the table is empty or does not exist
void Xpace::Table::close ( )

@ close the table, including its Sink (if any)

String Xpace::Table::getName ( ) const
Returns
the table's name
String Xpace::Table::getConfig ( ) const

@ return the table's configuration

String Xpace::Table::getColumnConfig ( uint  col) const

Get a column's configuration.

Parameters
colthe column number
Returns
the column's Configuration
String Xpace::Table::getColumnName ( uint  col) const

Get a column name from a column number.

Parameters
thecolumn number
Returns
the column number, String() if not found
DerivedDataType Xpace::Table::getColumnType ( uint  col) const

Get a column type from a column number.

Parameters
thecolumn number
Returns
the column type, none if not found
uint Xpace::Table::getColumnNumber ( const String name) const

Get a column from a column name.

Parameters
thecolumn name
Returns
the column number, ~0 if not found
uint64 Xpace::Table::getRowCount ( ) const
Returns
the number of rows in the table
uint64 Xpace::Table::getDocCount ( ) const
inline

compatibility with Store

Definition at line 108 of file table.h.

uint Xpace::Table::getColumnCount ( ) const
Returns
the number of columns in the table
SourcePtr Xpace::Table::createSource ( uint64  row = 0) const

create a Source

Parameters
rowstart at this row
Returns
the Source
Sink* Xpace::Table::getSink ( )
Returns
the (only) Sink to this table
bool Xpace::Table::forEachColumn ( Sink sink,
const std::vector< uint > &  columns = std::vector< uint >() 
) const

Call a Sink for each column in this table.

Parameters
sinkcalled for each cell
columnsif not empty, return these columns in this order
Returns
true iff act always returned true, false otherwise
bool Xpace::Table::forEach ( Sink sink,
const std::vector< uint > &  columns = std::vector< uint >(),
StatusCallback  status = defaultStatus 
) const

Call a Sink for each cell in row/column order.

Parameters
sinkcalled for each cell
columnsif not empty, return these columns in this order
statuscalled for each row, return interval before next call
Returns
true iff sink always returned true, false otherwise

Member Data Documentation

const char* Xpace::Table::NAME_TAG
static

Configuration tag for a Table's Name.

Definition at line 29 of file table.h.


The documentation for this class was generated from the following file:

current as of Wed Jun 10 2026 12:00:06