A VTFx database. The class represents a database of data blocks. More...
Public Member Functions | |
Database (File *file, const Str &databaseName, int databaseId, SimulationType simulationType=SIMULATION_TYPE_OTHER, SolutionType solutionType=SOLUTION_TYPE_OTHER, const Str &description="") | |
Constructs a new database. More... | |
int | id () const |
Returns the database id. More... | |
Str | name () const |
Returns the database name. More... | |
bool | writeBlock (const Block *block) |
Writes a block to the database. More... | |
size_t | blockCount (Block::BlockType blockType) const |
Returns the number of blocks of the given block type. More... | |
PtrRef< Block > | blockByIndex (Block::BlockType blockType, size_t blockIndex) |
Returns the block of the given block type with index blockIndex. More... | |
PtrRef< Block > | blockById (Block::BlockType blockType, int blockId) |
Returns the block of the given block type and that has the given block id. More... | |
![]() | |
void | addRef () const |
Increments the reference count for this object. More... | |
void | release () const |
Decrements the reference count for this object. More... | |
int | refCount () const |
Returns the reference count for this object. More... | |
void | setRefCountZero () const |
Sets the ref count to zero, but DOES NOT delete the object. More... | |
A VTFx database. The class represents a database of data blocks.
The blocks contain data such as node coordinates, finite elements, or result values - see *Block. A database requires a unique id per VTFx file. One (and only one) geometry block and state info block are required for each database.
cee::vtfx::Database::Database | ( | File * | file, |
const Str & | databaseName, | ||
int | databaseId, | ||
SimulationType | simulationType = SIMULATION_TYPE_OTHER , |
||
SolutionType | solutionType = SOLUTION_TYPE_OTHER , |
||
const Str & | description = "" |
||
) |
Constructs a new database.
The constructor takes the file instance as a parameter. The File will take ownership of the database and ensure that all belonging databases are written to file.
Specify a database name and a database id. The database id needs to be unique within the file.
PtrRef< Block > cee::vtfx::Database::blockById | ( | Block::BlockType | blockType, |
int | blockId | ||
) |
Returns the block of the given block type and that has the given block id.
PtrRef< Block > cee::vtfx::Database::blockByIndex | ( | Block::BlockType | blockType, |
size_t | blockIndex | ||
) |
Returns the block of the given block type with index blockIndex.
size_t cee::vtfx::Database::blockCount | ( | Block::BlockType | blockType | ) | const |
Returns the number of blocks of the given block type.
int cee::vtfx::Database::id | ( | ) | const |
Returns the database id.
Str cee::vtfx::Database::name | ( | ) | const |
Returns the database name.
bool cee::vtfx::Database::writeBlock | ( | const Block * | block | ) |
Writes a block to the database.
Returns false if there was an error writing the block to the file. Detailed info is available in the log.