GlobalObjects
Loading...
Searching...
No Matches
glo::IndexPool Class Reference

IndexPool is the base class for the RealIndexPool and the TransactionIndexPool for the individual transactions. More...

#include <GloIndexPool.h>

Inheritance diagram for glo::IndexPool:

Classes

class  DeletedObjIdTuple
 Class to manage deleted objects in the IndexPool::SchemaIndex. More...
 
struct  IndexComparisionFilter
 Filters can be assigned to objects of the type ObjectStrIndexIterator, which control the iteration by an ObjectStrIndex.
With this structure, a filter can be defined using "<", "<=", ">", ">=", "==" and "!=". For example, if m_sIndexFilterValue has the value "123" and m_eComparisionOperator has the value GREATER_EQUAL, only all objects with an index greater than or equal to "123" will be filtered out. More...
 
struct  IndexFilter
 Filters can be assigned to objects of the type ObjectStrIndexIterator, which control the iteration by an ObjectStrIndex.
This filter has an index filter expression in m_sIndexFilterValue. More...
 
struct  IndexRangeFilter
 Filters can be assigned to objects of the type ObjectStrIndexIterator, which control the iteration by an ObjectStrIndex.
With this structure a filter can be defined by means of a range specification. For example, if m_sIndexFilterValue has the value "123" and m_sIndexFilterEndValue has the value "155", all Objects with an index lower than "123" and higher than "155" will be filtered out. Thus, only all objects with an index greater than/equal to "123" and less than/equal to "155" will be delivered in case of a query. More...
 
class  ObjectStrIndex
 Manages the individual string indices of a class. If this is a unique index, the ObjStrIdTuple are in a map, otherwise in a MultiMap. Then indexes in a MultiMap can be inserted as reserved, this is taken into account when inserting further. More...
 
class  ObjectStrIndexIterator
 Has a pointer to an ObjectStrIndex and allows iteration through this index. Is instantiated e.g. for AllSets so that they can iterate independently through StringIndexes. More...
 
class  ObjIdPosTuple
 Class to manage objects in the IndexPool::TableObjIdIndex. More...
 
class  ObjStrIdTuple
 Class to manage objects in the IndexPool::ObjectStrIndex. More...
 
class  SchemaIndex
 Is the index manager class for a schema resp. a database. More...
 
class  TableObjIdIndex
 Manages the object IDs (used and released) with their position in the respective tables. More...
 
class  TableObjIdIndexIterator
 Has a pointer to a TableObjIdIndex and allows to iterate through this index. Is instantiated e.g. for AllSets so that they can iterate through indexes independently. More...
 

Public Member Functions

 IndexPool ()
 
 IndexPool (const IndexPool &rT)
 
virtual ~IndexPool ()
 
void deleteAllSchemaIndexValues ()
 
virtual int getObjectStrIndexIterator (ObjectStrIndexIterator *&prObjectStrIndexIterators, const std::string &rsSchemaName, unsigned long ulClassID, const std::string &rsIndexName) const
 
virtual int getObjIdPosTuple (ObjIdPosTuple *&prRetVal, const std::string &rsSchemaName, unsigned long ulClassID, const ObjID &rObjID) const
 
virtual int getTableObjIdIndexIterator (TableObjIdIndexIterator *&prTableIterators, const std::string &rsSchemaName, unsigned long ulClassID) const
 
virtual int insertDeletedObjID (const std::string &rsSchemaName, const ObjID &rDeletedObjId)
 
virtual int insertObjIdPosTuple (const std::string &rsSchemaName, unsigned long ulClassID, const ObjIdPosTuple &rIndexTuple)
 
virtual int insertObjStrIdTuple (const std::string &rsSchemaName, unsigned long ulClassID, const std::string &rsIndexName, const ObjStrIdTuple &rIndexTuple)
 
virtual int isIndexFree (const std::string &rsSchemaName, unsigned long ulClassID, const ObjID &rObjID, const std::string &rsIndexName, const std::string &rsIndex) const
 
virtual bool isObjIdDeleted (const std::string &rsSchemaName, const ObjID &rObjID) const
 
virtual int isObjIdFree (const std::string &rsSchemaName, const ObjID &rObjID) const
 
IndexPooloperator= (const IndexPool &rT)
 
int releaseAllCommunicatorObjStrIdTuples (const std::string &rsSchemaName, const NUM_PTR ipReservingComunicator)
 
