#include <TableFile.h>
Public Member Functions | |
Block (const string &name, Serializer *serP, const eFileMode fileMode=READ_MODE, const StringCompare::eCompareType caseSense=StringCompare::eCASE_SENSITIVE) | |
~Block () | |
vector< pair< string, ISTable::eTableDiff > > | operator== (Block &inBlock) |
void | SetName (const string &name) |
string | GetName () const |
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 * | GetTablePtr (const string &tableName) |
void | DeleteTable (const string &tableName) |
void | WriteTable (ISTable *isTableP) |
void | Print () |
Public Attributes | |
mapped_ptr_vector< ISTable, StringCompare > | _tables |
Private Member Functions | |
Block (const Block &t) | |
Block & | operator= (const Block &inBlock) |
ISTable * | _GetTablePtr (const unsigned int tableIndex) |
Private Attributes | |
string | _name |
eFileMode | _fileMode |
Serializer * | _ser |
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 StringCompare::eCompareType | caseSense = StringCompare::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 |
Block::Block | ( | const Block & | t | ) | [private] |
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::SetName | ( | const string & | name | ) | [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 |
string Block::GetName | ( | ) | const [inline] |
Retrieves data block name.
None |
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::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 |
Table with name oldName must be present
newName must be non-empty
Table with name newName must not be present
Block must be in create or update mode
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 |
void Block::GetTableNames | ( | vector< string > & | tableNames | ) |
Retrieves names of all tables in a data block.
[out] | tableNames | - retrieved table names |
None |
bool Block::IsTablePresent | ( | const string & | tableName | ) |
Checks for table presence in the data block.
[in] | tableName | - table name |
false - if table does not exist
None |
ISTable * Block::GetTablePtr | ( | const string & | tableName | ) |
Retrieves a pointer to the table.
[in] | tableName | - table name |
NULL, if table was not found
None |
void Block::DeleteTable | ( | const string & | tableName | ) |
Deletes a table from a data block.
[in] | tableName | - table name |
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 |
void Block::Print | ( | ) |
Utility method, not part of users public API, and will soon be removed.
ISTable * Block::_GetTablePtr | ( | const unsigned int | tableIndex | ) | [private] |
mapped_ptr_vector<ISTable, StringCompare> Block::_tables |
string Block::_name [private] |
eFileMode Block::_fileMode [private] |
Serializer* Block::_ser [private] |