librcsb-core-wrapper
1.000
|
Public class that represents a data block, that contains tables. More...
#include <TableFile.h>
Public Member Functions | |
Block (const string &name, Serializer *serP, const eFileMode fileMode=READ_MODE, const Char::eCompareType caseSense=Char::eCASE_SENSITIVE) | |
~Block () | |
vector< pair< string, ISTable::eTableDiff > > | operator== (Block &inBlock) |
void | SetName (const string &name) |
const string & | GetName () const |
ISTable & | AddTable (const std::string &name=string(), const Char::eCompareType colCaseSense=Char::eCASE_SENSITIVE) |
void | AddTable (const string &name, const int indexInFile=0, ISTable *isTableP=NULL) |
void | RenameTable (const string &oldName, const string &newName) |
void | GetTableNames (vector< string > &tableNames) |
bool | IsTablePresent (const string &tableName) |
ISTable & | GetTable (const string &tableName) |
ISTable * | GetTablePtr (const string &tableName) |
void | DeleteTable (const string &tableName) |
void | WriteTable (ISTable &isTable) |
void | WriteTable (ISTable *isTableP) |
void | Print () |
Public Attributes | |
mapped_ptr_vector< ISTable, StringLess > | _tables |
Public class that represents a data block, that contains tables.
This class represents a data block, that can come from DDL, dictionary or CIF files. Data block is a container of tables. This class provides methods for construction and destruction, tables manipulation (addition, retrieval, deleting, writing), data blocks comparison.
Block::Block | ( | const string & | name, |
Serializer * | serP, | ||
const eFileMode | fileMode = READ_MODE , |
||
const Char::eCompareType | caseSense = Char::eCASE_SENSITIVE |
||
) |
Utility method, not part of users public API, and will soon be removed.
Constructs a data block.
[in] | name | - the name of the data block |
[in] | serP | - pointer to the File Navigator object |
[in] | fileMode | - optional parameter that indicates data block mode. Possible values are read-only, create, update and virtual. |
[in] | caseSense | - optional parameter that indicates case sensitivity of table names. Possible values are case sensitive and case in-sensitive. If not specified, case sensitive table names are assumed. |
None |
Block::~Block | ( | ) |
Utility method, not part of users public API, and will soon be removed.
Destructs a data block.
Not applicable |
None |
ISTable& Block::AddTable | ( | const std::string & | name = string() , |
const Char::eCompareType | colCaseSense = Char::eCASE_SENSITIVE |
||
) |
Adds a table to the block. If a table with the specified name already exists, it will be overwritten.
[in] | name | - optional parameter that indicates the name of the table to be added |
[in] | colCaseSense | - optional parameter that indicates case sensitivity of column names. Possible values are case sensitive and case in-sensitive. If not specified, a table with case sensitive column names is constructed. |
None |
void Block::AddTable | ( | const string & | name, |
const int | indexInFile = 0 , |
||
ISTable * | isTableP = NULL |
||
) |
Utility method, not part of users public API, and will soon be removed.
void Block::DeleteTable | ( | const string & | tableName | ) |
Deletes a table from a data block.
[in] | tableName | - table name |
None |
|
inline |
Retrieves data block name.
None |
None |
ISTable& Block::GetTable | ( | const string & | tableName | ) |
Retrieves a table reference.
[in] | tableName | - table name |
NotFoundException | - if table with name tableName does not exist |
void Block::GetTableNames | ( | vector< string > & | tableNames | ) |
Retrieves names of all tables in a data block.
[out] | tableNames | - retrieved table names |
None |
ISTable* Block::GetTablePtr | ( | const string & | tableName | ) |
Retrieves a pointer to the table.
[in] | tableName | - table name |
None |
bool Block::IsTablePresent | ( | const string & | tableName | ) |
Checks for table presence in the data block.
[in] | tableName | - table name |
None |
vector<pair<string, ISTable::eTableDiff> > Block::operator== | ( | Block & | inBlock | ) |
Compares a data block to another data block.
[in] | inBlock | - reference to input data block |
None |
void Block::Print | ( | ) |
Utility method, not part of users public API, and will soon be removed.
void Block::RenameTable | ( | const string & | oldName, |
const string & | newName | ||
) |
Changes the name of a table in the data block.
[in] | oldName | - the name of the table which is to be renamed |
[in] | newName | - the new table name |
EmptyValueException | - if oldName is empty |
NotFoundException | - if table with name oldName does not exist |
EmptyValueException | - if newName is empty |
AlreadyExistsException | - if table with name newName already exists |
FileModeException | - if block is not in create or update mode |
|
inline |
Utility method, not part of users public API, and will soon be removed.
Sets the name of a data block.
[in] | name | - the name of the data block |
None |
void Block::WriteTable | ( | ISTable & | isTable | ) |
Writes a table to the data block. In this context, writing means adding it (if it does not already exist) or updating it (if it already exists).
[in] | isTable | - reference to the table |
None |
void Block::WriteTable | ( | ISTable * | isTableP | ) |
Writes a table to the data block. In this context, writing means adding it (if it does not already exist) or updating it (if it already exists).
[in] | isTableP | - pointer to the table |
None |
mapped_ptr_vector<ISTable, StringLess> Block::_tables |