GlobalObjects
Loading...
Searching...
No Matches
GloTableReaderInterface.h
Go to the documentation of this file.
1#ifndef INC_GLOTABLEREADERINTERFACE_H
2#define INC_GLOTABLEREADERINTERFACE_H
3//-----------------------------------------------------------------------------
43//-----------------------------------------------------------------------------
44#include <map>
45#include <unordered_map>
46#include <list>
47#include <stack>
48#include "GloTypes.h"
49#include "GloTableInterface.h"
50#include "GloRealIndexPool.h"
52#include "GloTransactionOwner.h"
53//-----------------------------------------------------------------------------
54namespace glo
55{
56 //---------------------------------------------------------------------------
57 /* Forwards */
58 struct ReaderInfo;
59 class BaseRecordAttribute;
60 //---------------------------------------------------------------------------
61 #ifdef _MSC_VER
62 /* 'Bezeichner': Klasse 'Typ' benötigt eine DLL-Schnittstelle, die von... */
63 #pragma warning( disable : 4251 )
64 #endif
65 //---------------------------------------------------------------------------
87 {
88 private:
89 //-----------------------------------------------------------------------
90 // >>>>>>>>>>>>>>> AllSetObjectStrIndexIteratorItem >>>>>>>>>>>>>>>>>>>>>>>
91 //-----------------------------------------------------------------------
109 {
110 public:
111 //============== Attribute
112 //---------------------------------------------------------------------
123 //---------------------------------------------------------------------
133 std::string m_sIndexName;
134 //---------------------------------------------------------------------
135
136 private:
137 //============= De- und Konstruktoren
138 //---------------------------------------------------------------------
149 //---------------------------------------------------------------------
160 //---------------------------------------------------------------------
161
162 public:
163 //============= De- und Konstruktoren
164 //---------------------------------------------------------------------
185 const std::string & m_sIndexName );
186 //---------------------------------------------------------------------
197 //---------------------------------------------------------------------
198
199 //============== Methoden
200 //---------------------------------------------------------------------
215 std::size_t getObjectStrIndexSize() const;
216 //---------------------------------------------------------------------
232 int setCurrentObject( const ObjID & rObjID );
233 //---------------------------------------------------------------------
250 int setPosition( std::size_t nPosition );
251 //---------------------------------------------------------------------
268 bool inObjectStrIndex( const ObjID & rObjID );
269 //---------------------------------------------------------------------
270
271 private:
272 //============== Operatoren
273 //---------------------------------------------------------------------
284 //---------------------------------------------------------------------
285 };
286 //-----------------------------------------------------------------------
287 // <<<<<<<<<<<<<<< AllSetObjectStrIndexIteratorItem <<<<<<<<<<<<<<<<<<<<<<<
288 //-----------------------------------------------------------------------
289
290 private:
291 //============== Attribute
292 //-----------------------------------------------------------------------
303 std::unordered_map< ObjID, Record *, glo::ObjID::HashFunction > m_RecursionRecordMap;
304 //-----------------------------------------------------------------------
324 std::unordered_map< NUM_PTR, IndexPool::TableObjIdIndexIterator * > * m_pAllSetTableObjIdIndexIteratorMap;
325 //-----------------------------------------------------------------------
345 std::unordered_map< NUM_PTR, AllSetObjectStrIndexIteratorItem * > * m_pAllSetObjectStrIndexIteratorMap;
346 //-----------------------------------------------------------------------
366 std::unordered_map< TransactionOwner, TransactionIndexPool *, glo::TransactionOwner::HashFunction > m_pTransactionIndexPools;
367 //-----------------------------------------------------------------------
368
369 protected:
370 //============== Konstruktoren
371 //-----------------------------------------------------------------------
382 //-----------------------------------------------------------------------
383
384 public:
385 //============== De- und Konstruktoren
386 //-----------------------------------------------------------------------
403 RealIndexPool * pRealIndexPool );
404 //-----------------------------------------------------------------------
416 //-----------------------------------------------------------------------
417
418 private:
419 //============== Konstruktoren
420 //-----------------------------------------------------------------------
431 //-----------------------------------------------------------------------
432
433 public:
434 //============== Methoden
435 //-----------------------------------------------------------------------
450 virtual int openTable( const std::string & sTableName );
451 //-----------------------------------------------------------------------
464 //-----------------------------------------------------------------------
491 int setTransactionIndexPool( const TransactionOwner & rCommunicatorWithTreadID,
492 TransactionIndexPool * pTransactionIndexPool );
493 //-----------------------------------------------------------------------
515 TransactionIndexPool * getTransactionIndexPool( const TransactionOwner & rCommunicatorWithTreadID ) const;
516 //-----------------------------------------------------------------------
536 void getAllTransactionIndexPools( std::vector< TransactionIndexPool * > & rTransactionIndexPoolVector ) const;
537 //-----------------------------------------------------------------------
558 //-----------------------------------------------------------------------
592 int openAllSet( const TransactionOwner & rCommunicatorWithTreadID,
593 NUM_PTR ipClientAllSetAddress,
594 unsigned long ulClassID,
595 bool bWithSubClasses );
596 //-----------------------------------------------------------------------
627 int openAllSet( const TransactionOwner & rCommunicatorWithTreadID,
628 NUM_PTR ipClientAllSetAddress,
629 unsigned long ulClassID,
630 const std::string & rsIndexName );
631 //-----------------------------------------------------------------------
651 int isAllSetOpen( NUM_PTR ipClientAllSetAddress ) const;
652 //-----------------------------------------------------------------------
666 int closeAllSet( NUM_PTR ipClientAllSetAddress );
667 //-----------------------------------------------------------------------
706 NUM_PTR ipClientAllSetAddress,
707 EnSeekMode eMode ) const;
708 //-----------------------------------------------------------------------
738 int getIndexedObjIdListFromAllSet( std::vector< glo::ObjID > & rObjIDContainer,
739 NUM_PTR ipClientAllSetAddress,
740 const std::string & rsIndexSearchValue,
741 EnQueryType eQuerryType ) const;
742 //-----------------------------------------------------------------------
771 int getIndexedObjIdListFromAllSet( std::vector< glo::ObjID > & rObjIDContainer,
772 NUM_PTR ipClientAllSetAddress,
773 const std::string & rsIndexSearchValue,
774 EnComparisionOp eComparisionOp ) const;
775 //-----------------------------------------------------------------------
805 int getIndexedObjIdListFromAllSet( std::vector< glo::ObjID > & rObjIDContainer,
806 NUM_PTR ipClientAllSetAddress,
807 const std::string & rsRangeStartIndex,
808 const std::string & rsRangeEndIndex ) const;
809 //-----------------------------------------------------------------------
828 int setFilterInAllSet( NUM_PTR ipClientAllSetAddress,
829 const std::string & rsIndexFilterValue ) const;
830 //-----------------------------------------------------------------------
856 int setFilterInAllSet( NUM_PTR ipClientAllSetAddress,
857 const std::string & rsIndexFilterValue,
858 EnComparisionOp eComparisionOp ) const;
859 //-----------------------------------------------------------------------
885 int setFilterInAllSet( NUM_PTR ipClientAllSetAddress,
886 const std::string & rsRangeStartIndex,
887 const std::string & rsRangeEndIndex ) const;
888 //-----------------------------------------------------------------------
902 int removeFilterInAllSet( NUM_PTR ipClientAllSetAddress ) const;
903 //-----------------------------------------------------------------------
923 int getSizeFromAllSet( std::size_t & rnSize, NUM_PTR ipClientAllSetAddress ) const;
924 //-----------------------------------------------------------------------
946 int setCurrentObjectInAllSet( const ObjID & rObjID,
947 NUM_PTR ipClientAllSetAddress ) const;
948 //-----------------------------------------------------------------------
968 int setPositionInAllSet( std::size_t nPosition,
969 NUM_PTR ipClientAllSetAddress ) const;
970 //-----------------------------------------------------------------------
996 int objIDInAllSet( const ObjID & rObjID,
997 NUM_PTR ipClientAllSetAddress ) const;
998 //-----------------------------------------------------------------------
1016 int getAllObjIDs( std::list<ObjID> & rRetValList );
1017 //-----------------------------------------------------------------------
1037 int getObjIDs( std::list<ObjID> & rRetValList, unsigned long ulClassID );
1038 //-----------------------------------------------------------------------
1058 int getObjIDs( std::map< ObjID, ObjID, std::less<ObjID> > & rRetValMap,
1059 unsigned long ulClassID );
1060 //-----------------------------------------------------------------------
1088 int getRecord( Record *& prRetVal,
1089 const ObjID & rObjID,
1090 ReaderInfo * pReaderInfo );
1091 //-----------------------------------------------------------------------
1116 int getObjectData( Record *& prRetVal,
1117 const ObjID & rObjID,
1118 ReaderInfo * pReaderInfo );
1119 //-----------------------------------------------------------------------
1120
1121 protected:
1122 //============== Methoden
1123 //-----------------------------------------------------------------------
1157 int getObjectData( Record *& prRetVal,
1158 const ObjID & rObjID,
1159 ReaderInfo * pReaderInfo,
1160 bool bInRecursion );
1161 //-----------------------------------------------------------------------
1206 const TransactionOwner & rCommunicatorWithTreadID,
1207 NUM_PTR ipClientAllSetAddress,
1208 unsigned long ulClassID,
1209 bool bWithSubClasses = true );
1210 //-----------------------------------------------------------------------
1250 const TransactionOwner & rCommunicatorWithTreadID,
1251 NUM_PTR ipClientAllSetAddress,
1252 unsigned long ulClassID,
1253 const std::string & rsIndexName );
1254 //-----------------------------------------------------------------------
1275 int getObjIDs( std::list<ObjID> * pRetValList,
1276 std::map< ObjID, ObjID, std::less<ObjID> > * pRetValMap,
1277 unsigned long ulClassID );
1278 //-----------------------------------------------------------------------
1307 int getRecord( Record *& prRetVal,
1308 const std::string & sTableName,
1309 const ObjID & rObjID,
1310 unsigned long ulClassID,
1311 bool bOnlyClassIDTable = false );
1312 //-----------------------------------------------------------------------
1339 int getRecord( Record *& prRetVal,
1340 const ObjID & rObjID,
1341 ClassInfo & rClassInfo,
1342 bool bOnlyClassIDTable = false );
1343 //-----------------------------------------------------------------------
1383 int generateRecord( Record *& prRetVal,
1384 const std::string & sFieldNameRow,
1385 const std::string & sDataRow,
1386 std::streampos StreamPosRow,
1387 const std::string & rsTable,
1388 bool bOnlyClassIDTable = false );
1389 //-----------------------------------------------------------------------
1425 int generateRecord( Record *& prRetVal,
1426 const std::string & sDataRow,
1427 ClassInfo & rClassInfo,
1428 std::streampos StreamPosRow,
1429 bool bOnlyClassIDTable = false );
1430 //-----------------------------------------------------------------------
1460 const ObjID & rObjID,
1461 unsigned long ulClassID,
1462 bool bOnlyClassIDTable = false );
1463 //-----------------------------------------------------------------------
1488 int getObjectDataFromDataRow( std::shared_ptr<Record> & sprRetVal,
1489 const ObjID & rObjID,
1490 unsigned long ulClassID,
1491 bool bOnlyClassIDTable = false );
1492 //-----------------------------------------------------------------------
1493
1494
1495 private:
1496 //============== Methoden
1497 //-----------------------------------------------------------------------
1513 void deleteAllSetTableObjIdIndexIteratorMap( std::unordered_map< NUM_PTR, IndexPool::TableObjIdIndexIterator * > * pMapToDelete );
1514 //-----------------------------------------------------------------------
1530 void deleteAllSetObjectStrIndexIteratorMap( std::unordered_map< NUM_PTR, AllSetObjectStrIndexIteratorItem * > * pMapToDelete );
1531 //-----------------------------------------------------------------------
1532
1533 //============== Operatoren
1534 //-----------------------------------------------------------------------
1544 TableInterface & operator= ( const TableInterface & );
1545 //-----------------------------------------------------------------------
1546 };
1547 //---------------------------------------------------------------------------
1548 #ifdef _MSC_VER
1549 /* 'Bezeichner': Klasse 'Typ' benötigt eine DLL-Schnittstelle, die von... */
1550 #pragma warning( default : 4251 )
1551 #endif
1552 //---------------------------------------------------------------------------
1553} // namespace glo
1554#endif
Header for RealIndexPool
Header for TableInterface and TableInterface::TableInterfaceTable
Header for TransactionIndexPool
Header for TransactionOwner
For each library, here 'GlobalObjects' there is a type file.
#define __glo_export_dll
Definition GloTypes.h:70
This class contains all information to store objects of a class in a database, to build objects from ...
Definition GloClassInfo.h:86
Has a pointer to an ObjectStrIndex and allows iteration through this index. Is instantiated e....
Definition GloIndexPool.h:2637
Has a pointer to a TableObjIdIndex and allows to iterate through this index. Is instantiated e....
Definition GloIndexPool.h:1430
An object ID consists of the class ID, a database ID and the actual unique object number (all unsigne...
Definition GloObjID.h:84
The real index as opposed to the TransactionIndexPool, which is created for each transaction
Definition GloRealIndexPool.h:69
Objects of this class transport the data from the tables into the persistent object and from these ag...
Definition GloRecord.h:108
This class is the interface to a GlobalObjects schema. It contains all class information to store obj...
Definition GloSchemaInterface.h:91
An object of this class or subclass accesses tables and reads or writes data records (Record) and bin...
Definition GloTableInterface.h:94
Objects of this type are managed in the m_pAllSetObjectStrIndexIteratorMap to ensure that an AllSet w...
Definition GloTableReaderInterface.h:109
AllSetObjectStrIndexIteratorItem(IndexPool::ObjectStrIndexIterator *pObjectStrIndexIterator, const std::string &m_sIndexName)
std::string m_sIndexName
Definition GloTableReaderInterface.h:133
AllSetObjectStrIndexIteratorItem(const AllSetObjectStrIndexIteratorItem &)
IndexPool::ObjectStrIndexIterator * m_pObjectStrIndexIterator
Definition GloTableReaderInterface.h:122
An object of this class accesses tables and reads data records (Record) and binary files (eut::Blob).
Definition GloTableReaderInterface.h:87
int setFilterInAllSet(NUM_PTR ipClientAllSetAddress, const std::string &rsRangeStartIndex, const std::string &rsRangeEndIndex) const
std::unordered_map< NUM_PTR, AllSetObjectStrIndexIteratorItem * > * m_pAllSetObjectStrIndexIteratorMap
Definition GloTableReaderInterface.h:345
int getObjIDs(std::map< ObjID, ObjID, std::less< ObjID > > &rRetValMap, unsigned long ulClassID)
int getObjectData(Record *&prRetVal, const ObjID &rObjID, ReaderInfo *pReaderInfo, bool bInRecursion)
int setTransactionIndexPool(const TransactionOwner &rCommunicatorWithTreadID, TransactionIndexPool *pTransactionIndexPool)
TableReaderInterface(const SchemaInterface &rScheme, RealIndexPool *pRealIndexPool)
int getSizeFromAllSet(std::size_t &rnSize, NUM_PTR ipClientAllSetAddress) const
int generateRecord(Record *&prRetVal, const std::string &sFieldNameRow, const std::string &sDataRow, std::streampos StreamPosRow, const std::string &rsTable, bool bOnlyClassIDTable=false)
int getIndexedObjIdListFromAllSet(std::vector< glo::ObjID > &rObjIDContainer, NUM_PTR ipClientAllSetAddress, const std::string &rsIndexSearchValue, EnComparisionOp eComparisionOp) const
int setFilterInAllSet(NUM_PTR ipClientAllSetAddress, const std::string &rsIndexFilterValue) const
int removeFilterInAllSet(NUM_PTR ipClientAllSetAddress) const
int getObjIdFromAllSet(ObjID &rObjID, NUM_PTR ipClientAllSetAddress, EnSeekMode eMode) const
int getRecord(Record *&prRetVal, const ObjID &rObjID, ClassInfo &rClassInfo, bool bOnlyClassIDTable=false)
int setFilterInAllSet(NUM_PTR ipClientAllSetAddress, const std::string &rsIndexFilterValue, EnComparisionOp eComparisionOp) const
std::unordered_map< TransactionOwner, TransactionIndexPool *, glo::TransactionOwner::HashFunction > m_pTransactionIndexPools
Definition GloTableReaderInterface.h:366
int isAllSetOpen(NUM_PTR ipClientAllSetAddress) const
int setCurrentObjectInAllSet(const ObjID &rObjID, NUM_PTR ipClientAllSetAddress) const
std::unordered_map< NUM_PTR, IndexPool::TableObjIdIndexIterator * > * m_pAllSetTableObjIdIndexIteratorMap
Definition GloTableReaderInterface.h:324
void deleteAllSetTableObjIdIndexIteratorMap(std::unordered_map< NUM_PTR, IndexPool::TableObjIdIndexIterator * > *pMapToDelete)
int closeAllSet(NUM_PTR ipClientAllSetAddress)
int getObjectDataFromDataRow(Record *&prRetVal, 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)
RealIndexPool * getRealIndexPool() const
void getAllTransactionIndexPools(std::vector< TransactionIndexPool * > &rTransactionIndexPoolVector) const
int objIDInAllSet(const ObjID &rObjID, NUM_PTR ipClientAllSetAddress) const
int openAllSet(const TransactionOwner &rCommunicatorWithTreadID, NUM_PTR ipClientAllSetAddress, unsigned long ulClassID, bool bWithSubClasses)
int getAllObjIDs(std::list< ObjID > &rRetValList)
int setPositionInAllSet(std::size_t nPosition, NUM_PTR ipClientAllSetAddress) const
int getObjectDataFromDataRow(std::shared_ptr< Record > &sprRetVal, const ObjID &rObjID, unsigned long ulClassID, bool bOnlyClassIDTable=false)
int getIndexedObjIdListFromAllSet(std::vector< glo::ObjID > &rObjIDContainer, NUM_PTR ipClientAllSetAddress, const std::string &rsIndexSearchValue, EnQueryType eQuerryType) const
std::unordered_map< ObjID, Record *, glo::ObjID::HashFunction > m_RecursionRecordMap
Definition GloTableReaderInterface.h:303
virtual int openTable(const std::string &sTableName)
int getRecord(Record *&prRetVal, const std::string &sTableName, const ObjID &rObjID, unsigned long ulClassID, bool bOnlyClassIDTable=false)
IndexPool::ObjectStrIndexIterator * openAllSet(int &riErr, const TransactionOwner &rCommunicatorWithTreadID, NUM_PTR ipClientAllSetAddress, unsigned long ulClassID, const std::string &rsIndexName)
int getObjectData(Record *&prRetVal, const ObjID &rObjID, ReaderInfo *pReaderInfo)
IndexPool::TableObjIdIndexIterator * openAllSet(int &riErr, const TransactionOwner &rCommunicatorWithTreadID, NUM_PTR ipClientAllSetAddress, unsigned long ulClassID, bool bWithSubClasses=true)
int openAllSet(const TransactionOwner &rCommunicatorWithTreadID, NUM_PTR ipClientAllSetAddress, unsigned long ulClassID, const std::string &rsIndexName)
TableReaderInterface(const TableReaderInterface &)
int getIndexedObjIdListFromAllSet(std::vector< glo::ObjID > &rObjIDContainer, NUM_PTR ipClientAllSetAddress, const std::string &rsRangeStartIndex, const std::string &rsRangeEndIndex) const
TransactionIndexPool * getTransactionIndexPool(const TransactionOwner &rCommunicatorWithTreadID) const
int getObjIDs(std::list< ObjID > &rRetValList, unsigned long ulClassID)
int getRecord(Record *&prRetVal, const ObjID &rObjID, ReaderInfo *pReaderInfo)
int generateRecord(Record *&prRetVal, const std::string &sDataRow, ClassInfo &rClassInfo, std::streampos StreamPosRow, bool bOnlyClassIDTable=false)
void deleteAllSetObjectStrIndexIteratorMap(std::unordered_map< NUM_PTR, AllSetObjectStrIndexIteratorItem * > *pMapToDelete)
This index is generated in each transaction and changes such as saving, deleting or inserting an obje...
Definition GloTransactionIndexPool.h:66
In order to make transactions available not only to a glo::Communicator, but also to individual threa...
Definition GloTransactionOwner.h:81
Definition GloAbstractBaseLot.h:49
EnComparisionOp
Definition GloTypes.h:1567
EnSeekMode
Definition GloTypes.h:173
EnQueryType
Definition GloTypes.h:1164
Objects of this structure transport data to objects of type TableReaderInterface.
Definition GloReaderWriterInfo.h:119