#include <BufferedTable.hpp>
Inheritance diagram for Ionflux::Tools::BufferedTable:
Public Member Functions | |
BufferedTable () | |
Constructor. | |
BufferedTable (unsigned int initBlockSize) | |
Constructor. | |
BufferedTable (Ionflux::Tools::Database *initDatabase) | |
Constructor. | |
BufferedTable (Ionflux::Tools::Database *initDatabase, unsigned int initBlockSize) | |
Constructor. | |
BufferedTable (Ionflux::Tools::Database *initDatabase, unsigned int initBlockSize, const std::string &initTable, const std::string &initKeyField, const std::vector< std::string > &initFields) | |
Constructor. | |
BufferedTable (Ionflux::Tools::Database *initDatabase, unsigned int initBlockSize, const std::string &initTable, const std::string &initKeyField, const std::vector< std::string > &initFields, const std::string &initOrigin) | |
Constructor. | |
virtual | ~BufferedTable () |
Destructor. | |
virtual void | setConfig (Ionflux::Tools::Node &newConfig) |
Set configuration. | |
virtual void | setDatabase (Ionflux::Tools::Database *newDatabase) |
Set source database. | |
virtual Ionflux::Tools::Database * | getDatabase () |
Get source database. | |
virtual bool | validateTable () |
Validate database table. | |
virtual Ionflux::Tools::Node * | getRecord (int recIndex) |
Get record. | |
virtual Ionflux::Tools::Node * | operator[] (int recIndex) |
Get record. | |
virtual Ionflux::Tools::Node * | getCurrentRecord () |
Get current record. | |
virtual Ionflux::Tools::Node * | getNextRecord () |
Get next record. | |
virtual Ionflux::Tools::Node * | getPrevRecord () |
Get previous record. | |
virtual int | getTableOffset (const std::string &key) |
Get key table offset. | |
virtual std::string | getKey (const std::string &key, int recOffset) |
Get key. | |
virtual std::string | getKey (int recIndex) |
Get key by index. | |
virtual std::string | fetchKey (unsigned int offset) |
Get key from database table. | |
virtual unsigned int | getNumRecs () |
Get number of records. | |
virtual unsigned int | getFieldIndex (const std::string &fieldName) |
Get field index. | |
virtual void | refresh () |
Refresh buffer. | |
virtual void | clearBlocks () |
Clear buffer blocks. | |
virtual void | clear () |
Clear buffer. | |
virtual Ionflux::Tools::Reporter & | getLog () |
Get Console output/logging facility. | |
virtual void | setOrigin (unsigned int offset) |
Set key of the record with index pointer zero. | |
virtual void | setCurrentRecord (const std::string &newKey) |
Set current record. | |
virtual void | setBlockSize (unsigned int newBlockSize) |
Set buffer block size. | |
virtual void | setOrigin (const std::string &newOrigin) |
Set key of the record with index pointer zero. | |
virtual void | setTable (const std::string &newTable) |
Set source database table name. | |
virtual void | setKeyField (const std::string &newKeyField) |
Set name of the key field of the source database table. | |
virtual void | setFields (const std::vector< std::string > &newFields) |
Set names of fields to be included in each record. | |
virtual void | setCurrentIndex (int newCurrentIndex) |
Set index of current record. | |
virtual void | setCreateTemplate (const std::string &newCreateTemplate) |
Set create template. | |
virtual void | setCreateTemplateFile (const std::string &newCreateTemplateFile) |
Set create template file name. | |
virtual unsigned int | getBlockSize () const |
Get buffer block size. | |
virtual std::string | getOrigin () const |
Get key of the record with index pointer zero. | |
virtual std::string | getTable () const |
Get source database table name. | |
virtual std::string | getKeyField () const |
Get name of the key field of the source database table. | |
virtual std::vector< std::string > | getFields () const |
Get names of fields to be included in each record. | |
virtual int | getCurrentIndex () const |
Get index of current record. | |
virtual std::string | getCreateTemplate () const |
Get create template. | |
virtual std::string | getCreateTemplateFile () const |
Get create template file name. | |
Static Public Attributes | |
static const unsigned int | DEFAULT_BLOCK_SIZE = 50 |
Default buffering block size. | |
Protected Member Functions | |
virtual void | cycleForward () |
Cycle buffers (forward). | |
virtual void | cycleBackward () |
Cycle buffers (backward). | |
virtual void | updateIndices () |
Update indices. | |
virtual void | initBlock (Ionflux::Tools::Node *target, const std::string &fromKey, bool invert=false) |
Initialize buffer block. | |
virtual int | getBlockStartOffset (const std::string &key) |
Get block start offset. | |
Protected Attributes | |
Ionflux::Tools::Reporter | log |
Console output/logging. | |
Ionflux::Tools::ObjectPool | pool |
Object allocation pool. | |
Ionflux::Tools::Database * | database |
Source database. | |
Ionflux::Tools::Node * | prevBlock |
Previous block. | |
Ionflux::Tools::Node * | currentBlock |
Current block. | |
Ionflux::Tools::Node * | nextBlock |
Next block. | |
int | currentOffset |
Index of the first record of the current block. | |
std::map< std::string, unsigned int > | offsetIndex |
Key/offset index. | |
std::vector< std::string > | keyIndex |
Offset/key index. | |
unsigned int | blockSize |
Buffer block size. | |
std::string | origin |
Key of the record with index pointer zero. | |
std::string | table |
Source database table name. | |
std::string | keyField |
Name of the key field of the source database table. | |
std::vector< std::string > | fields |
Names of fields to be included in each record. | |
int | currentIndex |
Index of current record. | |
std::string | createTemplate |
Create template. | |
std::string | createTemplateFile |
Create template file name. | |
Ionflux::Tools::Node | config |
Buffered table configuration node. |
A buffered table providing access to records which are stored in a database table. The table buffer allows for the efficient sequential retrieval of records from the database, where the order of records is defined by a specified key field. This is achieved by fetching a block (or page) of records on each database query. Records from the blocks loaded into memory may then be accessed sequentially. A new block is fetched from the database automatically whenever the current index pointer goes out of the scope of a block.
|
Constructor. Construct new BufferedTable object. |
|
Constructor. Construct new BufferedTable object.
|
|
Constructor. Construct new BufferedTable object.
|
|
Constructor. Construct new BufferedTable object.
|
|
Constructor. Construct new BufferedTable object.
|
|
Constructor. Construct new BufferedTable object.
|
|
Destructor. Destruct BufferedTable object. |
|
Clear buffer. Clear all records from the buffer. |
|
Clear buffer blocks. Clear all records from the buffer blocks.
|
|
Cycle buffers (backward). Cycle the buffer blocks backward.
|
|
Cycle buffers (forward). Cycle the buffer blocks forward.
|
|
Get key from database table. Get the key of the record with the specified offset from the start of the database table.
|
|
Get buffer block size.
|
|
Get block start offset. Get the offset of the start of the data block which contains the specified key, relative to the specified key.
|
|
Get create template.
|
|
Get create template file name.
|
|
Get index of current record.
|
|
Get current record. Get the current record.
|
|
Get source database. Get the source database that will be used for fetching record blocks.
|
|
Get field index. Get the index of the specified field.
|
|
Get names of fields to be included in each record.
|
|
Get key by index. Get the key of the record with the specified index relative to the origin.
|
|
Get key. Get the key of the record with the specified offset relative to the record with the specified key.
|
|
Get name of the key field of the source database table.
|
|
Get Console output/logging facility. The console output/logging facility used by this object.
|
|
Get next record. Get the next record.
|
|
Get number of records. Get the number of records in the source database table.
|
|
Get key of the record with index pointer zero.
|
|
Get previous record. Get the previous record.
|
|
Get record. Get the record with the specified index.
|
|
Get source database table name.
|
|
Get key table offset. Get the database table offset (position relative to the start of the table) of a key.
|
|
Initialize buffer block. Initialize a block of the buffer with records starting from the specified key value.
|
|
Get record. Get the record with the specified index.
|
|
Refresh buffer. Refresh the buffer to reflect changes in the database table.
|
|
Set buffer block size. Set new value of buffer block size.
|
|
Set configuration. Initialize the configuration of the buffered table from a configuration data node.
|
|
Set create template. Set new value of create template.
|
|
Set create template file name. Set new value of create template file name.
|
|
Set index of current record. Set new value of index of current record.
|
|
Set current record. Set the current record by key.
|
|
Set source database. Set the source database that will be used for fetching record blocks.
|
|
Set names of fields to be included in each record. Set new value of names of fields to be included in each record.
|
|
Set name of the key field of the source database table. Set new value of name of the key field of the source database table.
|
|
Set key of the record with index pointer zero. Set new value of key of the record with index pointer zero.
|
|
Set key of the record with index pointer zero. Set the key of the record with index pointer zero by its offset in the database table.
|
|
Set source database table name. Set new value of source database table name.
|
|
Update indices. Update the key/offset and offset/key indices. |
|
Validate database table. Validate the existence of the database table. If the table does not exist and a template is set, the table will be created automatically.
|
|
Buffer block size.
|
|
Buffered table configuration node.
|
|
Create template.
|
|
Create template file name.
|
|
Current block.
|
|
Index of current record.
|
|
Index of the first record of the current block.
|
|
Source database.
|
|
Default buffering block size.
|
|
Names of fields to be included in each record.
|
|
Name of the key field of the source database table.
|
|
Offset/key index.
|
|
Console output/logging.
|
|
Next block.
|
|
Key/offset index.
|
|
Key of the record with index pointer zero.
|
|
Object allocation pool.
|
|
Previous block.
|
|
Source database table name.
|