int releaseObjStrIdTuple (const std::string &rsSchemaName, unsigned long ulClassID, const std::string &rsIndexName, const NUM_PTR ipReservingComunicatorTrx)
 
virtual int removeObjId (const std::string &rsSchemaName, unsigned long ulClassID, const ObjID &rObjID)
 
virtual int removeObjStrIdTuple (const std::string &rsSchemaName, unsigned long ulClassID, const std::string &rsIndexName, const ObjID &rObjID, NUM_PTR ipReservingComunicatorTrx=0)
 
int reserveObjStrIdTuple (const std::string &rsSchemaName, unsigned long ulClassID, const std::string &rsIndexName, const ObjStrIdTuple &rIndexTuple)
 

Protected Member Functions

void _deleteAllSchemaIndexValues ()
 
virtual bool _existsSchemaIndex (const std::string &rsSchemaName) const
 
virtual int _getFreeObjIDPos (std::streampos &rPos, const std::string &rsSchemaName, unsigned long ulClassID) const
 
virtual int _getObjectStrIndex (ObjectStrIndex *&prRetVal, const std::string &rsSchemaName, unsigned long ulClassID, const std::string &rsIndexName) const
 
virtual int _getObjectStrIndexIterator (ObjectStrIndexIterator *&prObjStrIterators, const std::string &rsSchemaName, unsigned long ulClassID, const std::string &rsIndexName) const
 
virtual int _getObjIdPosTuple (ObjIdPosTuple *&prRetVal, const std::string &rsSchemaName, unsigned long ulClassID, const ObjID &rObjID) const
 
virtual int _getSchemaIndex (SchemaIndex *&prRetVal, const std::string &rsSchemaName) const
 
virtual int _getTableObjIdIndex (TableObjIdIndex *&prRetVal, const std::string &rsSchemaName, unsigned long ulClassID) const
 
virtual int _getTableObjIdIndexIterator (TableObjIdIndexIterator *&prTableIterators, const std::string &rsSchemaName, unsigned long ulClassID) const
 
virtual int _insertDeletedObjID (const std::string &rsSchemaName, const ObjID &rDeletedObjId)
 
virtual int _insertFreeObjIDPos (const std::string &rsSchemaName, unsigned long ulClassID, std::streampos Pos)
 
virtual int _insertObjIdPosTuple (const std::string &rsSchemaName, unsigned long ulClassID, const ObjIdPosTuple &rIndexTuple)
 
virtual int _insertObjStrIdTuple (const std::string &rsSchemaName, unsigned long ulClassID, const std::string &rsIndexName, const ObjStrIdTuple &rIndexTuple)
 
virtual bool _isObjIdDeleted (const std::string &rsSchemaName, const ObjID &rObjID) const
 
virtual int _isObjIdFree (const std::string &rsSchemaName, unsigned long ulClassID, const ObjID &rObjID) const
 
virtual int _makeObjectStrIndex (const std::string &rsSchemaName, const std::string &rsTablePathName, unsigned long ulClassID, const std::string &rsIndexName, bool bUnique)
 
virtual int _makeTableObjIdIndex (const std::string &rsSchemaName, const std::string &rsTablePathName, unsigned long ulClassID)
 
virtual int _removeFreeObjIDPos (const std::string &rsSchemaName, unsigned long ulClassID, std::streampos Pos)
 
int _removeSchemaIndex (const std::string &rsSchemaName)
 
void copyMapFrom (const IndexPool &rT)
 

Protected Attributes

eut::CriticalSection m_LocalCriticalSection
 
std::map< std::string, SchemaIndex *, std::less< std::string > > m_SchemaIndexMap
 

Detailed Description

IndexPool is the base class for the RealIndexPool and the TransactionIndexPool for the individual transactions.

To speed up the search for records in the tables, the object ID is indexed with the table position in a TableObjIdIndex. Additionally an index of table positions of deleted data records is maintained. These two indexes are loaded into a RealIndexPool when a database is opened and are saved again when it is closed.

The RealIndexPool is the index from the database, i.e. real. Changes in the database that affect any index are documented in the RealIndexPool.

When a transaction is started, a TransactionIndexPool is created as a copy of the RealIndexPool and is validly administered for the respective transaction.

This means:
If an object is inserted, changed or deleted in the transaction and the TableObjIdIndex is affected, the index is only changed in the TransactionIndexPool.

