Manages the object IDs (used and released) with their position in the respective tables.
More...
#include <GloIndexPool.h>
Manages the object IDs (used and released) with their position in the respective tables.
The object IDs of a class and its subclasses are managed.
- Copyright
- © 2010 Helmut Jakoby
- Author
- Helmut Jakoby
◆ TableObjIdIndex() [1/3]
glo::IndexPool::TableObjIdIndex::TableObjIdIndex |
( |
| ) |
|
|
private |
The default constructor is not available.
◆ TableObjIdIndex() [2/3]
glo::IndexPool::TableObjIdIndex::TableObjIdIndex |
( |
const std::string & | rsPathName, |
|
|
unsigned long | ulClassID ) |
Constructor with parameter passing.
- Parameters
-
[in] | rsPathName | The complete directory name where the tables can be found such as "C:/Path/Data/". |
[in] | ulClassID | The class ID of the managed ObjIdPosTuple |
◆ TableObjIdIndex() [3/3]
glo::IndexPool::TableObjIdIndex::TableObjIdIndex |
( |
const TableObjIdIndex & | rT | ) |
|
Copy constructor.
- Parameters
-
[in] | rT | The data is copied from this object. |
◆ ~TableObjIdIndex()
virtual glo::IndexPool::TableObjIdIndex::~TableObjIdIndex |
( |
| ) |
|
|
virtual |
◆ copyMapFrom()
void glo::IndexPool::TableObjIdIndex::copyMapFrom |
( |
const TableObjIdIndex & | rT | ) |
|
|
protected |
Removes and deletes all elements from the map, which manages the stored object IDs and table position. Then all elements are transferred from the corresponding map of the rT.
- Parameters
-
[in] | rT | The table index whose elements are to be copied from the map, which manages the stored object IDs and the table position. |
◆ deleteAllIndexValues()
void glo::IndexPool::TableObjIdIndex::deleteAllIndexValues |
( |
| ) |
|
Removes and deletes all elements from the map, which manages the stored object IDs with their table position.
◆ getClassID()
unsigned long glo::IndexPool::TableObjIdIndex::getClassID |
( |
| ) |
const |
Returns the class ID of the managed ObjIdPosTuple and the index of table positions of deleted records.
◆ getFreeObjIDPos()
int glo::IndexPool::TableObjIdIndex::getFreeObjIDPos |
( |
std::streampos & | rPos | ) |
const |
Returns a free table position from its map, which manages the free table position.
- Parameters
-
[in,out] | rPos | The free table position, if one was available. |
- Returns
- A return value < 0 indicates an error.
◆ getFreeObjIDPosMapRef()
const std::map< std::streampos, std::streampos, std::less< std::streampos > > & glo::IndexPool::TableObjIdIndex::getFreeObjIDPosMapRef |
( |
| ) |
const |
Returns a reference to the map which manages the free lines (start position in the file where the object ID == 0.0.0)
- Returns
- The reference to the map.
◆ getObjIDIndexMapRef()
Returns a reference to the map, which manages the stored object IDs and their table position.
- Returns
- The reference to the map.
◆ getObjIdPosTuple()
int glo::IndexPool::TableObjIdIndex::getObjIdPosTuple |
( |
ObjIdPosTuple *& | prRetVal, |
|
|
const ObjID & | rObjID ) const |
Returns an object ID with the table position, where the corresponding data set is stored, from its map, which manages the stored object IDs and the table position, with passed object ID.
- Parameters
-
[in,out] | prRetVal | If present, a pointer to a copy of the object ID with the table position. |
[in] | rObjID | The object ID of the entry to be returned. |
- Returns
- A return value < 0 indicates an error.
- Attention
- The calling instance must remove the returned object from memory.
◆ getPathName()
const std::string & glo::IndexPool::TableObjIdIndex::getPathName |
( |
| ) |
const |
Returns the complete directory name where the tables can be found such as "C:/Path/Data/".
◆ insertFreeObjIDPos()
int glo::IndexPool::TableObjIdIndex::insertFreeObjIDPos |
( |
std::streampos | Pos | ) |
|
Inserts a free table position in its map, which manages the free table position.
- Parameters
-
[in] | Pos | The table position to insert. |
- Returns
- A return value < 0 indicates an error.
◆ insertObjIdPosTuple()
int glo::IndexPool::TableObjIdIndex::insertObjIdPosTuple |
( |
const ObjIdPosTuple & | rIndexTuple | ) |
|
Inserts an object ID with the table position, where the corresponding data set is stored, into its map, which manages the stored object IDs and table position.
- Parameters
-
[in] | rIndexTuple | The object ID with the table position to be inserted. |
- Returns
- A return value < 0 indicates an error.
◆ isObjIdFree()
bool glo::IndexPool::TableObjIdIndex::isObjIdFree |
( |
const ObjID & | rObjID | ) |
const |
Checks an object ID whether it is already managed.
- Parameters
-
[in] | rObjID | The object ID to be checked. |
- Returns
- Returns true, if rObjID is not managed, otherwise false.
◆ operator=()
Assignment operator.
- Parameters
-
[in] | rT | The data is transferred from this object. |
◆ removeAllFreeObjIDPos()
void glo::IndexPool::TableObjIdIndex::removeAllFreeObjIDPos |
( |
| ) |
|
Removes all elements from the map, which manages the free lines (start position in the file, where the object ID == 0.0.0).
◆ removeFreeObjIDPos()
int glo::IndexPool::TableObjIdIndex::removeFreeObjIDPos |
( |
std::streampos | Pos | ) |
|
Removes a free table position from its map, which manages the free table position.
- Parameters
-
[in] | Pos | The removed table position. |
- Returns
- A return value < 0 indicates an error.
◆ removeObjId()
int glo::IndexPool::TableObjIdIndex::removeObjId |
( |
const ObjID & | rObjID | ) |
|
Removes an object ID with the table position, where the corresponding data set is stored, from its map, which manages the stored object IDs and table position.
- Parameters
-
[in] | rObjID | The object ID of the entry to be removed. |
- Returns
- A return value < 0 indicates an error.
◆ m_FreeObjIDPosMap
std::map< std::streampos, std::streampos , std::less< std::streampos > > glo::IndexPool::TableObjIdIndex::m_FreeObjIDPosMap |
|
private |
A map that manages the free lines (start position in the file, where the object ID == 0.0.0).
◆ m_ObjIDIndexMap
A map that manages the stored object IDs and their table positions.
◆ m_strPathName
std::string glo::IndexPool::TableObjIdIndex::m_strPathName |
|
private |
The complete directory name where the tables can be found such as "C:/Path/Data/".
◆ m_ulClassID
unsigned long glo::IndexPool::TableObjIdIndex::m_ulClassID |
|
private |
The class ID of the managed ObjIdPosTuple and the index of table positions of deleted records.
The documentation for this class was generated from the following file: