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 <vector>
48#include <stack>
49#include "GloTypes.h"
50#include "GloTableInterface.h"
51#include "GloRealIndexPool.h"
53#include "GloTransactionOwner.h"
54//-----------------------------------------------------------------------------
55namespace glo
56{
57 //---------------------------------------------------------------------------
58 /* Forwards */
59 struct ReaderInfo;
61 //---------------------------------------------------------------------------
62 #ifdef _MSC_VER
63 /* 'Bezeichner': Klasse 'Typ' benötigt eine DLL-Schnittstelle, die von... */
64 #pragma warning( disable : 4251 )
65 #endif
66 //---------------------------------------------------------------------------
88 {
89 private:
90 //-----------------------------------------------------------------------
91 // >>>>>>>>>>>>>>> AllSetObjectStrIndexIteratorItem >>>>>>>>>>>>>>>>>>>>>>>
92 //-----------------------------------------------------------------------
110 {
111 public:
112 //============== Attribute
113 //---------------------------------------------------------------------
124 //---------------------------------------------------------------------
134 std::string m_sIndexName;
135 //---------------------------------------------------------------------
136
137 private:
138 //============= De- und Konstruktoren
139 //---------------------------------------------------------------------
150 //---------------------------------------------------------------------
161 //---------------------------------------------------------------------
162
163 public:
164 //============= De- und Konstruktoren
165 //---------------------------------------------------------------------
186 const std::string & m_sIndexName );
187 //---------------------------------------------------------------------
198 //---------------------------------------------------------------------
199
200 //============== Methoden
201 //---------------------------------------------------------------------
216 std::size_t getObjectStrIndexSize() const;
217 //---------------------------------------------------------------------
233 int setCurrentObject( const ObjID & rObjID );
234 //---------------------------------------------------------------------
251 int setPosition( std::size_t nPosition );
252 //---------------------------------------------------------------------
269 bool inObjectStrIndex( const ObjID & rObjID );
270 //---------------------------------------------------------------------
271
272 private:
273 //============== Operatoren
274 //---------------------------------------------------------------------
285 //---------------------------------------------------------------------
286 };
287 //-----------------------------------------------------------------------
288 // <<<<<<<<<<<<<<< AllSetObjectStrIndexIteratorItem <<<<<<<<<<<<<<<<<<<<<<<
289 //-----------------------------------------------------------------------
290
291 private:
292 //============== Attribute
293 //-----------------------------------------------------------------------
304 std::unordered_map< ObjID, Record *, glo::ObjID::HashFunction > m_RecursionRecordMap;
305 //-----------------------------------------------------------------------
325 std::unordered_map< NUM_PTR, IndexPool::TableObjIdIndexIterator * > * m_pAllSetTableObjIdIndexIteratorMap;
326 //-----------------------------------------------------------------------
346 std::unordered_map< NUM_PTR, AllSetObjectStrIndexIteratorItem * > * m_pAllSetObjectStrIndexIteratorMap;
347 //-----------------------------------------------------------------------
367 std::unordered_map< TransactionOwner, TransactionIndexPool *, glo::TransactionOwner::HashFunction > m_pTransactionIndexPools;
368 //-----------------------------------------------------------------------
369
370 protected:
371 //============== Konstruktoren
372 //-----------------------------------------------------------------------
383 //-----------------------------------------------------------------------
384
385 public:
386 //============== De- und Konstruktoren
387 //-----------------------------------------------------------------------
404 RealIndexPool * pRealIndexPool );
405 //-----------------------------------------------------------------------
417 //-----------------------------------------------------------------------
418
419 private:
420 //============== Konstruktoren
421 //-----------------------------------------------------------------------
432 //-----------------------------------------------------------------------
433
434 public:
435 //============== Methoden
436 //-----------------------------------------------------------------------
451 virtual int openTable( const std::string & sTableName );
452 //-----------------------------------------------------------------------
465 //-----------------------------------------------------------------------
492 int setTransactionIndexPool( const TransactionOwner & rCommunicatorWithTreadID,
493 TransactionIndexPool * pTransactionIndexPool );
494 //-----------------------------------------------------------------------
516 TransactionIndexPool * getTransactionIndexPool( const TransactionOwner & rCommunicatorWithTreadID ) const;
517 //-----------------------------------------------------------------------
535 void getAllTransactionIndexPools( std::vector< TransactionIndexPool * > & rTransactionIndexPoolVector ) const;
536 //-----------------------------------------------------------------------
557 //-----------------------------------------------------------------------
591 int openAllSet( const TransactionOwner & rCommunicatorWithTreadID,
592 NUM_PTR ipClientAllSetAddress,
593 unsigned long ulClassID,
594 bool bWithSubClasses );
595 //-----------------------------------------------------------------------
626 int openAllSet( const TransactionOwner & rCommunicatorWithTreadID,
627 NUM_PTR ipClientAllSetAddress,
628 unsigned long ulClassID,
629 const std::string & rsIndexName );
630 //-----------------------------------------------------------------------
650 int isAllSetOpen( NUM_PTR ipClientAllSetAddress ) const;
651 //-----------------------------------------------------------------------
665 int closeAllSet( NUM_PTR ipClientAllSetAddress );
666 //-----------------------------------------------------------------------
705 NUM_PTR ipClientAllSetAddress,
706 EnSeekMode eMode ) const;
707 //-----------------------------------------------------------------------
737 int getIndexedObjIdListFromAllSet( std::vector< glo::ObjID > & rObjIDContainer,
738 NUM_PTR ipClientAllSetAddress,
739 const std::string & rsIndexSearchValue,
740 EnQueryType eQuerryType ) const;
741 //-----------------------------------------------------------------------
770 int getIndexedObjIdListFromAllSet( std::vector< glo::ObjID > & rObjIDContainer,
771 NUM_PTR ipClientAllSetAddress,
772 const std::string & rsIndexSearchValue,
773 EnComparisionOp eComparisionOp ) const;
774 //-----------------------------------------------------------------------
804 int getIndexedObjIdListFromAllSet( std::vector< glo::ObjID > & rObjIDContainer,
805 NUM_PTR ipClientAllSetAddress,
806 const std::string & rsRangeStartIndex,
807 const std::string & rsRangeEndIndex ) const;
808 //-----------------------------------------------------------------------
827 int setFilterInAllSet( NUM_PTR ipClientAllSetAddress,
828 const std::string & rsIndexFilterValue ) const;
829 //-----------------------------------------------------------------------
855 int setFilterInAllSet( NUM_PTR ipClientAllSetAddress,
856 const std::string & rsIndexFilterValue,
857 EnComparisionOp eComparisionOp ) const;
858 //-----------------------------------------------------------------------
884 int setFilterInAllSet( NUM_PTR ipClientAllSetAddress,
885 const std::string & rsRangeStartIndex,
886 const std::string & rsRangeEndIndex ) const;
887 //-----------------------------------------------------------------------
901 int removeFilterInAllSet( NUM_PTR ipClientAllSetAddress ) const;
902 //-----------------------------------------------------------------------
922 int getSizeFromAllSet( std::size_t & rnSize, NUM_PTR ipClientAllSetAddress ) const;
923 //-----------------------------------------------------------------------
945 int setCurrentObjectInAllSet( const ObjID & rObjID,
946 NUM_PTR ipClientAllSetAddress ) const;
947 //-----------------------------------------------------------------------
967 int setPositionInAllSet( std::size_t nPosition,
968 NUM_PTR ipClientAllSetAddress ) const;
969 //-----------------------------------------------------------------------
995 int objIDInAllSet( const ObjID & rObjID,
996 NUM_PTR ipClientAllSetAddress ) const;
997 //-----------------------------------------------------------------------
1015 int getAllObjIDs( std::list<ObjID> & rRetValList );
1016 //-----------------------------------------------------------------------
1036 int getObjIDs( std::list<ObjID> & rRetValList, unsigned long ulClassID );
1037 //-----------------------------------------------------------------------
1057 int getObjIDs( std::map< ObjID, ObjID, std::less<ObjID> > & rRetValMap,
1058 unsigned long ulClassID );
1059 //-----------------------------------------------------------------------
1087 int getRecord( Record *& prRetVal,
1088 const ObjID & rObjID,
1089 ReaderInfo * pReaderInfo );
1090 //-----------------------------------------------------------------------
1115 int getObjectData( Record *& prRetVal,
1116 const ObjID & rObjID,
1117 ReaderInfo * pReaderInfo );
1118 //-----------------------------------------------------------------------
1119
1120 protected:
1121 //============== Methoden
1122 //-----------------------------------------------------------------------
1156 int getObjectData( Record *& prRetVal,
1157 const ObjID & rObjID,
1158 ReaderInfo * pReaderInfo,
1159 bool bInRecursion );
1160 //-----------------------------------------------------------------------
1205 const TransactionOwner & rCommunicatorWithTreadID,
1206 NUM_PTR ipClientAllSetAddress,
1207 unsigned long ulClassID,
1208 bool bWithSubClasses = true );
1209 //-----------------------------------------------------------------------
1249 const TransactionOwner & rCommunicatorWithTreadID,
1250 NUM_PTR ipClientAllSetAddress,
1251 unsigned long ulClassID,
1252 const std::string & rsIndexName );
1253 //-----------------------------------------------------------------------
1274 int getObjIDs( std::list<ObjID> * pRetValList,
1275 std::map< ObjID, ObjID, std::less<ObjID> > * pRetValMap,
1276 unsigned long ulClassID );
1277 //-----------------------------------------------------------------------
1306 int getRecord( Record *& prRetVal,
1307 const std::string & sTableName,
1308 const ObjID & rObjID,
1309 unsigned long ulClassID,
1310 bool bOnlyClassIDTable = false );
1311 //-----------------------------------------------------------------------
1338 int getRecord( Record *& prRetVal,
1339 const ObjID & rObjID,
1340 ClassInfo & rClassInfo,
1341 bool bOnlyClassIDTable = false );
1342 //-----------------------------------------------------------------------
1382 int generateRecord( Record *& prRetVal,
1383 const std::string & sFieldNameRow,
1384 const std::string & sDataRow,
1385 std::streampos StreamPosRow,
1386 const std::string & rsTable,
1387 bool bOnlyClassIDTable = false );
1388 //-----------------------------------------------------------------------
1424 int generateRecord( Record *& prRetVal,
1425 const std::string & sDataRow,
1426 ClassInfo & rClassInfo,
1427 std::streampos StreamPosRow,
1428 bool bOnlyClassIDTable = false );
1429 //-----------------------------------------------------------------------
1459 const ObjID & rObjID,
1460 unsigned long ulClassID,
1461 bool bOnlyClassIDTable = false );
1462 //-----------------------------------------------------------------------
1487 int getObjectDataFromDataRow( std::shared_ptr<Record> & sprRetVal,
1488 const ObjID & rObjID,
1489 unsigned long ulClassID,
1490 bool bOnlyClassIDTable = false );
1491 //-----------------------------------------------------------------------
1492
1493
1494 private:
1495 //============== Methoden
1496 //-----------------------------------------------------------------------
1512 void deleteAllSetTableObjIdIndexIteratorMap( std::unordered_map< NUM_PTR, IndexPool::TableObjIdIndexIterator * > * pMapToDelete );
1513 //-----------------------------------------------------------------------
1529 void deleteAllSetObjectStrIndexIteratorMap( std::unordered_map< NUM_PTR, AllSetObjectStrIndexIteratorItem * > * pMapToDelete );
1530 //-----------------------------------------------------------------------
1531
1532 //============== Operatoren
1533 //-----------------------------------------------------------------------
1543 TableInterface & operator= ( const TableInterface & );
1544 //-----------------------------------------------------------------------
1545 };
1546 //---------------------------------------------------------------------------
1547 #ifdef _MSC_VER
1548 /* 'Bezeichner': Klasse 'Typ' benötigt eine DLL-Schnittstelle, die von... */
1549 #pragma warning( default : 4251 )
1550 #endif
1551 //---------------------------------------------------------------------------
1552} // namespace glo
1553#endif
long long NUM_PTR
Definition EuDef_NUM_PTR.h:91
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
Base class for the individual attributes of a Record.
Definition GloBaseRecordAttribute.h:116
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
AllSetObjectStrIndexIteratorItem(IndexPool::ObjectStrIndexIterator *pObjectStrIndexIterator, const std::string &m_sIndexName)
std::string m_sIndexName
Definition GloTableReaderInterface.h:134
AllSetObjectStrIndexIteratorItem(const AllSetObjectStrIndexIteratorItem &)
IndexPool::ObjectStrIndexIterator * m_pObjectStrIndexIterator
Definition GloTableReaderInterface.h:123
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:346
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:367
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:325
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:304
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:1590
EnSeekMode
Definition GloTypes.h:192
EnQueryType
Definition GloTypes.h:1183
Objects of this structure transport data to objects of type TableReaderInterface.
Definition GloReaderWriterInfo.h:119