If outside of a transaction an object is changed or deleted, the respective TransactionIndexPool is adjusted in all transactions, if the object is NOT in the transaction.

If an object is inserted outside a transaction, the respective objects of type TransactionIndexPool are adjusted in all transactions.

When a client asks for an object, the system first checks whether the client is in a transaction. Then the TransactionIndexPool is asked there; otherwise the RealIndexPool.

See also
SchemaIndex, TableObjIdIndex, ObjectStrIndex und ClassInfoIndex

Structure:
A SchemaIndex is built for each schema, which builds the index from the tables using the information from this schema.

Schematic structure:

|
|----------|
| |
| |
SchemaIndex1 SchemaIndex2
| | | |
| |
| |
| | |
| | |
ObjIDIndex DelObjIDPos IndexStr1/ObjId1
| | IndexStr2/ObjId2
| |
ObjId1/Pos1 |
ObjId2/Pos2 |
Pos3
Pos4
Manages the individual string indices of a class. If this is a unique index, the ObjStrIdTuple are in...
Definition GloIndexPool.h:1801
Manages the object IDs (used and released) with their position in the respective tables.
Definition GloIndexPool.h:1026
IndexPool is the base class for the RealIndexPool and the TransactionIndexPool for the individual tra...
Definition GloIndexPool.h:196
Author
Helmut Jakoby

Constructor & Destructor Documentation

◆ IndexPool() [1/2]

glo::IndexPool::IndexPool ( )

Standard constructor.

◆ IndexPool() [2/2]

glo::IndexPool::IndexPool ( const IndexPool & rT)

Copy constructor.

Parameters
[in]rTThe data is copied from this object.

◆ ~IndexPool()

virtual glo::IndexPool::~IndexPool ( )
virtual

Destructor.

Member Function Documentation

◆ _deleteAllSchemaIndexValues()

void glo::IndexPool::_deleteAllSchemaIndexValues ( )
protected

Removes all objects from m_SchemaIndexMap and from memory

◆ _existsSchemaIndex()

virtual bool glo::IndexPool::_existsSchemaIndex ( const std::string & rsSchemaName) const
protectedvirtual

Checks if a SchemaIndex with a specific name exists in the m_SchemaIndexMap.

Parameters
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") of the SchemaIndex to be checked.
Returns
Returns true, if a SchemaIndex with the passed name exists in m_SchemaIndexMap.

◆ _getFreeObjIDPos()

virtual int glo::IndexPool::_getFreeObjIDPos ( std::streampos & rPos,
const std::string & rsSchemaName,
unsigned long ulClassID ) const
protectedvirtual

Returns a free table position in a TableObjIdIndex with passed class ID in a SchemaIndex.

Parameters
[in,out]rPosThe free table position, if one was available.
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") to identify the SchemaIndex.
[in]ulClassIDThe class ID to identify the TableObjIdIndex.
Returns
A return value < 0 indicates an error.

◆ _getObjectStrIndex()

virtual int glo::IndexPool::_getObjectStrIndex ( ObjectStrIndex *& prRetVal,
const std::string & rsSchemaName,
unsigned long ulClassID,
const std::string & rsIndexName ) const
protectedvirtual

Returns an ObjectStrIndex of a specified class with a specified name from a specified SchemaIndex

Parameters
[in,out]prRetValThe StringIndex, if available.
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") of the returning SchemaIndex.
[in]ulClassIDThe class ID.
[in]rsIndexNameThe index name. E.g., if "[MyClassName.Index.IDX_MyIndexName]" in the schema, then "IDX_MyIndexName".
Returns
A return value < 0 indicates an error.
Attention
The calling instance must not remove the returned object from memory, it only lives as long as this object.

◆ _getObjectStrIndexIterator()

virtual int glo::IndexPool::_getObjectStrIndexIterator ( ObjectStrIndexIterator *& prObjStrIterators,
const std::string & rsSchemaName,
unsigned long ulClassID,
const std::string & rsIndexName ) const
protectedvirtual

Returns the ObjectStrIndexIterator of a specific ObjectStrIndex of a specific database.

