GlobalObjects
|
An object of this class accesses tables and reads data records (Record) and binary files (eut::Blob). More...
#include <GloTableReaderInterface.h>
Classes | |
class | AllSetObjectStrIndexIteratorItem |
Objects of this type are managed in the m_pAllSetObjectStrIndexIteratorMap to ensure that an AllSet with index can be reopened in method TableReaderInterface::setTransactionIndexPool(TransactionIndexPool*). More... | |
Public Member Functions | |
TableReaderInterface (const SchemaInterface &rScheme, RealIndexPool *pRealIndexPool) | |
virtual | ~TableReaderInterface () |
int | closeAllSet (NUM_PTR ipClientAllSetAddress) |
int | getAllObjIDs (std::list< ObjID > &rRetValList) |
int | getIndexedObjIdListFromAllSet (std::list< ObjID > &rRetValList, NUM_PTR ipClientAllSetAddress, const std::string &rsIndexSearchValue, EnComparisionOp eComparisionOp) const |
int | getIndexedObjIdListFromAllSet (std::list< ObjID > &rRetValList, NUM_PTR ipClientAllSetAddress, const std::string &rsIndexSearchValue, EnQueryType eQuerryType) const |
int | getIndexedObjIdListFromAllSet (std::list< ObjID > &rRetValList, NUM_PTR ipClientAllSetAddress, const std::string &rsRangeStartIndex, const std::string &rsRangeEndIndex) const |
int | getObjectData (Record *&prRetVal, const ObjID &rObjID, ReaderInfo *pReaderInfo) |
int | getObjIdFromAllSet (ObjID &rObjID, NUM_PTR ipClientAllSetAddress, EnSeekMode eMode) const |
int | getObjIDs (std::list< ObjID > &rRetValList, unsigned long ulClassID) |
int | getObjIDs (std::map< ObjID, ObjID, std::less< ObjID > > &rRetValMap, unsigned long ulClassID) |
RealIndexPool * | getRealIndexPool () const |
int | getRecord (Record *&prRetVal, const ObjID &rObjID, ReaderInfo *pReaderInfo) |
int | getSizeFromAllSet (std::size_t &rnSize, NUM_PTR ipClientAllSetAddress) const |
TransactionIndexPool * | getTransactionIndexPool () const |
int | isAllSetOpen (NUM_PTR ipClientAllSetAddress) const |
int | objIDInAllSet (const ObjID &rObjID, NUM_PTR ipClientAllSetAddress) const |
int | openAllSet (NUM_PTR ipClientAllSetAddress, unsigned long ulClassID, bool bWithSubClasses) |
int | openAllSet (NUM_PTR ipClientAllSetAddress, unsigned long ulClassID, const std::string &rsIndexName) |
virtual int | openTable (const std::string &sTableName) |
void | refreshAllTables () |
int | removeFilterInAllSet (NUM_PTR ipClientAllSetAddress) const |
int | setCurrentObjectInAllSet (const ObjID &rObjID, NUM_PTR ipClientAllSetAddress) const |
int | setFilterInAllSet (NUM_PTR ipClientAllSetAddress, const std::string &rsIndexFilterValue) const |
int | setFilterInAllSet (NUM_PTR ipClientAllSetAddress, const std::string &rsIndexFilterValue, EnComparisionOp eComparisionOp) const |
int | setFilterInAllSet (NUM_PTR ipClientAllSetAddress, const std::string &rsRangeStartIndex, const std::string &rsRangeEndIndex) const |
int | setPositionInAllSet (std::size_t nPosition, NUM_PTR ipClientAllSetAddress) const |
int | setTransactionIndexPool (TransactionIndexPool *pTransactionIndexPool) |
Public Member Functions inherited from glo::TableInterface | |
TableInterface (const SchemaInterface &rScheme, RealIndexPool *pRealIndexPool) | |
virtual | ~TableInterface () |
virtual int | closeTable (const std::string &sTable) |
std::string | getDataPath () const |
int | getObjIDRecordAttribute (ObjIDRecordAttribute *&prRetVal, const std::string &sTable, const ObjID &rObjID) |
SchemaInterface & | getSchemaInterface () |
std::string | getSchemaPath () const |
int | objIDInBase (bool &rPresent, const ObjID &rObjID) const |
Protected Member Functions | |
TableReaderInterface () | |
int | generateRecord (Record *&prRetVal, const std::string &sFieldNameRow, const std::string &sDataRow, std::streampos StreamPosRow, const std::string &rsTable, bool bOnlyClassIDTable=false) |
int | getObjectData (Record *&prRetVal, const ObjID &rObjID, ReaderInfo *pReaderInfo, bool bInRecursion) |
int | getObjectDataFromDataRow (Record *&prRetVal, const ObjID &rObjID, unsigned long ulClassID, bool bOnlyClassIDTable=false) |
int | getObjectDataFromDataRow (std::shared_ptr< Record > &sprRetVal, const ObjID &rObjID, unsigned long ulClassID, bool bOnlyClassIDTable=false) |
int | getObjIDs (std::list< ObjID > *pRetValList, std::map< ObjID, ObjID, std::less< ObjID > > *pRetValMap, unsigned long ulClassID) |
int | getRecord (Record *&prRetVal, const std::string &sTableName, const ObjID &rObjID, unsigned long ulClassID, bool bOnlyClassIDTable=false) |
int | getRecordAttribute (BaseRecordAttribute *&prRetVal, const ClassInfoAttribute &rClassInfoAttribute, const ObjID &rObjID, const std::string &sPath) |
IndexPool::TableObjIdIndexIterator * | openAllSet (int &riErr, NUM_PTR ipClientAllSetAddress, unsigned long ulClassID, bool bWithSubClasses=true) |
IndexPool::ObjectStrIndexIterator * | openAllSet (int &riErr, NUM_PTR ipClientAllSetAddress, unsigned long ulClassID, const std::string &rsIndexName) |
Protected Member Functions inherited from glo::TableInterface | |
TableInterface () | |
int | openFile (std::fstream *&prFStream, const std::string &sFullFileName, std::ios_base::openmode OpenMode) |
Private Member Functions | |
TableReaderInterface (const TableReaderInterface &) | |
void | deleteAllSetObjectStrIndexIteratorMap (std::map< NUM_PTR, AllSetObjectStrIndexIteratorItem *, std::less< NUM_PTR > > *pMapToDelete) |
void | deleteAllSetTableObjIdIndexIteratorMap (std::map< NUM_PTR, IndexPool::TableObjIdIndexIterator *, std::less< NUM_PTR > > *pMapToDelete) |
TableInterface & | operator= (const TableInterface &) |
Private Attributes | |
std::map< NUM_PTR, AllSetObjectStrIndexIteratorItem *, std::less< NUM_PTR > > * | m_pAllSetObjectStrIndexIteratorMap |
std::map< NUM_PTR, IndexPool::TableObjIdIndexIterator *, std::less< NUM_PTR > > * | m_pAllSetTableObjIdIndexIteratorMap |
TransactionIndexPool * | m_pTransactionIndexPool |
std::map< ObjID, Record *, std::less< ObjID > > | m_RecursionRecordMap |
Additional Inherited Members | |
Protected Attributes inherited from glo::TableInterface | |
std::map< std::string, TableInterfaceTable *, std::less< std::string > > | m_OpenTableMap |
RealIndexPool * | m_pRealIndexPool |
SchemaInterface * | m_pSchema |
An object of this class accesses tables and reads data records (Record) and binary files (eut::Blob).
All tables known to the schema are opened when instantiating, and closed again when destroying.
|
protected |
The default constructor is not available.
glo::TableReaderInterface::TableReaderInterface | ( | const SchemaInterface & | rScheme, |
RealIndexPool * | pRealIndexPool ) |
Constructor with parameter passing.
[in] | rScheme | Cannot be used without schema, will be copied. |
[in] | pRealIndexPool | Accelerates the access to records. |
eut::ErrorNException | An exception is thrown if an error occurs. |
|
virtual |
Destructor, all open table files are closed and the memory is cleaned up.
|
private |
The copy constructor is not available.
int glo::TableReaderInterface::closeAllSet | ( | NUM_PTR | ipClientAllSetAddress | ) |
Closes an AllSet with the passed Client-AllSet address.
[in] | ipClientAllSetAddress | The client AllSet address. |
|
private |
Deletes the objects in the passed AllSetObjectStrIndexIteratorMap and the objects themselves.
[in] | pMapToDelete | The map to be deleted. |
|
private |
Deletes the objects in the passed AllSetTableObjIdIndexIteratorMap and the objects themselves.
[in] | pMapToDelete | The map to be deleted. |
|
protected |
Generates a data set and transfers all data, determined from the parameters, into the data set attributes.
[in,out] | prRetVal | The generated data set. |
[in] | sFieldNameRow | The row with the table field names (e.g. "ObjID|CreateDate|LastChange|") from the table file. |
[in] | sDataRow | The row with the table data (e.g. "13.0.2|1453983511|1455873934|") from the table file. |
[in] | StreamPosRow | The position of the table data row in the table file. |
[in] | rsTable | The complete table file name. |
[in] | bOnlyClassIDTable | If true, only the record attributes is read from the table and not e.g. the possibly existing blob and string files. |
int glo::TableReaderInterface::getAllObjIDs | ( | std::list< ObjID > & | rRetValList | ) |
Returns all object IDs from the Persistent table (Class ID == 1).
[in,out] | rRetValList | Found object IDs are returned here. The list is cleared before. |
int glo::TableReaderInterface::getIndexedObjIdListFromAllSet | ( | std::list< ObjID > & | rRetValList, |
NUM_PTR | ipClientAllSetAddress, | ||
const std::string & | rsIndexSearchValue, | ||
EnComparisionOp | eComparisionOp ) const |
Returns a list of object IDs from AllSet in relation to the parameters passed. Results can be defined using the parameter eComparisionOp. For example, if parameter rsIndexSearchValue has the value "123" and parameter eComparisionOp has the value LESS, all objects with an index smaller than "123" are returned.
[in,out] | rRetValList | The object IDs of the found object IDs are delivered to this list. |
[in] | ipClientAllSetAddress | The unique Client-AllSet address. |
[in] | rsIndexSearchValue | The index value. |
[in] | eComparisionOp | The comparison operator. |
int glo::TableReaderInterface::getIndexedObjIdListFromAllSet | ( | std::list< ObjID > & | rRetValList, |
NUM_PTR | ipClientAllSetAddress, | ||
const std::string & | rsIndexSearchValue, | ||
EnQueryType | eQuerryType ) const |
Returns a list of object IDs from an AllSet in relation to the parameters passed.
[in,out] | rRetValList | The object IDs of the found object IDs are returned to this list. |
[in] | ipClientAllSetAddress | The unique Client-AllSet address. |
[in] | rsIndexSearchValue | The index expression can contain the placeholders '*' and '?', which are taken into account in the evaluation or if parameter eQueryType == eOQL, the string is interpreted as OQL expression. |
[in] | eQuerryType | The query type. |
int glo::TableReaderInterface::getIndexedObjIdListFromAllSet | ( | std::list< ObjID > & | rRetValList, |
NUM_PTR | ipClientAllSetAddress, | ||
const std::string & | rsRangeStartIndex, | ||
const std::string & | rsRangeEndIndex ) const |
Returns a list of object IDs from AllSet in relation to the parameters passed. Results can be defined using a range specification. If, for example, parameter rsRangeStartIndex has the value "123" and parameter rsRangeEndIndex has the value "155", all objects with an index greater than/equal to "123" and less than/equal to "155" are delivered.
[in,out] | rRetValList | The object IDs of the found object IDs are delivered to this list. |
[in] | ipClientAllSetAddress | The unique Client-AllSet address. |
[in] | rsRangeStartIndex | The start index value. |
[in] | rsRangeEndIndex | The end index value. |
int glo::TableReaderInterface::getObjectData | ( | Record *& | prRetVal, |
const ObjID & | rObjID, | ||
ReaderInfo * | pReaderInfo ) |
Returns all record attributes in a record of the object with passed object ID.
[in,out] | prRetVal | The generated record. |
[in] | rObjID | The requested object ID. |
[in] | pReaderInfo | An info, e.g. to inform about locked records, which naturally must not be delivered. |
|
protected |
Returns all record attributes in a record of the object with the object ID passed. Is used by getObjectData(Record*&,const ObjID&,ReaderInfo*).
[in,out] | prRetVal | The generated data set. |
[in] | rObjID | The requested object ID. |
[in] | pReaderInfo | An info, e.g. to inform about locked records, which naturally must not be delivered. |
[in] | bInRecursion | If true, then call in itself. |
|
protected |
Returns all record attributes in a record of the object with the passed object ID.
[in,out] | prRetVal | The generated data set. |
[in] | rObjID | The requested object ID. |
[in] | ulClassID | The class ID. |
[in] | bOnlyClassIDTable | If true, only the data set attributes are read from the table and not e.g., the blob and string files. |
|
protected |
Returns all record attributes in a record of the object with the passed object ID.
[in,out] | sprRetVal | The generated data set. |
[in] | rObjID | The requested object ID. |
[in] | ulClassID | The class ID. |
[in] | bOnlyClassIDTable | If true, only the data set attributes are read from the table and not e.g., the blob and string files. |
int glo::TableReaderInterface::getObjIdFromAllSet | ( | ObjID & | rObjID, |
NUM_PTR | ipClientAllSetAddress, | ||
EnSeekMode | eMode ) const |
Returns an object ID from an AllSet.
[in,out] | rObjID | An object ID found is entered here. |
[in] | ipClientAllSetAddress | The unique Client-AllSet address. |
[in] | eMode | The seek mode. |
Parameter examples:
int glo::TableReaderInterface::getObjIDs | ( | std::list< ObjID > & | rRetValList, |
unsigned long | ulClassID ) |
Returns all object IDs from the table of the class with passed class ID.
[in,out] | rRetValList | Found object IDs are returned here. The list is cleared before. |
[in] | ulClassID | The class ID. |
|
protected |
Returns all object IDs from the table of the class with passed class ID.
[in,out] | pRetValList | Found object IDs are returned here if passed. The list is cleared before. |
[in,out] | pRetValMap | Found object IDs, sorted by these, are placed here if passed. The map is cleared before. |
[in] | ulClassID | The class ID. |
int glo::TableReaderInterface::getObjIDs | ( | std::map< ObjID, ObjID, std::less< ObjID > > & | rRetValMap, |
unsigned long | ulClassID ) |
Returns all object IDs from the table of the class with passed class ID.
[in,out] | rRetValMap | Found object IDs, sorted by these, are returned here. The map is cleared before. |
[in] | ulClassID | The class ID. |
RealIndexPool * glo::TableReaderInterface::getRealIndexPool | ( | ) | const |
Returns the m_pRealIndexPool or NULL_PTR if none exists.
int glo::TableReaderInterface::getRecord | ( | Record *& | prRetVal, |
const ObjID & | rObjID, | ||
ReaderInfo * | pReaderInfo ) |
Returns all record attributes in a record from the table of the object with passed object ID.
[in,out] | prRetVal | The generated record. |
[in] | rObjID | The requested object ID. |
[in] | pReaderInfo | An info, e.g. to inform about locked records, which naturally must not be delivered. In addition, the class ID is set, from whose table is read. |
|
protected |
Returns a record of the object with passed object ID from a table.
[in,out] | prRetVal | The generated data set. |
[in] | sTableName | The table file name. |
[in] | rObjID | The requested object ID. |
[in] | ulClassID | The class ID. |
[in] | bOnlyClassIDTable | If true, only the data set attributes are read from the table of the object with passed class ID. |
|
protected |
First fetches a data set and returns a data set attribute with the attribute ID stored in the passed class information attribute.
[in,out] | prRetVal | Pointer to the found record attribute. |
[in] | rClassInfoAttribute | The class information attribute. |
[in] | rObjID | The requested object ID. |
[in] | sPath | The file path. The file name comes from the class information attribute passed. |
int glo::TableReaderInterface::getSizeFromAllSet | ( | std::size_t & | rnSize, |
NUM_PTR | ipClientAllSetAddress ) const |
Returns the number of elements of an AllSet.
[in,out] | rnSize | The number of elements of the AllSet. |
[in] | ipClientAllSetAddress | The client AllSet address. |
TransactionIndexPool * glo::TableReaderInterface::getTransactionIndexPool | ( | ) | const |
Returns the m_pTransactionIndexPool or NULL_PTR if none exists.
int glo::TableReaderInterface::isAllSetOpen | ( | NUM_PTR | ipClientAllSetAddress | ) | const |
Checks if a IndexPool::TableObjIdIndexIterator from an IndexPool is in m_pAllSetTableObjIdIndexIteratorMap, or a IndexPool::ObjectStrIndexIterator from an IndexPool is in m_pAllSetTableObjIdIndexIteratorMap from an AllSet; i.e. the AllSet is open.
[in] | ipClientAllSetAddress | The unique client AllSet address. |
int glo::TableReaderInterface::objIDInAllSet | ( | const ObjID & | rObjID, |
NUM_PTR | ipClientAllSetAddress ) const |
Checks whether an object with the object ID passed occurs in the AllSet.
[in] | rObjID | The requested object ID. |
[in] | ipClientAllSetAddress | The unique Client-AllSet address. |
|
protected |
Opens an AllSet. This means that a IndexPool::TableObjIdIndexIterator from an IndexPool is inserted in m_pAllSetTableObjIdIndexIteratorMap.
[in,out] | riErr | A return value < 0 indicates an error. |
[in] | ipClientAllSetAddress | The unique Client-AllSet address. |
[in] | ulClassID | The class ID for which an AllSet should be opened. |
[in] | bWithSubClasses | If true, the IndexIterator will also iterate over the objects of the subclasses of the class with passed class ID, otherwise if false, the IndexIterator will only iterate over the objects of the class with passed class ID |
|
protected |
Opens an AllSet. This means that a IndexPool::ObjectStrIndexIterator from an IndexPool is inserted into m_pAllSetObjectStrIndexIteratorMap.
[in,out] | riErr | A return value < 0 indicates an error. |
[in] | ipClientAllSetAddress | The unique Client-AllSet address. |
[in] | ulClassID | The class ID for which an AllSet should be opened. |
[in] | rsIndexName | The index name of the index to iterate over. |
int glo::TableReaderInterface::openAllSet | ( | NUM_PTR | ipClientAllSetAddress, |
unsigned long | ulClassID, | ||
bool | bWithSubClasses ) |
Opens an AllSet. This means that a IndexPool::TableObjIdIndexIterator from an IndexPool is inserted in m_pAllSetTableObjIdIndexIteratorMap.
[in] | ipClientAllSetAddress | The unique Client-AllSet address. |
[in] | ulClassID | The class ID for which an AllSet should be opened. |
[in] | bWithSubClasses | If true, the IndexIterator will also iterate over the objects of the subclasses of the class with passed class ID, otherwise if false, the IndexIterator will only iterate over the objects of the class with passed class ID. |
int glo::TableReaderInterface::openAllSet | ( | NUM_PTR | ipClientAllSetAddress, |
unsigned long | ulClassID, | ||
const std::string & | rsIndexName ) |
Opens an AllSet with an string index. This means that a IndexPool::ObjectStrIndexIterator from an IndexPool is inserted in m_pAllSetTableObjIdIndexIteratorMap.
[in] | ipClientAllSetAddress | The unique Client-AllSet address. |
[in] | ulClassID | The class ID for which an AllSet should be opened. |
[in] | rsIndexName | The index name of the index to iterate over. |
|
virtual |
Opens a table file and adds it to the list of opened table files if successful.
[in] | sTableName | The table file name. |
Implements glo::TableInterface.
|
private |
The assignment operator is not available.
void glo::TableReaderInterface::refreshAllTables | ( | ) |
Refreshes the contents of the table files from the list of opened table files.
int glo::TableReaderInterface::removeFilterInAllSet | ( | NUM_PTR | ipClientAllSetAddress | ) | const |
Removes a filter in an AllSet.
[in] | ipClientAllSetAddress | The client AllSet address. |
int glo::TableReaderInterface::setCurrentObjectInAllSet | ( | const ObjID & | rObjID, |
NUM_PTR | ipClientAllSetAddress ) const |
Sets the IndexIterator of an AllSet to the position of the object with the object ID passed.
[in] | rObjID | The object ID. |
[in] | ipClientAllSetAddress | The unique client AllSet address. |
int glo::TableReaderInterface::setFilterInAllSet | ( | NUM_PTR | ipClientAllSetAddress, |
const std::string & | rsIndexFilterValue ) const |
Sets a filter in an AllSet in relation to the passed parameters.
[in] | ipClientAllSetAddress | The unique client AllSet address. |
[in] | rsIndexFilterValue | The index expression can contain the placeholders '*' and '?', which are taken into account in the evaluation. |
int glo::TableReaderInterface::setFilterInAllSet | ( | NUM_PTR | ipClientAllSetAddress, |
const std::string & | rsIndexFilterValue, | ||
EnComparisionOp | eComparisionOp ) const |
Sets a filter in an AllSet in relation to the passed parameters. The filter can be defined in more detail using the parameter eComparisionOp. For example, if parameter rsIndexFilterValue has the value "123" and parameter eComparisionOp has the value LESS, all objects with an index greater than/equal to "123" are filtered out during iteration.
[in] | ipClientAllSetAddress | The unique Client-AllSet address. |
[in] | rsIndexFilterValue | The index value. |
[in] | eComparisionOp | The comparison operator. |
int glo::TableReaderInterface::setFilterInAllSet | ( | NUM_PTR | ipClientAllSetAddress, |
const std::string & | rsRangeStartIndex, | ||
const std::string & | rsRangeEndIndex ) const |
Sets a filter in an AllSet in relation to the passed parameters. Results can be defined using a range specification. For example, if parameter rsRangeStartIndex has the value "123" and parameter rsRangeEndIndex has the value "155", all objects with an index smaller than "123" and larger than "155" are filtered out during iteration.
[in] | ipClientAllSetAddress | The unique Client-AllSet address. |
[in] | rsRangeStartIndex | The start index value. |
[in] | rsRangeEndIndex | The end index value. |
int glo::TableReaderInterface::setPositionInAllSet | ( | std::size_t | nPosition, |
NUM_PTR | ipClientAllSetAddress ) const |
Sets the IndexIterator of an AllSet to the specified position.
[in] | nPosition | The desired iterator position. |
[in] | ipClientAllSetAddress | The unique client AllSet address. |
int glo::TableReaderInterface::setTransactionIndexPool | ( | TransactionIndexPool * | pTransactionIndexPool | ) |
Takes over the transferred TransactionIndexPool, if none has been taken over yet.
A possible previously referenced TransactionIndexPool is removed from memory.
[in] | pTransactionIndexPool | The TransactionIndexPool. |
|
private |
List of iterators on a IndexPool::ObjectStrIndex with its name for an AllSet (see also: TAllSet and GenericAllSet)
The Client-AllSet address is the Map-Index (since a TableReaderInterface always belongs to a CommunicaterThread, this address is unique with the client)
|
private |
List of iterators on a IndexPool::TableObjIdIndex for an AllSet (see also: TAllSet and GenericAllSet).
The Client-AllSet address is the Map-Index (since a TableReaderInterface always belongs to a CommunicaterThread, this address is unique with the client)
|
private |
If set, then e.g. the AllSet iterators are bent to this index because now everything runs in one transaction and e.g. objects not yet inserted in the transaction or deleted objects are still in the real index. In the transaction index, however, the changes have been made.
|
private |
If records are read recursively, the already read records come in here.