GlobalObjects
|
The real index as opposed to the TransactionIndexPool, which is created for each transaction More...
#include <GloRealIndexPool.h>
Public Member Functions | |
RealIndexPool () | |
RealIndexPool (const RealIndexPool &rT) | |
virtual | ~RealIndexPool () |
virtual bool | existsSchemaIndex (const std::string &rsSchemaName) const |
virtual int | getFreeObjIDPos (std::streampos &rPos, const std::string &rsSchemaName, unsigned long ulClassID) const |
std::size_t | getNumberOfClassInfos (const SchemaInterface &rSchemaInterface) const |
std::size_t | getNumberOfIndexes (const SchemaInterface &rSchemaInterface) const |
virtual int | insertFreeObjIDPos (const std::string &rsSchemaName, unsigned long ulClassID, std::streampos Pos) |
void | notifyIndexReadWrite (TdWatchNotifyMode iMode, const std::string &rsSchemaName, const ObjID &rObjID, int iFraction, int iActions) |
RealIndexPool & | operator= (const RealIndexPool &rT) |
int | readIndexes (const SchemaInterface &rSchemaInterface) |
int | reindex (const SchemaInterface &rSchemaInterface) |
int | reindex (const SchemaInterface &rSchemaInterface, int iActions) |
int | reindexObjIDIndexes (const SchemaInterface &rSchemaInterface) |
int | reindexObjStrIndexes (const SchemaInterface &rSchemaInterface) |
virtual int | removeFreeObjIDPos (const std::string &rsSchemaName, unsigned long ulClassID, std::streampos Pos) |
int | removeSchemaIndex (const std::string &rsSchemaName) |
void | setWatchNotifyManager (WatchNotifyManager *pWatchNotifyManager) |
int | writeIndexes (const SchemaInterface &rSchemaInterface) |
int | writeIndexes (const SchemaInterface &rSchemaInterface, int iActions) |
int | writeObjIDIndexes (const SchemaInterface &rSchemaInterface) const |
int | writeObjStrIndexes (const SchemaInterface &rSchemaInterface) const |
Public Member Functions inherited from glo::IndexPool | |
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 |
IndexPool & | operator= (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 | |
int | _createObjIDIndexFromTable (const SchemaInterface &rSchemaInterface, const ClassInfoAttribute &rClassInfoAttribute) |
int | _createObjStrIndexFromTables (const SchemaInterface &rSchemaInterface, const ClassInfoIndex &rClassInfoIndex) |
int | _getIndexString (std::string &rsRetValIndex, const std::vector< eut::LanguageFunctions::EnLanguageKey > &rLanguageKeys, bool bCaseSensitive, const SchemaInterface &rSchemaInterface, unsigned long ulClassID, const ObjID &rObjID, const ClassInfoIndex::IndexAttributeItem &rIndexAttributeItem) |
int | _readObjIDIndexes (const SchemaInterface &rSchemaInterface) |
int | _readObjStrIndexes (const SchemaInterface &rSchemaInterface) |
int | _reindexObjIDIndexes (const SchemaInterface &rSchemaInterface) |
int | _reindexObjStrIndexes (const SchemaInterface &rSchemaInterface) |
int | _writeObjIDIndexes (const SchemaIndex &rSchemaIndex) const |
int | _writeObjIDIndexes (const SchemaInterface &rSchemaInterface) const |
int | _writeObjStrIndexes (const SchemaIndex &rSchemaIndex) const |
int | _writeObjStrIndexes (const SchemaInterface &rSchemaInterface) const |
Protected Member Functions inherited from glo::IndexPool | |
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) |
Private Attributes | |
int | m_iActions |
WatchNotifyManager * | m_pWatchNotifyManager |
Additional Inherited Members | |
Protected Attributes inherited from glo::IndexPool | |
eut::CriticalSection | m_LocalCriticalSection |
std::map< std::string, SchemaIndex *, std::less< std::string > > | m_SchemaIndexMap |
The real index as opposed to the TransactionIndexPool, which is created for each transaction
glo::RealIndexPool::RealIndexPool | ( | ) |
Standard constructor.
glo::RealIndexPool::RealIndexPool | ( | const RealIndexPool & | rT | ) |
Copy constructor.
[in] | rT | The data is copied from this object. |
|
virtual |
Destructor.
|
protected |
Generates a TableObjIdIndex from the data of an object table.
[in] | rSchemaInterface | For schema name and the path to the tables. |
[in] | rClassInfoAttribute | For table name and ClassID. |
|
protected |
Generates a ObjectStrIndex from the data of an object table.
[in] | rSchemaInterface | For the schema name and the path to the tables. |
[in] | rClassInfoIndex | For table name and ClassID. |
|
protected |
Returns the index string from passed Class ID, Object ID and ClassInfoIndex::IndexAttributeItem.
The passed class ID indicates in which table a record with the passed ObjID can be found.
The first AttributeID in ClassInfoIndex::IndexAttributeItem determines the data field. If there is a second AttributeID in ClassInfoIndex::IndexAttributeItem, the data field must contain an object ID (otherwise error) and the same method is called recursively.
Otherwise the entry in the data field is returned as a string in the specified length and form.
[in,out] | rsRetValIndex | The resulting string. |
[in] | rLanguageKeys | The language keys in a vector. |
[in] | bCaseSensitive | If false, all characters in the rsRetValIndex are converted to upper case. |
[in] | rSchemaInterface | For the schema name and the path to the tables. |
[in] | ulClassID | The class ID specifies the table to be searched. |
[in] | rObjID | The objectID of the object. |
[in] | rIndexAttributeItem | The information which attribute is to be taken. |
|
protected |
Reads all objects of type TableObjIdIndex of a database from the file system (ODX and FDX files) into memory. The read files are deleted so that it can be determined whether the current index was written after a crash of the GlobalObjects application.
[in] | rSchemaInterface | The schema interface represents the database. |
|
protected |
Reads all objects of type ObjectStrIndex of a database from the file system (SDX files) into memory. The read files are deleted so that it can be determined whether the current index was written after a crash of the GlobalObjects application.
[in] | rSchemaInterface | The schema interface represents the database. |
|
protected |
Reindexes all objects of type TableObjIdIndex of a database into memory.
[in] | rSchemaInterface | The schema interface represents the database. |
|
protected |
Reindexes all objects of type ObjectStrIndex of a database into memory.
[in] | rSchemaInterface | The schema interface represents the database. |
|
protected |
Writes all objects of type TableObjIdIndex of a database from memory to the file system (ODX and FDX files)
[in] | rSchemaIndex | The schema index whose XX is to be written. |
|
protected |
Writes all objects of type TableObjIdIndex of a database from memory to the file system (ODX and FDX files)
[in] | rSchemaInterface | The schema interface represents the database. |
|
protected |
Writes all objects of type ObjectStrIndex of a database from memory to the file system (SDX files)
[in] | rSchemaIndex | The schema index whose XX is to be written. |
|
protected |
Writes all objects of type ObjectStrIndex of a database from memory to the file system (SDX files)
[in] | rSchemaInterface | The schema interface represents the database. |
|
virtual |
Checks if a SchemaIndex with the passed name exists.
[in] | rsSchemaName | The schema name (e.g. "MyGloBase") of the schemaIndex to be checked. |
|
virtual |
Returns a free table position in a TableObjIdIndex with passed class ID in a SchemaIndex.
[in,out] | rPos | The free table position, if one was available. |
[in] | rsSchemaName | The schema name (e.g. "MyGloBase") to identify the SchemaIndex. |
[in] | ulClassID | The class ID to identify the TableObjIdIndex. |
std::size_t glo::RealIndexPool::getNumberOfClassInfos | ( | const SchemaInterface & | rSchemaInterface | ) | const |
Returns the number of class information of the passed schema. Is used here to determine the number of ObjectID indexing actions. Two ObjID indexes (real and released) are maintained for each class information.
[in] | rSchemaInterface | The schema interface represents the database. |
std::size_t glo::RealIndexPool::getNumberOfIndexes | ( | const SchemaInterface & | rSchemaInterface | ) | const |
Returns the number of string indexes of all classes of the passed schema that can be indexed.
[in] | rSchemaInterface | The schema interface represents the database. |
|
virtual |
Registers a free table position in a TableObjIdIndex with passed class ID in a SchemaIndex.
[in] | rsSchemaName | The schema name (e.g. "MyGloBase") to identify the SchemaIndex. |
[in] | ulClassID | The class ID to identify the TableObjIdIndex. |
[in] | Pos | The table position to be registered as 'free'. |
void glo::RealIndexPool::notifyIndexReadWrite | ( | TdWatchNotifyMode | iMode, |
const std::string & | rsSchemaName, | ||
const ObjID & | rObjID, | ||
int | iFraction, | ||
int | iActions ) |
Generates a notification request and passes it to the referenced WatchNotifyManager in m_pWatchNotifyManager.
[in] | iMode | The watch mode. |
[in] | rsSchemaName | The schema name for the WatchNotifyManager::NotifyIndexReadWriteInfo::m_sSchemaName. |
[in] | rObjID | The object ID for the WatchNotifyManager::NotifyIndexReadWriteInfo::m_ObjID. |
[in] | iFraction | The progress. |
[in] | iActions | The expected number of actions. |
RealIndexPool & glo::RealIndexPool::operator= | ( | const RealIndexPool & | rT | ) |
Assignment operator.
[in] | rT | The data is transferred from this object. |
int glo::RealIndexPool::readIndexes | ( | const SchemaInterface & | rSchemaInterface | ) |
Reads all indexes of a database from the index files.
[in] | rSchemaInterface | The schema interface represents the database. |
int glo::RealIndexPool::reindex | ( | const SchemaInterface & | rSchemaInterface | ) |
Reindexes all indexes of a database into memory.
[in] | rSchemaInterface | The schema interface represents the database. |
int glo::RealIndexPool::reindex | ( | const SchemaInterface & | rSchemaInterface, |
int | iActions ) |
Reindexes all indexes of a database into memory.
[in] | rSchemaInterface | The schema interface represents the database. |
[in] | iActions | If passed, this value is used as the total action number for Notify. |
int glo::RealIndexPool::reindexObjIDIndexes | ( | const SchemaInterface & | rSchemaInterface | ) |
Reindexes all objects of type TableObjIdIndex of a database into memory.
[in] | rSchemaInterface | The schema interface represents the database. |
int glo::RealIndexPool::reindexObjStrIndexes | ( | const SchemaInterface & | rSchemaInterface | ) |
Reindexes all objects of type ObjectStrIndex of a database into memory.
[in] | rSchemaInterface | The schema interface represents the database. |
|
virtual |
Removes a free table position in a TableObjIdIndex with passed class ID in a SchemaIndex.
[in] | rsSchemaName | The schema name (e.g. "MyGloBase") to identify the SchemaIndex. |
[in] | ulClassID | The class ID to identify the TableObjIdIndex. |
[in] | Pos | The remote table position. |
int glo::RealIndexPool::removeSchemaIndex | ( | const std::string & | rsSchemaName | ) |
Removes a SchemaIndex.
[in] | rsSchemaName | The schema name (e.g. "MyGloBase") of the schema index to be removed. |
void glo::RealIndexPool::setWatchNotifyManager | ( | WatchNotifyManager * | pWatchNotifyManager | ) |
Sets the m_pWatchNotifyManager. The calling instance must not delete the passed WatchNotifyManager before this object. If necessary, the calling instance must set m_pWatchNotifyManager to nullptr via this method.
[in] | pWatchNotifyManager | The WatchNotifyManager to be referenced. |
int glo::RealIndexPool::writeIndexes | ( | const SchemaInterface & | rSchemaInterface | ) |
Writes all indexes of a database from memory to the file system (ODX, FDX and SDX files)
[in] | rSchemaInterface | The schema interface represents the database. |
int glo::RealIndexPool::writeIndexes | ( | const SchemaInterface & | rSchemaInterface, |
int | iActions ) |
Writes all indexes of a database from memory to the file system (ODX, FDX and SDX files)
[in] | rSchemaInterface | The schema interface represents the database. |
[in] | iActions | If passed, this value is used as the total action number for Notify. |
int glo::RealIndexPool::writeObjIDIndexes | ( | const SchemaInterface & | rSchemaInterface | ) | const |
Writes all objects of type TableObjIdIndex of a database from memory to the file system (ODX and FDX files)
[in] | rSchemaInterface | The schema interface represents the database. |
int glo::RealIndexPool::writeObjStrIndexes | ( | const SchemaInterface & | rSchemaInterface | ) | const |
Writes all objects of type ObjectStrIndex of a database from memory to the file system (SDX files)
[in] | rSchemaInterface | The schema interface represents the database. |
|
private |
When an action to be notified by the m_pWatchNotifyManager is executed, the expected overall actions are entered here.
|
private |
If available, it is used to inform clients about index actions. Is managed by the calling instance!