Parameters
[in,out]prObjStrIteratorsThe IndexIterator, if available.
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") of the schemaIndex to be delivered.
[in]ulClassIDThe class ID of the TableObjIdIndex.
[in]rsIndexNameThe index name. E.g., if "[MyClassName.Index.IDX_MyIndexName]" in the schema, then "IDX_MyIndexName".
Returns
A return value < 0 indicates an error.
Attention
The calling instance must remove the returned object from memory.

◆ _getObjIdPosTuple()

virtual int glo::IndexPool::_getObjIdPosTuple ( ObjIdPosTuple *& prRetVal,
const std::string & rsSchemaName,
unsigned long ulClassID,
const ObjID & rObjID ) const
protectedvirtual

Returns an object ID with its table position from the TableObjIdIndex with passed class ID in a SchemaIndex with a specific object ID.

Parameters
[in,out]prRetValIf present, a pointer to a copy of the object ID with the table position.
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") to identify the SchemaIndex.
[in]ulClassIDThe class ID to identify the TableObjIdIndex.
[in]rObjIDThe object ID of the entry to be delivered.
Returns
A return value < 0 indicates an error.
Attention
The calling instance must remove the returned object from memory.

◆ _getSchemaIndex()

virtual int glo::IndexPool::_getSchemaIndex ( SchemaIndex *& prRetVal,
const std::string & rsSchemaName ) const
protectedvirtual

Returns a SchemaIndex with a specific name from the m_SchemaIndexMap.

Parameters
[in,out]prRetValThe SchemaIndex, if available.
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") of the SchemaIndex to be returned.
Returns
A return < 0 indicates an error.
Attention
The calling instance must not remove the supplied object not from memory.

◆ _getTableObjIdIndex()

virtual int glo::IndexPool::_getTableObjIdIndex ( TableObjIdIndex *& prRetVal,
const std::string & rsSchemaName,
unsigned long ulClassID ) const
protectedvirtual

Returns a TableObjIdIndex of a certain class from a certain SchemaIndex.

Parameters
[in,out]prRetValThe index, if available.
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") of the returning SchemaIndex.
[in]ulClassIDThe class ID.
Returns
A return value < 0 indicates an error.
Attention
. The calling instance may not remove the returned object from memory, it only lives as long as this object.

◆ _getTableObjIdIndexIterator()

virtual int glo::IndexPool::_getTableObjIdIndexIterator ( TableObjIdIndexIterator *& prTableIterators,
const std::string & rsSchemaName,
unsigned long ulClassID ) const
protectedvirtual

Returns the TableObjIdIndexIterator of a specified TableObjIdIndex of a specified database.

Parameters
[in,out]prTableIteratorsThe IndexIterator, if present.
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") of the schemaIndex to be returned.
[in]ulClassIDThe class ID of the TableObjIdIndex.
Returns
A return value < 0 indicates an error.
Attention
The calling instance must remove the returned object from memory.

◆ _insertDeletedObjID()

virtual int glo::IndexPool::_insertDeletedObjID ( const std::string & rsSchemaName,
const ObjID & rDeletedObjId )
protectedvirtual

Registers the passed object ID for a SchemaIndex as deleted.

Parameters
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") to identify the SchemaIndex.
[in]rDeletedObjIdThe object ID to register as deleted.
Returns
A return value < 0 indicates an error.

◆ _insertFreeObjIDPos()

virtual int glo::IndexPool::_insertFreeObjIDPos ( const std::string & rsSchemaName,
unsigned long ulClassID,
std::streampos Pos )
protectedvirtual

Registers a free table position in a TableObjIdIndex with passed class ID in a SchemaIndex.

Parameters
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") to identify the SchemaIndex.
[in]ulClassIDThe class ID to identify the TableObjIdIndex.
[in]PosThe table position to be registered as 'free'.
Returns
A return value < 0 indicates an error.

◆ _insertObjIdPosTuple()

virtual int glo::IndexPool::_insertObjIdPosTuple ( const std::string & rsSchemaName,
unsigned long ulClassID,
const ObjIdPosTuple & rIndexTuple )
protectedvirtual

Inserts an object ID with the table position into a TableObjIdIndex in a SchemaIndex.

Parameters
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") to identify the SchemaIndex.
[in]ulClassIDThe class ID to identify the TableObjIdIndex.
[in]rIndexTupleThe object ID to be inserted with the table position.
Returns
A return value < 0 indicates an error.
Attention
The SchemaIndex and the TableIndex must be created before (see: IndexPool::_makeTableObjIdIndex (...) ).

