|
rdbxx
1.0.10
|
A simple interface to the RDB++ read a row of an rdb table to initialize a class Type. More...
#include <simpleRDBTable.h>


Public Member Functions | |
| Type * | readRow () |
| Read a row of the RDB table. More... | |
Public Member Functions inherited from RDB | |
| RDB (const std::string &name="", std::ios::openmode mode=std::ios::in) | |
| Attaches RDB object to a file. More... | |
| RDB (std::istream *isptr) | |
| Attaches RDB object to an istream. More... | |
| RDB (std::ostream *osptr) | |
| Attaches RDB object to an ostream. More... | |
| RDB (const RDB &rdb) | |
| Copies RDB object. More... | |
| ~RDB (void) | |
| Deletes resources allocated by the RDB object. More... | |
| void | open (const std::string &name, std::ios::openmode mode=std::ios::in) |
| Attaches RDB object to a file. More... | |
| void | open (std::istream *isptr) |
| Attaches RDB object to an istream. More... | |
| void | open (std::ostream *osptr) |
| Attaches RDB object to an ostream. More... | |
| void | open (const RDB &rdb) |
| Copies RDB object. More... | |
| void | close (void) |
| Closes the stream attached to RDB object. More... | |
| int | read (void) |
| Read a line of data from the istream. More... | |
| bool | write (void) |
| Write a line of data to the ostream. More... | |
| bool | rewind (void) |
| Rewind the stream to the beginning of the first row of data. More... | |
| bool | autoIdx (void) const |
| Indicates if auto-indexing is activated. More... | |
| void | autoIdx (const bool on) |
| Activates/deactivates auto-indexing. More... | |
| void | advanceIdx (void) |
| Increments the indices in the RDBColumn data elements. More... | |
| void | setGroup (const std::string &name, bool group=true) |
| Turn on/off group status for the named column. More... | |
| void | setGroup (const int idx, bool group=true) |
| Turn on/off group status for the indexed column. More... | |
| bool | getGroup (const std::string &name) |
| Returns group status, true if its a new group, for the named column. More... | |
| bool | getGroup (const int idx) |
| Returns group status, true if its a new group, for the indexed column. More... | |
| bool | newGroup (void) |
| Checks if any column indicates a new group. More... | |
| void | setComment (const std::string &comm, const int idx=-1) |
| Add RDBComment in header of RDB object. More... | |
| void | setComment (RDBComment &comm, const int idx=-1) |
| Add or replace RDBComment in header of RDB object. More... | |
| void | setComment (RDBComment &comm, const std::string &name, const size_t idx=0) |
| Add or replace RDBComment in header of RDB object. More... | |
| void | setComment (const RDB &rdb) |
| Copy all comments from an existing RDB object. More... | |
| RDBComment & | getComment (const size_t idx) |
| Return RDBComment at given index. More... | |
| RDBComment & | getComment (const std::string &name, const size_t idx=0) |
| Return RDBComment with given keyword. More... | |
| void | setColumn (const std::string &name, const std::string &def, const int idx=-1) |
| Add an RDBColumn in RDB object. More... | |
| void | setColumn (RDBColumn *col, const int idx=-1) |
| Add or replace RDBColumn in RDB object. More... | |
| void | setColumn (RDBColumn *col, const std::string &name, const size_t idx=0) |
| Add of replace RDBColumn in RDB object. More... | |
| void | setColumn (const RDB &rdb) |
| Copy all columns from an existing RDB object. More... | |
| RDBColumn * | getColumn (const size_t idx) |
| Return pointer to RDBColumn at given index. More... | |
| RDBColumn * | getColumn (const std::string &name, const size_t idx=0) |
| Return pointer to RDBColumn with given name. More... | |
| void | setName (const size_t idx, const std::string &name) |
| Modify the name of the RDBColumn at idx. More... | |
| void | setDef (const size_t idx, const std::string &def) |
| Modify the definition of the RDBColumn at idx. More... | |
| void | setWidth (const size_t idx, const long width) |
| Modify the width of the RDBColumn at idx. More... | |
| void | setType (const size_t idx, const RDBColumn::Type type) |
| Modify the type of the RDBColumn at idx. More... | |
| void | setJust (const size_t idx, const RDBColumn::Just just) |
| Modify the justification of the RDBColumn at idx. More... | |
| void | setDesc (const size_t idx, const std::string &desc) |
| Modify the description of the RDBColumn at idx. More... | |
| void | mapData (const size_t idx, double data[], const size_t nelems=1) |
| Map RDBColumn data to user-supplied memory. More... | |
| void | mapData (const size_t idx, long data[], const size_t nelems=1) |
| Map RDBColumn data to user-supplied memory. More... | |
| void | mapData (const size_t idx, std::string data[], const size_t nelems=1) |
| Map RDBColumn data to user-supplied memory. More... | |
| void | setData (const size_t idx, const double data) |
| Sets the data value of RDBColumn, converting as necessary. More... | |
| void | setData (const size_t idx, const long data) |
| Sets the data value of RDBColumn, converting as necessary. More... | |
| void | setData (const size_t idx, const std::string &data) |
| Sets the data value of RDBColumn, converting as necessary. More... | |
| void | getName (const size_t idx, std::string &name) const |
| Return the name of the RDBColumn at idx. More... | |
| void | getDef (const size_t idx, std::string &def) |
| Return the definition of the RDBColumn at idx. More... | |
| void | getWidth (const size_t idx, long &width) const |
| Return the width of the RDBColumn at idx. More... | |
| void | getType (const size_t idx, RDBColumn::Type &type) const |
| Return the type of the RDBColumn at idx. More... | |
| void | getJust (const size_t idx, RDBColumn::Just &just) const |
| Return the just of the RDBColumn at idx. More... | |
| void | getDesc (const size_t idx, std::string &desc) const |
| Return the description of the RDBColumn at idx. More... | |
| void | getData (const size_t idx, double &data) |
| Return the data of the RDBColumn at idx, converting if necessary. More... | |
| void | getData (const size_t idx, long &data) |
| Return the data of the RDBColumn at idx, converting if necessary. More... | |
| void | getData (const size_t idx, std::string &data) |
| Return the data of the RDBColumn at idx, converting if necessary. More... | |
| std::string | getName (const size_t idx) const |
| Return the name of the RDBColumn at idx. More... | |
| std::string | getDef (const size_t idx) |
| Return the definition of the RDBColumn at idx. More... | |
| long | getWidth (const size_t idx) const |
| Return the width of the RDBColumn at idx. More... | |
| RDBColumn::Type | getType (const size_t idx) const |
| Return the type of the RDBColumn at idx. More... | |
| RDBColumn::Just | getJust (const size_t idx) const |
| Return the justification of the RDBColumn at idx. More... | |
| std::string | getDesc (const size_t idx) const |
| Return the description of the RDBColumn at idx. More... | |
| double | getDataDouble (const size_t idx) |
| Return the data of the RDBColumn at idx, converting if necessary. More... | |
| long | getDataLong (const size_t idx) |
| Return the data of the RDBColumn at idx, converting if necessary. More... | |
| std::string | getDataString (const size_t idx) |
| Return the data of the RDBColumn at idx, converting if necessary. More... | |
| void | setName (const std::string &name, const std::string &newname) |
| Modify the RDBColumn name. More... | |
| void | setDef (const std::string &name, const std::string &def) |
| Modify the RDBColumn definition. More... | |
| void | setWidth (const std::string &name, const long width) |
| Modify the RDBColumn width. More... | |
| void | setType (const std::string &name, const RDBColumn::Type type) |
| Modify the RDBColumn type. More... | |
| void | setJust (const std::string &name, const RDBColumn::Just just) |
| Modify the RDBColumn justification. More... | |
| void | setDesc (const std::string &name, const std::string &desc) |
| Modify the RDBColumn description. More... | |
| void | mapData (const std::string &name, double data[], const size_t nelems=1) |
| Map RDBColum data to user-supplied memory. More... | |
| void | mapData (const std::string &name, long data[], const size_t nelems=1) |
| Map RDBColum data to user-supplied memory. More... | |
| void | mapData (const std::string &name, std::string data[], const size_t nelems=1) |
| Map RDBColum data to user-supplied memory. More... | |
| void | setData (const std::string &name, const double data) |
| Modify the RDBColumn data, converting if necessary. More... | |
| void | setData (const std::string &name, const long data) |
| Modify the RDBColumn data, converting if necessary. More... | |
| void | setData (const std::string &name, const std::string &data) |
| Modify the RDBColumn data, converting if necessary. More... | |
| void | getName (const std::string &name, std::string &namefound) const |
| Return the name of the RDBColumn. More... | |
| void | getDef (const std::string &name, std::string &def) |
| Return the definition of the RDBColumn. More... | |
| void | getWidth (const std::string &name, long &width) const |
| Return the width of the RDBColumn. More... | |
| void | getType (const std::string &name, RDBColumn::Type &type) const |
| Return the type of the RDBColumn. More... | |
| void | getJust (const std::string &name, RDBColumn::Just &just) const |
| Return the justification of the RDBColumn. More... | |
| void | getDesc (const std::string &name, std::string &desc) const |
| Return the description of the RDBColumn. More... | |
| void | getData (const std::string &name, double &data) |
| Return the data of the RDBColumn, converting if necessary. More... | |
| void | getData (const std::string &name, long &data) |
| Return the data of the RDBColumn, converting if necessary. More... | |
| void | getData (const std::string &name, std::string &data) |
| Return the data of the RDBColumn, converting if necessary. More... | |
| std::string | getName (const std::string &name) const |
| Return the name of the RDBColumn. More... | |
| std::string | getDef (const std::string &name) |
| Return the definition of the RDBColumn. More... | |
| long | getWidth (const std::string &name) const |
| Return the width of the RDBColumn. More... | |
| RDBColumn::Type | getType (const std::string &name) const |
| Return the type of the RDBColumn. More... | |
| RDBColumn::Just | getJust (const std::string &name) const |
| Return the justification of the RDBColumn. More... | |
| std::string | getDesc (const std::string &name) const |
| Return the description of the RDBColumn. More... | |
| double | getDataDouble (const std::string &name) |
| Return the data of the RDBColumn, converting if necessary. More... | |
| long | getDataLong (const std::string &name) |
| Return the data of the RDBColumn, converting if necessary. More... | |
| std::string | getDataString (const std::string &name) |
| Return the data of the RDBColumn, converting if necessary. More... | |
| size_t | nComments (void) const |
| Return number of comments in RDB object. More... | |
| size_t | nColumns (void) const |
| Return number of columns in RDB object. More... | |
| size_t | nRows (void) |
| Return number of rows in RDB object. More... | |
Static Public Member Functions | |
| static void | getData (RDBColumn *rdbcol, std::string &val) |
| Given an RDBColumn, get a string value. More... | |
| static void | getData (RDBColumn *rdbcol, int &val) |
| Given an RDBColumn, get an integer value. More... | |
| static void | getData (RDBColumn *rdbcol, long &val) |
| Given an RDBColumn, get a long value. More... | |
| static void | getData (RDBColumn *rdbcol, double &val) |
| Given an RDBColumn, get a double value. More... | |
Additional Inherited Members | |
Public Types inherited from RDB | |
| enum | Status |
| Acceptable column justifications. More... | |
Protected Member Functions inherited from RDB | |
| void | parseHeader (void) |
| Parse header, i.e. comments and column names and definitions. More... | |
| std::vector< std::string > | parseLine (const std::string &line) const |
| Parse fields in a row. More... | |
| size_t | parseLine (bool &newgroup) |
| Parse fields in a row. More... | |
Protected Attributes inherited from RDB | |
| std::string | _filename |
| Name of RDB file. More... | |
| std::ios::openmode | _mode |
| Open mode of the associated stream. More... | |
| std::istream * | _isptr |
| Istream attached to data file. More... | |
| std::ostream * | _osptr |
| Ostream attached to data file. More... | |
| bool | _myisptr |
| Indicates if RDB object is responsible for deallocating the istream. More... | |
| bool | _myosptr |
| Indicates if RDB object is responsible for deallocating the ostream. More... | |
| size_t | _rewindto |
| Position of beginning of first row of data. More... | |
| size_t | _ncomms |
| Number of comments. More... | |
| size_t | _ncols |
| Number of columns. More... | |
| size_t | _nrows |
| Number of rows. More... | |
| bool | _knowrows |
| Indicates if associated file must be scanned to determine number of rows. More... | |
| long | _rownum |
| Current table row number. More... | |
| long | _frownum |
| Current file row number. More... | |
| bool | _autoidx |
| Indicates if RDBColumn data elements should be advanced. More... | |
| bool | _firstread |
| Indicates if this is the first call to RDB::read. More... | |
| bool | _lastread |
| Indicates if this is the last call to RDB::read. More... | |
| bool | _writehdr |
| Indicates if the header has been output. More... | |
| RDBComment * | _comms |
| Array of RDBComments. More... | |
| RDBColumn ** | _cols |
| Array of RDBColumns. More... | |
| RDBLongColumn | _nrcol |
| Hidden column, containing row number. More... | |
| bool * | _mycols |
| Indicates if RDB object is responsible for deallocating given RDBColumn. More... | |
| std::string | _line |
| Line from RDB table. More... | |
A simple interface to the RDB++ read a row of an rdb table to initialize a class Type.
The class Type must have a constructor with the following prototype:
Type( const char* header[], RDBColumn** rdb_column )
Definition at line 46 of file simpleRDBTable.h.
|
static |
Given an RDBColumn, get a string value.
Definition at line 86 of file simpleRDBTable.cc.
|
static |
Given an RDBColumn, get an integer value.
Definition at line 98 of file simpleRDBTable.cc.
|
static |
Given an RDBColumn, get a long value.
Definition at line 122 of file simpleRDBTable.cc.
|
static |
Given an RDBColumn, get a double value.
Definition at line 145 of file simpleRDBTable.cc.
| Type * simpleRDBTable< Type >::readRow | ( | ) |
Read a row of the RDB table.
Definition at line 191 of file simpleRDBTable.cc.