◆ _insertObjStrIdTuple()

virtual int glo::IndexPool::_insertObjStrIdTuple ( const std::string & rsSchemaName,
unsigned long ulClassID,
const std::string & rsIndexName,
const ObjStrIdTuple & rIndexTuple )
protectedvirtual

Inserts a StringIndex into an ObjectStrIndex in a SchemaIndex.

Parameters
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") around the SchemaIndex.
[in]ulClassIDThe class ID to identify the ObjectStrIndex. identify.
[in]rsIndexNameThe name of the ObjectStrIndex. If e.g. in Scheme "[MyClassName.Index.IDX_MyIndexName]", then "IDX_MyIndexName".
[in]rIndexTupleThe index to be inserted.
Returns
A return value < 0 indicates an error.
Attention
The SchemaIndex and the Object-StringIndex must be created before (see: IndexPool::_makeObjectStrIndex (...) ).

◆ _isObjIdDeleted()

virtual bool glo::IndexPool::_isObjIdDeleted ( const std::string & rsSchemaName,
const ObjID & rObjID ) const
protectedvirtual

Checks if an object ID in a schema index is marked as deleted.

Parameters
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") to identify the SchemaIndex.
[in]rObjIDThe object ID to be checked.
Returns
Returns true if the passed object ID is marked as deleted, otherwise false.

◆ _isObjIdFree()

virtual int glo::IndexPool::_isObjIdFree ( const std::string & rsSchemaName,
unsigned long ulClassID,
const ObjID & rObjID ) const
protectedvirtual

Checks an object ID whether it is already managed in a TableObjIdIndex in a SchemaIndex.

Parameters
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") to identify the SchemaIndex.
[in]ulClassIDThe class ID to identify the TableObjIdIndex.
[in]rObjIDThe object ID to be checked.
Returns
Returns 1, if rObjID is not managed, otherwise 0.
. A return value < 0 indicates an error.

◆ _makeObjectStrIndex()

virtual int glo::IndexPool::_makeObjectStrIndex ( const std::string & rsSchemaName,
const std::string & rsTablePathName,
unsigned long ulClassID,
const std::string & rsIndexName,
bool bUnique )
protectedvirtual

Generates an ObjectStrIndex with a name, for a class with a certain class ID for a certain schema index. If the SchemaIndex does not exist yet, it will be generated too.

Parameters
[in]rsSchemaNameThe schema name (e.g. "MyGloBase").
[in]rsTablePathNameThe complete directory name necessary for the ObjectStrIndex in which the tables can be found, e.g. "C:/Path/Data/".
[in]ulClassIDThe class ID of the managed indexes.
[in]rsIndexNameThe index name. E.g., if "[MyClassName.Index.IDX_MyIndexName]" in the schema, then "IDX_MyIndexName".
[in]bUniqueIf true, then this is a unique index (each entry can only exist once), otherwise several identical entries are possible.
Returns
A return value < 0 indicates an error.

◆ _makeTableObjIdIndex()

virtual int glo::IndexPool::_makeTableObjIdIndex ( const std::string & rsSchemaName,
const std::string & rsTablePathName,
unsigned long ulClassID )
protectedvirtual

Generates a TableObjIdIndex for a class with a certain class ID for a certain schema index. If the SchemaIndex does not exist yet, it will be generated too.

Parameters
[in]rsSchemaNameThe schema name (e.g. "MyGloBase").
[in]rsTablePathNameThe complete directory name necessary for the TableObjIdIndex in which the tables can be found, e.g. "C:/Path/Data/".
[in]ulClassIDThe class ID of the managed indexes.
Returns
A return value < 0 indicates an error.

◆ _removeFreeObjIDPos()

virtual int glo::IndexPool::_removeFreeObjIDPos ( const std::string & rsSchemaName,
unsigned long ulClassID,
std::streampos Pos )
protectedvirtual

Removes a free table position in a TableObjIdIndex with passed class ID in a SchemaIndex.

Parameters
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") to identify the SchemaIndex.
[in]ulClassIDThe class ID to identify the TableObjIdIndex.
[in]PosThe remote table position.
Returns
A return value < 0 indicates an error.

◆ _removeSchemaIndex()

int glo::IndexPool::_removeSchemaIndex ( const std::string & rsSchemaName)
protected

Removes the SchemaIndex with passed schema name from m_SchemaIndexMap.

Parameters
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") of the schema index to be removed.
Returns
A return value < 0 indicates an error.

◆ copyMapFrom()

void glo::IndexPool::copyMapFrom ( const IndexPool & rT)
protected

Removes all objects from m_SchemaIndexMap and from memory. Then all elements of the same list of the passed IndexPool are copied.
Is used by the operator=.

Parameters
[in]rTThe IndexPool whose indexes are to be copied.
Note
This method locks further calls of methods of this class, which are protected with m_LocalCriticalSection.

◆ deleteAllSchemaIndexValues()

void glo::IndexPool::deleteAllSchemaIndexValues ( )

Removes all objects from m_SchemaIndexMap and from memory

Note
This method locks further calls of methods of this class, which are protected with m_LocalCriticalSection.

◆ getObjectStrIndexIterator()

virtual int glo::IndexPool::getObjectStrIndexIterator ( ObjectStrIndexIterator *& prObjectStrIndexIterators,
const std::string & rsSchemaName,
unsigned long ulClassID,
const std::string & rsIndexName ) const
virtual

Returns the ObjectStrIndexIterator of a specific ObjectStrIndex of a specific database.

Parameters
[in,out]prObjectStrIndexIteratorsThe iterator, if available.
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") of the schemaIndex to be returned.
[in]ulClassIDThe class ID of the TableObjIdIndex.
[in]rsIndexNameThe name of the index to be checked. E.g., if "[MyClassName.Index.IDX_MyIndexName]" in the schema, then "IDX_MyIndexName".
Returns
A return value < 0 indicates an error.
Attention
The calling instance must remove the returned object from memory.
Note
This method locks further calls of methods of this class, which are protected with m_LocalCriticalSection.

◆ getObjIdPosTuple()

virtual int glo::IndexPool::getObjIdPosTuple ( ObjIdPosTuple *& prRetVal,
const std::string & rsSchemaName,
unsigned long ulClassID,
const ObjID & rObjID ) const
virtual

Returns an object ID with its table position from the TableObjIdIndex with passed class ID in a SchemaIndex with a specific object ID.

Parameters
[in,out]prRetValIf present, a pointer to a copy of the object ID with the table position.
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") to identify the SchemaIndex.
[in]ulClassIDThe class ID to identify the TableObjIdIndex.
[in]rObjIDThe object ID of the entry to be delivered.
Returns
A return value < 0 indicates an error.
Attention
The calling instance must remove the returned object from memory.
Note
This method locks further calls of methods of this class, which are protected with m_LocalCriticalSection.

◆ getTableObjIdIndexIterator()

virtual int glo::IndexPool::getTableObjIdIndexIterator ( TableObjIdIndexIterator *& prTableIterators,
const std::string & rsSchemaName,
unsigned long ulClassID ) const
virtual

Returns the TableObjIdIndexIterator of a specified TableObjIdIndex of a specified database.

Parameters
[in,out]prTableIteratorsThe iterator, if present.
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") of the schemaIndex to be returned.
[in]ulClassIDThe class ID of the TableObjIdIndex.
Returns
A return value < 0 indicates an error.
Attention
The calling instance must remove the returned object from memory.
Note
This method locks further calls of methods of this class, which are protected with m_LocalCriticalSection.

◆ insertDeletedObjID()

virtual int glo::IndexPool::insertDeletedObjID ( const std::string & rsSchemaName,
const ObjID & rDeletedObjId )
virtual

Registers the passed object ID for a SchemaIndex as deleted.

Parameters
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") to identify the SchemaIndex.
[in]rDeletedObjIdThe object ID to register as deleted.
Returns
A return value < 0 indicates an error.
Note
This method locks further calls of methods of this class, which are protected with m_LocalCriticalSection.

◆ insertObjIdPosTuple()

virtual int glo::IndexPool::insertObjIdPosTuple ( const std::string & rsSchemaName,
unsigned long ulClassID,
const ObjIdPosTuple & rIndexTuple )
virtual

Inserts an object ID with the table position into a TableObjIdIndex in a SchemaIndex.

Parameters
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") to identify the SchemaIndex.
[in]ulClassIDThe class ID to identify the TableObjIdIndex.
[in]rIndexTupleThe object ID to be inserted with the table position.
Returns
A return value < 0 indicates an error.
Attention
The SchemaIndex and the TableIndex must be created before (see: IndexPool::_makeTableObjIdIndex (...) ).
Note
This method locks further calls of methods of this class, which are protected with m_LocalCriticalSection.

◆ insertObjStrIdTuple()

virtual int glo::IndexPool::insertObjStrIdTuple ( const std::string & rsSchemaName,
unsigned long ulClassID,
const std::string & rsIndexName,
const ObjStrIdTuple & rIndexTuple )
virtual

Inserts a StringIndex into an ObjectStrIndex in a SchemaIndex.

Parameters
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") around the SchemaIndex.
[in]ulClassIDThe class ID to identify the ObjectStrIndex. identify.
[in]rsIndexNameThe name of the ObjectStrIndex. If e.g. in Scheme "[MyClassName.Index.IDX_MyIndexName]", then "IDX_MyIndexName".
[in]rIndexTupleThe index to be inserted.
Returns
A return value < 0 indicates an error.
Attention
The SchemaIndex and the Object-StringIndex must be created before (see: IndexPool::_makeObjectStrIndex (...) ).
Note
This method locks further calls of methods of this class, which are protected with m_LocalCriticalSection.

◆ isIndexFree()

virtual int glo::IndexPool::isIndexFree ( const std::string & rsSchemaName,
unsigned long ulClassID,
const ObjID & rObjID,
const std::string & rsIndexName,
const std::string & rsIndex ) const
virtual

Checks if an IndexString is still free for a certain ObjectStrIndex in a SchemaIndex.

Parameters
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") to identify the SchemaIndex.
[in]ulClassIDThe class ID to identify the ObjectStrIndex.
[in]rObjIDThe object ID to identify the ObjectStrIndex.
[in]rsIndexNameThe name of the index to be checked. For example, if in the schema "[MyClassName.Index.IDX_MyIndexName]", then "IDX_MyIndexName".
[in]rsIndexThe index to be checked.
Returns
Returns 1 if not assigned or 0 if already assigned.
A return value < 0 indicates an error.
Note
This method locks further calls of methods of this class, which are protected with m_LocalCriticalSection.

◆ isObjIdDeleted()

virtual bool glo::IndexPool::isObjIdDeleted ( const std::string & rsSchemaName,
const ObjID & rObjID ) const
virtual

Checks if an object ID in a schema index is marked as deleted.

Parameters
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") to identify the SchemaIndex.
[in]rObjIDThe object ID to be checked.
Returns
Returns true if the passed object ID is marked as deleted, otherwise false.
Note
This method locks further calls of methods of this class, which are protected with m_LocalCriticalSection.

◆ isObjIdFree()

virtual int glo::IndexPool::isObjIdFree ( const std::string & rsSchemaName,
const ObjID & rObjID ) const
virtual

Checks an object ID whether it is already managed in a TableObjIdIndex in a SchemaIndex.

Parameters
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") to identify the SchemaIndex.
[in]rObjIDThe object ID to be checked.
Returns
Returns 1, if rObjID is not managed, otherwise 0.
. A return value < 0 indicates an error.
Note
This method locks further calls of methods of this class, which are protected with m_LocalCriticalSection.

◆ operator=()

IndexPool & glo::IndexPool::operator= ( const IndexPool & rT)

Assignment operator.

Parameters
[in]rTThe data is transferred from this object.

◆ releaseAllCommunicatorObjStrIdTuples()

int glo::IndexPool::releaseAllCommunicatorObjStrIdTuples ( const std::string & rsSchemaName,
const NUM_PTR ipReservingComunicator )

Releases all unique string indexes in an ObjectStrIndex in a SchemaIndex that were rereserved by the passed communicator.

Parameters
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") to identify the SchemaIndex.
[in]ipReservingComunicatorThe address of the communicator that reserved the index, cast to NUM_PTR.
Returns
A return < 0 indicates an error.
Exceptions
eut::ErrorNExceptionIf ipReservingComunicator == 0, an exception is thrown.
Note
This method locks further calls of methods of this class, which are protected with m_LocalCriticalSection.
See also
IndexPool::reserveObjStrIdTuple (...)

◆ releaseObjStrIdTuple()

int glo::IndexPool::releaseObjStrIdTuple ( const std::string & rsSchemaName,
unsigned long ulClassID,
const std::string & rsIndexName,
const NUM_PTR ipReservingComunicatorTrx )

Releases a StringIndex into an ObjectStrIndex in a SchemaIndex if it is a unique index.

Parameters
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") to identify the SchemaIndex.
[in]ulClassIDThe class ID to identify the ObjectStrIndex.
[in]rsIndexNameThe name of the ObjectStrIndex. For example, if in the schema "[MyClassName.Index.IDX_MyIndexName]", then "IDX_MyIndexName".
[in]ipReservingComunicatorTrxThe transaction step for which the reservation was requested.
Returns
A return < 0 indicates an error.
Exceptions
eut::ErrorNExceptionIf ipReservingComunicatorTrx == 0, an exception is thrown.
Note
This method locks further calls of methods of this class, which are protected with m_LocalCriticalSection.
See also
IndexPool::reserveObjStrIdTuple (...)

◆ removeObjId()

virtual int glo::IndexPool::removeObjId ( const std::string & rsSchemaName,
unsigned long ulClassID,
const ObjID & rObjID )
virtual

Removes the entry with passed object ID from the TableObjIdIndex with passed class ID in a SchemaIndex.

Parameters
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") to identify the SchemaIndex.
[in]ulClassIDThe class ID to identify the TableObjIdIndex.
[in]rObjIDThe object ID to be removed.
Returns
A return value < 0 indicates an error.
Attention
The SchemaIndex and the TableObjIdIndex must be created before (see: IndexPool::_makeTableObjIdIndex (...) ).
Note
This method locks further calls of methods of this class, which are protected with m_LocalCriticalSection.

◆ removeObjStrIdTuple()

virtual int glo::IndexPool::removeObjStrIdTuple ( const std::string & rsSchemaName,
unsigned long ulClassID,
const std::string & rsIndexName,
const ObjID & rObjID,
NUM_PTR ipReservingComunicatorTrx = 0 )
virtual

Removes string index of an object with passed name from the ObjectStrIndex with passed class ID in a SchemaIndex

Parameters
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") to identify the SchemaIndex.
[in]ulClassIDThe class ID to identify the ObjectStrIndex.
[in]rsIndexNameThe name of the ObjectStrIndex. For example, if in the schema "[MyClassName.Index.IDX_MyIndexName]", then "IDX_MyIndexName".
[in]rObjIDThe object ID of the index to be removed.
[in]ipReservingComunicatorTrxThe address, casted to NUM_PTR, of a Communicator in whose transaction the index was reserved, if applicable. If this is set, only a reserved index is deleted.
Returns
A return value < 0 indicates an error.
Attention
The SchemaIndex and the Object-StringIndex must be created before (see: IndexPool::_makeObjectStrIndex (...) ).
Note
This method locks further calls of methods of this class, which are protected with m_LocalCriticalSection.

◆ reserveObjStrIdTuple()

int glo::IndexPool::reserveObjStrIdTuple ( const std::string & rsSchemaName,
unsigned long ulClassID,
const std::string & rsIndexName,
const ObjStrIdTuple & rIndexTuple )

Reserves a StringIndex into an ObjectStrIndex in a SchemaIndex if it is a unique index.

Parameters
[in]rsSchemaNameThe schema name (e.g. "MyGloBase") to identify the SchemaIndex.
[in]ulClassIDThe class ID to identify the ObjectStrIndex.
[in]rsIndexNameThe name of the ObjectStrIndex. For example, if in the schema "[MyClassName.Index.IDX_MyIndexName]", then "IDX_MyIndexName".
[in]rIndexTupleThe index to be reserved.
Returns
A return value < 0 indicates an error.
Exceptions
eut::ErrorNExceptionIf ObjStrIdTuple::m_ipReservingComunicatorTrx is not set in the parameter rIndexTuple, an exception is thrown.
Note
This method locks further calls of methods of this class, which are protected with m_LocalCriticalSection.
See also
IndexPool::releaseObjStrIdTuple (...)

Member Data Documentation

◆ m_LocalCriticalSection

eut::CriticalSection glo::IndexPool::m_LocalCriticalSection
protected

To ensure thread-safe access to the elements of the IndexPool and subclasses, access is synchronized via this local CriticalSection.

◆ m_SchemaIndexMap

std::map< std::string, SchemaIndex * , std::less< std::string > > glo::IndexPool::m_SchemaIndexMap
protected

For each open database there is a SchemaIndex.


The documentation for this class was generated from the following file: