GlobalObjects
Loading...
Searching...
No Matches
GloManager.h
Go to the documentation of this file.
1#ifndef INC_GLODBMANAGER_H
2#define INC_GLODBMANAGER_H
3//-----------------------------------------------------------------------------
50//-----------------------------------------------------------------------------
51#include "GloTypes.h"
52#include "GloOrderMsg.h"
53#include <string>
54#if defined (__PTHREADS)
55 #include <EuPCriticalSection.h>
56#else
57 #include "EuCriticalSection.h"
58#endif
59#include "PtlTDVList.h"
61#include "GloTransactionOwner.h"
64#include "GloTransactionOwner.h"
65#if defined (__PTHREADS)
66 #include <EuEndlessPThread.h>
67 #include <semaphore.h>
68#else
69 #include "EuRepeatingThread.h"
70#endif
71#include <vector>
72#include <map>
73#include <queue>
74#include <fstream>
75#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__)
76 #include <winsock.h>
77#elif defined(__GNUC__)
78 #include <string.h>
79
80 #include <errno.h>
81 #include <sys/types.h>
82 #include <sys/socket.h>
83 #include <netinet/in.h>
84 #include <netdb.h>
85 #include <arpa/inet.h>
86 #define SOCKET uintptr_t
87 #define SOCKADDR_IN sockaddr_in
88 #define SOCKADDR sockaddr
89 #define HOSTENT hostent
90 #define INVALID_SOCKET (SOCKET)(~0)
91 #define SOCKET_ERROR (-1)
92#endif
93//-----------------------------------------------------------------------------
94namespace glo
95{
96 //---------------------------------------------------------------------------
97 /* Forwards */
98 class CommunicaterThread;
99 class Communicator;
100 class LockManager;
101 class ManagerActionVisualiser;
102 class ObjID;
103 class RealIndexPool;
104 class Record;
105 class SchemaInterface;
106 class Server;
107 class TableReaderInterface;
108 class TransactionIndexPool;
109 class TableWriterInterface;
110 class WatchNotifyManager;
111 struct ClientInfo;
112 class IndexPool;
113 //---------------------------------------------------------------------------
114 #ifdef _MSC_VER
115 /* 'Bezeichner': Klasse 'Typ' benötigt eine DLL-Schnittstelle, die von... */
116 #pragma warning( disable : 4251 )
117 #endif
118 //---------------------------------------------------------------------------
188 #if defined (__PTHREADS)
189 class __glo_export_dll Manager : public EuEndlessPThread
190 #else
192 #endif
193 {
194 private:
195 //============== Friends
196 //-----------------------------------------------------------------------
197 friend class WatchNotifyManager;
198 friend class LockManager;
199 friend class OrderMsg;
200 friend class TcpServerReceiver;
202 //-----------------------------------------------------------------------
203
204 protected:
205 //-----------------------------------------------------------------------
206 // >>>>>>>>>>>>>>>>>>>>>>>> Receiver >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
207 //-----------------------------------------------------------------------
225 {
226 private:
227 //============== Attribute
228 //---------------------------------------------------------------------
246 unsigned int m_uiRefCounter;
247 //---------------------------------------------------------------------
259 std::string m_sSchemaName;
260 //---------------------------------------------------------------------
271 //---------------------------------------------------------------------
282 //---------------------------------------------------------------------
283
284 //============= Konstruktor
285 //---------------------------------------------------------------------
296 //---------------------------------------------------------------------
306 Receiver( const Receiver & );
307 //---------------------------------------------------------------------
308
309 public:
310 //============== De- und Konstruktoren
311 //---------------------------------------------------------------------
335 Receiver( const std::string & sSchemaName,
336 CommunicaterThread * pCommunicatorThread,
337 Communicator * pCommunicator );
338 //---------------------------------------------------------------------
349 //---------------------------------------------------------------------
350
351 public:
352 //============== Methoden
353 //---------------------------------------------------------------------
367 std::string getSchemaName() const;
368 //---------------------------------------------------------------------
381 //---------------------------------------------------------------------
398 //---------------------------------------------------------------------
410 unsigned int incrementRefCounter();
411 //---------------------------------------------------------------------
423 unsigned int decrementRefCounter();
424 //---------------------------------------------------------------------
425
426 private:
427 //============== Operatoren
428 //---------------------------------------------------------------------
438 Manager::Receiver & operator= ( const Receiver & );
439 //---------------------------------------------------------------------
440 };
441 //-----------------------------------------------------------------------
442 // <<<<<<<<<<<<<<<<<<<<<<<< Receiver <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
443 //-----------------------------------------------------------------------
444
445 protected:
446 //-----------------------------------------------------------------------
447 // >>>>>>>>>>>>>>>>>>>>> ObjIdWithDepends >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
448 //-----------------------------------------------------------------------
449 // doxygen -> warning: unable to resolve reference to 'GLO_REF_DEPENDENT' for \ref command
450 // Is a reference to the GlobalObjects documentation.
451 //-----------------------------------------------------------------------
469 {
470 public:
471 //============== Attribute
472 //---------------------------------------------------------------------
483 //---------------------------------------------------------------------
484 // doxygen -> warning: unable to resolve reference to 'GLO_REF_DEPENDENT' for \ref command
485 // Is a reference to the GlobalObjects documentation.
486 //---------------------------------------------------------------------
498 std::map< ObjID, Record *, std::less<ObjID> > * m_pDependRecordMap;
499 //---------------------------------------------------------------------
500
501 //============== Konstruktoren
502 //---------------------------------------------------------------------
503 // doxygen -> warning: unable to resolve reference to 'GLO_REF_DEPENDENT' for \ref command
504 // Is a reference to the GlobalObjects documentation.
505 //---------------------------------------------------------------------
530 ObjIdWithDepends( const ObjID & rObjID,
531 std::map< ObjID, Record *, std::less<ObjID> > * pDependRecordMap );
532 //---------------------------------------------------------------------
545 //---------------------------------------------------------------------
546 };
547 //-----------------------------------------------------------------------
548 // <<<<<<<<<<<<<<<<<<<<< ObjIdWithDepends <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
549 //-----------------------------------------------------------------------
550
551 //-----------------------------------------------------------------------
552 // >>>>>>>>>>>>>>>>>>>>>> SchemaMapItem >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
553 //-----------------------------------------------------------------------
569 {
570 private:
571 //+ ============ Attribute
572 //---------------------------------------------------------------------
586 unsigned int m_uiCounter;
587 //---------------------------------------------------------------------
598 //---------------------------------------------------------------------
609 //---------------------------------------------------------------------
610 #if defined(_MSC_VER)
611 //---------------------------------------------------------------------
624 std::ofstream * m_pLockFile;
625 //---------------------------------------------------------------------
626 #elif defined(__MINGW32__) || defined(__MINGW64__)
627 //---------------------------------------------------------------------
640 void * m_hLockFileHandle;
641 //---------------------------------------------------------------------
642 #elif defined(__GNUC__)
643 //---------------------------------------------------------------------
656 int m_iLockFileHandle;
657 //---------------------------------------------------------------------
658 #endif
659 //---------------------------------------------------------------------
660
661 protected:
662 //============= Konstruktor
663 //---------------------------------------------------------------------
674 //---------------------------------------------------------------------
675
676 public:
677 //============== De- und Konstruktoren
678 //---------------------------------------------------------------------
679 #if defined(_MSC_VER)
680 //---------------------------------------------------------------------
712 RealIndexPool * pRealIndexPool,
713 std::ofstream * pLockFile );
714 //---------------------------------------------------------------------
715 #elif defined(__MINGW32__) || defined(__MINGW64__)
716 //---------------------------------------------------------------------
749 RealIndexPool * pRealIndexPool,
750 void * hLockFileHandle );
751 //---------------------------------------------------------------------
752 #elif defined(__GNUC__)
753 //---------------------------------------------------------------------
786 RealIndexPool * pRealIndexPool,
787 int iLockFileHandle );
788 //---------------------------------------------------------------------
789 #endif
790 //---------------------------------------------------------------------
791 #if defined(_MSC_VER)
802 #elif defined(__MINGW32__) || defined(__MINGW64__)
813 #elif defined(__GNUC__)
824 #endif
826 //---------------------------------------------------------------------
827
828 private:
829 //============== Konstruktoren
830 //---------------------------------------------------------------------
841 //---------------------------------------------------------------------
842
843 public:
844 //============== Methoden
845 //---------------------------------------------------------------------
856 //---------------------------------------------------------------------
867 //---------------------------------------------------------------------
879 unsigned int Counter() const;
880 //---------------------------------------------------------------------
897 //---------------------------------------------------------------------
914 //---------------------------------------------------------------------
915
916 private:
917 //============== Operatoren
918 //---------------------------------------------------------------------
928 Manager::SchemaMapItem & operator= ( const SchemaMapItem & );
929 //---------------------------------------------------------------------
930 };
931 //-----------------------------------------------------------------------
932 // <<<<<<<<<<<<<<<<<<<<<<< SchemaMapItem <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
933 //-----------------------------------------------------------------------
934
935 private:
936 //============== Static-Attribute
937 //-----------------------------------------------------------------------
948 //-----------------------------------------------------------------------
959 //-----------------------------------------------------------------------
970 //-----------------------------------------------------------------------
981
982 //============== Attribute
983 //-----------------------------------------------------------------------
993 unsigned int m_uiCommunicatorID;
994 //-----------------------------------------------------------------------
1004 std::string m_strSchemaPath;
1005 //-----------------------------------------------------------------------
1015 std::vector<std::string> m_KnownSchemes;
1016 //-----------------------------------------------------------------------
1028 std::map< std::string, SchemaMapItem *, std::less< std::string > > m_SchemaMap;
1029 //-----------------------------------------------------------------------
1039 std::queue< OrderMsg * > m_MsgQueue;
1040 //-----------------------------------------------------------------------
1050 std::map< SOCKET, ClientInfo , std::less< SOCKET > > m_ConnectedClientsMap;
1051 //-----------------------------------------------------------------------
1063 std::map< Communicator *, Receiver * , std::less< Communicator * > > m_ReceiverMap;
1064 //-----------------------------------------------------------------------
1075 //-----------------------------------------------------------------------
1086 //-----------------------------------------------------------------------
1097 //-----------------------------------------------------------------------
1108 //-----------------------------------------------------------------------
1121 //-----------------------------------------------------------------------
1134 #if defined (__PTHREADS)
1135 EuPCriticalSection m_LocalCriticalSection;
1136 #else
1138 #endif
1139 //-----------------------------------------------------------------------
1140
1141 protected:
1142 //============= Konstruktoren
1143 //-----------------------------------------------------------------------
1154 #if defined(__GNUC__)
1155 __attribute__((noreturn))
1156 #endif
1157 ;
1158 //-----------------------------------------------------------------------
1177 Manager( const std::string & rsSchemaPath,
1178 const std::vector< std::string > & rAllowedSchemes );
1179 //-----------------------------------------------------------------------
1189 virtual ~Manager();
1190 //-----------------------------------------------------------------------
1191
1192 private:
1193 //============== Konstruktoren
1194 //-----------------------------------------------------------------------
1204 Manager( const Manager & );
1205 //-----------------------------------------------------------------------
1206
1207 public:
1208 //============== statische Methoden
1209 //-----------------------------------------------------------------------
1235 static Manager * create( const std::string & rsSchemaPath,
1236 const std::vector< std::string > & rAllowedSchemes );
1237 //-----------------------------------------------------------------------
1252 static int destroy();
1253 //-----------------------------------------------------------------------
1272 //-----------------------------------------------------------------------
1292 static void setActionVisualiser( ManagerActionVisualiser * pActionVisualiser );
1293 //-----------------------------------------------------------------------
1305 static void setShowLevel( ShowLevel ulLevel );
1306 //-----------------------------------------------------------------------
1319 //-----------------------------------------------------------------------
1333 static void showActionString( const std::string & sActionString );
1334 //-----------------------------------------------------------------------
1356 static void showAction( const OrderMsg * pOrderMsg,
1357 const std::string & rsActiontype,
1358 const std::string & rsActionString,
1359 char cSE);
1360 //-----------------------------------------------------------------------
1378 static void showOrderAction( OrderMsg * pOrderMsg, char cSE );
1379 //-----------------------------------------------------------------------
1401 static void showTransactionAction( OrderMsg * pOrderMsg,
1402 const std::string & rsActionString,
1403 char cSE);
1404 //-----------------------------------------------------------------------
1424 static void showWriterAction( OrderMsg * pOrderMsg,
1425 const std::string & rsActionString,
1426 char cSE);
1427 //-----------------------------------------------------------------------
1447 static void showReaderAction( OrderMsg * pOrderMsg,
1448 const std::string & rsActionString,
1449 char cSE);
1450 //-----------------------------------------------------------------------
1451
1452 //============== Methoden
1453 //-----------------------------------------------------------------------
1470 //-----------------------------------------------------------------------
1482 std::string getSchemaPath() const;
1483 //-----------------------------------------------------------------------
1500 void getKnownBases( std::vector< std::string > & rKnownBasesVector ) const;
1501 //-----------------------------------------------------------------------
1516 bool isBaseOpen( Communicator * pCommunicator );
1517 //-----------------------------------------------------------------------
1529 int takeOrder( OrderMsg * pOrderMsg );
1530 //-----------------------------------------------------------------------
1551 void getAllClients( std::vector< ClientInfo > & rClientInfoVector,
1552 std::string * psSchemaName = 0 ) const;
1553 //-----------------------------------------------------------------------
1554
1555 #ifdef _GLO_TEST
1556 public:
1557 #else
1558 protected:
1559 #endif
1560 //============== Methoden
1561 //-----------------------------------------------------------------------
1581 Manager::SchemaMapItem * getSchemaMapItem( const std::string & rsSchemaName ) const;
1582 //-----------------------------------------------------------------------
1602 SchemaInterface * getSchemaInterface( const std::string & rsSchemaName ) const;
1603 //-----------------------------------------------------------------------
1626 int createSchemaInterface( SchemaInterface *& prNewSchemaInterface,
1627 const std::string & rsSchemaName ) const;
1628 //-----------------------------------------------------------------------
1641 void insertInKnownBases( const std::vector< std::string > & rNewSchemes );
1642 //-----------------------------------------------------------------------
1643
1644 //============== Auftrags-Methoden
1645 //-----------------------------------------------------------------------
1662 void getAllKnownBases( OrderMsg * pOrderMsg ) const;
1663 //-----------------------------------------------------------------------
1684 void getClassInfo( OrderMsg * pOrderMsg ) const;
1685 //-----------------------------------------------------------------------
1709 void getBaseOrSubClassInfos( OrderMsg * pOrderMsg ) const;
1710 //-----------------------------------------------------------------------
1729 void getAllDataTypes( OrderMsg * pOrderMsg ) const;
1730 //-----------------------------------------------------------------------
1749 void getDataTypeLimits( OrderMsg * pOrderMsg ) const;
1750 //-----------------------------------------------------------------------
1767 void getAllClients( OrderMsg * pOrderMsg ) const;
1768 //-----------------------------------------------------------------------
1791 void openBase( OrderMsg * pOrderMsg );
1792 //-----------------------------------------------------------------------
1812 void closeBase( OrderMsg * pOrderMsg );
1813 //-----------------------------------------------------------------------
1836 void reindexBase( OrderMsg * pOrderMsg );
1837 //-----------------------------------------------------------------------
1862 void compressBase( OrderMsg * pOrderMsg );
1863 //-----------------------------------------------------------------------
1887 void repairBase( OrderMsg * pOrderMsg );
1888 //-----------------------------------------------------------------------
1913 void removeCommunicator( OrderMsg * pOrderMsg,
1914 WatchNotifyManager * pWatchNotifyManager = 0 );
1915 //-----------------------------------------------------------------------
1933 //-----------------------------------------------------------------------
1951 //-----------------------------------------------------------------------
1987 void sendToReaderThread( OrderMsg * pOrderMsg );
1988 //-----------------------------------------------------------------------
2014 void sendToWriter( OrderMsg * pOrderMsg );
2015 //-----------------------------------------------------------------------
2035 int sendBEGINtoTransactionManager( const TransactionOwner & rCommunicatorWithTreadID );
2036 //-----------------------------------------------------------------------
2058 int sendABORTtoTransactionManager( const TransactionOwner & rCommunicatorWithTreadID,
2059 std::string sSchemaName );
2060 //-----------------------------------------------------------------------
2087 int sendCOMMITtoTransactionManager( const TransactionOwner & rCommunicatorWithTreadID,
2088 std::string sSchemaName,
2089 std::map< ObjID, Record *, std::less<ObjID> > * pInputDataRecordMap );
2090 //-----------------------------------------------------------------------
2110 //-----------------------------------------------------------------------
2111 #ifdef _GLO_TEST
2112 //---------------------------------------------------------------------
2124 LockManager * getLockManager();
2125 //---------------------------------------------------------------------
2126 #endif
2127 //-----------------------------------------------------------------------
2146 void sendToLockManager( OrderMsg * pOrderMsg );
2147 //-----------------------------------------------------------------------
2184 SchemaInterface * pSchema,
2185 std::list<ObjID> * pObjectIDsToBeLocked,
2186 LockSpecification * pLockSpec,
2187 const TransactionOwner & rCommunicatorWithTreadID );
2188 //-----------------------------------------------------------------------
2212 //-----------------------------------------------------------------------
2230 //-----------------------------------------------------------------------
2251 const ObjID & rObjID,
2252 Communicator * pCommunicator,
2253 const std::string & rsSchemaName );
2254 //-----------------------------------------------------------------------
2275 const std::list<ObjID> & rObjIDList,
2276 Communicator * pCommunicator,
2277 const std::string & rsSchemaName );
2278 //-----------------------------------------------------------------------
2279
2280 //============== Unterstützer-Methoden
2281 //-----------------------------------------------------------------------
2282 #if defined(_MSC_VER)
2283 //-----------------------------------------------------------------------
2309 int lockBaseExclusive( std::ofstream *& prLockFile,
2310 const SchemaInterface & rSchemaInterface );
2311 //-----------------------------------------------------------------------
2312 #elif defined(__MINGW32__) || defined(__MINGW64__)
2313 //-----------------------------------------------------------------------
2339 int lockBaseExclusive( void *& prLockFileHandle,
2340 const SchemaInterface & rSchemaInterface );
2341 //-----------------------------------------------------------------------
2342 #elif defined(__GNUC__)
2343 //-----------------------------------------------------------------------
2369 int lockBaseExclusive( int & riLockFileHandle,
2370 const SchemaInterface & rSchemaInterface );
2371 //-----------------------------------------------------------------------
2372 #endif
2373 //-----------------------------------------------------------------------
2394 //-----------------------------------------------------------------------
2406 std::size_t getNumberReceiver() const;
2407 //-----------------------------------------------------------------------
2423 std::size_t getNumberReceiver( std::string sSchemaName ) const;
2424 //-----------------------------------------------------------------------
2435 //-----------------------------------------------------------------------
2453 void switchOffRecieverReader( std::string sSchemaName );
2454 //-----------------------------------------------------------------------
2465 //-----------------------------------------------------------------------
2481 void switchOnRecieverReader( std::string sSchemaName );
2482 //-----------------------------------------------------------------------
2512 void getAllTransactionIndexPools( std::vector< TransactionIndexPool * > & rTransactionIndexPoolVector,
2513 std::string * psSchemaName = 0,
2514 Communicator * pWithoutThisCommunicator = 0 ) const;
2515 //-----------------------------------------------------------------------
2537 const TransactionOwner & rCommunicatorWithTreadID,
2538 TransactionManager::EnStoreDelete eStoreOrDelete,
2539 Record * pRecord );
2540 //-----------------------------------------------------------------------
2584 int checkAllRecordIndices( int iCheckStatus,
2585 const SchemaInterface & rSchema,
2586 const std::map< ObjID, Record *, std::less<ObjID> > & rRecordMap,
2587 IndexPool & rGloIndexPool ) const;
2588 //-----------------------------------------------------------------------
2612 void releaseStrIndexesFromTransactionStepList( std::list< TransactionManager::TransactionBase * > & rTransactionStepList,
2613 std::string & rsSchemaName );
2614 //-----------------------------------------------------------------------
2651 void unlockTransactionStepList( std::list< TransactionManager::TransactionBase * > & rTransactionStepList,
2652 const TransactionOwner & rCommunicatorWithTreadID,
2653 const std::string & rsSchemaName,
2654 TransactionIndexPool * pTransactionIndexPool,
2655 bool bDelete );
2656 //-----------------------------------------------------------------------
2657 // doxygen -> warning: unable to resolve reference to 'GLO_REF_DEPENDENT' for \ref command
2658 // Is a reference to the GlobalObjects documentation.
2690 int getRecord( Record *& prRetVal,
2691 const glo::ObjID & rObjID,
2692 const TableReaderInterface & rTableReaderInterface,
2693 TransactionOwner * pCommunicatorWithTreadID = nullptr ) const;
2694 //-----------------------------------------------------------------------
2695 // doxygen -> warning: unable to resolve reference to 'GLO_REF_DEPENDENT' for \ref command
2696 // Is a reference to the GlobalObjects documentation.
2732 void getDependRecords( std::map< ObjID, Record *, std::less<ObjID> > & rDependRecordMap,
2733 Record & rSourceRecord,
2734 const TableReaderInterface & rTableReaderInterface,
2735 EnDeepMode eDeepMode,
2736 TransactionOwner * pCommunicatorWithTreadID = nullptr ) const;
2737 //-----------------------------------------------------------------------
2738 // doxygen -> warning: unable to resolve reference to 'GLO_REF_DEPENDENT' for \ref command
2739 // Is a reference to the GlobalObjects documentation.
2778 void getDependRecordsRecursive( std::map< ObjID, Record *, std::less<ObjID> > & rDependRecordMap,
2779 Record & rSourceRecord,
2780 const TableReaderInterface & rTableReaderInterface,
2781 EnDeepMode eDeepMode,
2782 TransactionOwner * pCommunicatorWithTreadID = nullptr ) const;
2783 //-----------------------------------------------------------------------
2794 //-----------------------------------------------------------------------
2805 //-----------------------------------------------------------------------
2806
2807 //============== Die Thread-Methode
2808 //-----------------------------------------------------------------------
2823 virtual void work() override;
2824 //-----------------------------------------------------------------------
2825
2826 private:
2827 //============== Operatoren
2828 //-----------------------------------------------------------------------
2838 Manager & operator= ( const Manager & );
2839 //-----------------------------------------------------------------------
2840 };
2841 //---------------------------------------------------------------------------
2842 #ifdef _MSC_VER
2843 /* 'Bezeichner': Klasse 'Typ' benötigt eine DLL-Schnittstelle, die von... */
2844 #pragma warning( default : 4251 )
2845 #endif
2846 //---------------------------------------------------------------------------
2847} // namespace glo
2848#endif
Header for CriticalSection
Header for EuEndlessPThread
Header for EuPCriticalSection
Header for RepeatingThread
Header for LockSpecification
Header for OrderMsg
Header for TransactionManager TransactionManager::TransactionBase TransactionManager::Transaction...
Header for TransactionOwner
For each library, here 'GlobalObjects' there is a type file.
#define __glo_export_dll
Definition GloTypes.h:70
Header for WatchSpecification
Header for TDVList
Base class for a thread that executes its work endlessly until aborted.
Definition EuEndlessPThread.h:84
Is a mutex which can be queried via its lock mode. See isLocked().
Definition EuPCriticalSection.h:104
Is a mutex which can be queried via its lock mode. See isLocked().
Definition EuCriticalSection.h:109
Base class for a thread that executes its work endlessly until aborted.
Definition EuRepeatingThread.h:93
A CommunicaterThread accepts requests for its TableReaderInterface.
Definition GloCommunicaterThread.h:89
Superclass of LocalThread, ClientThread and ServerThread, because they can act as senders and receive...
Definition GloCommunicator.h:93
IndexPool is the base class for the RealIndexPool and the TransactionIndexPool for the individual tra...
Definition GloIndexPool.h:196
Objects of this class monitor the lock state of persistent objects.
Definition GloLockManager.h:239
To be able to lock objects, the 'lock mode' and the 'lock depth' are required as parameters....
Definition GloLockSpecification.h:65
Is the remote station or the communicator which communicates with the Manager. In multi-user operatio...
Definition GloManager.h:225
CommunicaterThread * m_pCommunicatorThread
Definition GloManager.h:281
std::string getSchemaName() const
std::string m_sSchemaName
Definition GloManager.h:259
unsigned int m_uiRefCounter
Definition GloManager.h:246
unsigned int decrementRefCounter()
Receiver(const std::string &sSchemaName, CommunicaterThread *pCommunicatorThread, Communicator *pCommunicator)
Receiver(const Receiver &)
Communicator * m_pCommunicator
Definition GloManager.h:270
unsigned int incrementRefCounter()
CommunicaterThread * getCommunicatorThread() const
Communicator * getCommunicator() const
Objects of this class represent an open database. There is one object of this class for each open dat...
Definition GloManager.h:569
TableWriterInterface * m_pTableWriterInterface
Definition GloManager.h:608
unsigned int Counter() const
SchemaMapItem(const SchemaMapItem &)
SchemaInterface * m_pSchema
Definition GloManager.h:597
std::ofstream * m_pLockFile
Definition GloManager.h:624
unsigned int m_uiCounter
Definition GloManager.h:586
TableWriterInterface * getTableWriterInterface() const
SchemaInterface * getSchema() const
SchemaMapItem(SchemaInterface *pSchema, RealIndexPool *pRealIndexPool, std::ofstream *pLockFile)
Shows the actions of the Manager via std::cout
Definition GloManagerActionVisualiser.h:70
The object of this class is the central point of contact for actions that deal with GlobalObjects dat...
Definition GloManager.h:193
int transactionManagerSetTransactionStep(const SchemaInterface &rSchema, const TransactionOwner &rCommunicatorWithTreadID, TransactionManager::EnStoreDelete eStoreOrDelete, Record *pRecord)
int createSchemaInterface(SchemaInterface *&prNewSchemaInterface, const std::string &rsSchemaName) const
static ShowLevel getShowLevel()
std::map< SOCKET, ClientInfo, std::less< SOCKET > > m_ConnectedClientsMap
Definition GloManager.h:1050
RealIndexPool * getRealIndexPool()
static Manager * create(const std::string &rsSchemaPath, const std::vector< std::string > &rAllowedSchemes)
void deleteCommunicatorWatches(OrderMsg *pOrderMsg)
void openBase(OrderMsg *pOrderMsg)
void getDependRecordsRecursive(std::map< ObjID, Record *, std::less< ObjID > > &rDependRecordMap, Record &rSourceRecord, const TableReaderInterface &rTableReaderInterface, EnDeepMode eDeepMode, TransactionOwner *pCommunicatorWithTreadID=nullptr) const
void sendToWatchNotifyManager(OrderMsg *pOrderMsg)
void getAllTransactionIndexPools(std::vector< TransactionIndexPool * > &rTransactionIndexPoolVector, std::string *psSchemaName=0, Communicator *pWithoutThisCommunicator=0) const
void compressBase(OrderMsg *pOrderMsg)
std::size_t getNumberReceiver() const
static void showWriterAction(OrderMsg *pOrderMsg, const std::string &rsActionString, char cSE)
virtual ~Manager()
std::vector< std::string > m_KnownSchemes
Definition GloManager.h:1015
void getAllDataTypes(OrderMsg *pOrderMsg) const
WatchNotifyManager * m_pWatchNotifyManager
Definition GloManager.h:1096
Manager::SchemaMapItem * getSchemaMapItem(const std::string &rsSchemaName) const
static ManagerActionVisualiser * m_pActionVisualiser
Definition GloManager.h:980
int getRecord(Record *&prRetVal, const glo::ObjID &rObjID, const TableReaderInterface &rTableReaderInterface, TransactionOwner *pCommunicatorWithTreadID=nullptr) const
void deleteAllObjectsInReceiverMap()
std::map< Communicator *, Receiver *, std::less< Communicator * > > m_ReceiverMap
Definition GloManager.h:1063
std::string getSchemaPath() const
eut::CriticalSection m_LocalCriticalSection
Definition GloManager.h:1137
void processObjectNotify(TdWatchNotifyMode nWatchNotifyMode, const std::list< ObjID > &rObjIDList, Communicator *pCommunicator, const std::string &rsSchemaName)
int checkAllRecordIndices(int iCheckStatus, const SchemaInterface &rSchema, const std::map< ObjID, Record *, std::less< ObjID > > &rRecordMap, IndexPool &rGloIndexPool) const
static int ms_iReferenceCounter
Definition GloManager.h:947
void insertInKnownBases(const std::vector< std::string > &rNewSchemes)
std::string m_strSchemaPath
Definition GloManager.h:1004
void deleteAllObjectsInSchemaMap()
int lockBaseExclusive(std::ofstream *&prLockFile, const SchemaInterface &rSchemaInterface)
void processObjectNotify(TdWatchNotifyMode nWatchNotifyMode, const ObjID &rObjID, Communicator *pCommunicator, const std::string &rsSchemaName)
void getDataTypeLimits(OrderMsg *pOrderMsg) const
LockManager * m_pLockManager
Definition GloManager.h:1074
static ShowLevel m_ulShowLevel
Definition GloManager.h:969
static void showTransactionAction(OrderMsg *pOrderMsg, const std::string &rsActionString, char cSE)
void releaseStrIndexesFromTransactionStepList(std::list< TransactionManager::TransactionBase * > &rTransactionStepList, std::string &rsSchemaName)
void getBaseOrSubClassInfos(OrderMsg *pOrderMsg) const
void repairBase(OrderMsg *pOrderMsg)
void switchOffAllRecieverReader()
void getDependRecords(std::map< ObjID, Record *, std::less< ObjID > > &rDependRecordMap, Record &rSourceRecord, const TableReaderInterface &rTableReaderInterface, EnDeepMode eDeepMode, TransactionOwner *pCommunicatorWithTreadID=nullptr) const
void sendToTransactionManager(OrderMsg *pOrderMsg)
static void setActionVisualiser(ManagerActionVisualiser *pActionVisualiser)
void getAllKnownBases(OrderMsg *pOrderMsg) const
Manager(const Manager &)
int sendToLockManager(OrderMsg::EnOrderType eOrderType, SchemaInterface *pSchema, std::list< ObjID > *pObjectIDsToBeLocked, LockSpecification *pLockSpec, const TransactionOwner &rCommunicatorWithTreadID)
void getClassInfo(OrderMsg *pOrderMsg) const
int sendCOMMITtoTransactionManager(const TransactionOwner &rCommunicatorWithTreadID, std::string sSchemaName, std::map< ObjID, Record *, std::less< ObjID > > *pInputDataRecordMap)
void removeCommunicator(OrderMsg *pOrderMsg, WatchNotifyManager *pWatchNotifyManager=0)
int sendBEGINtoTransactionManager(const TransactionOwner &rCommunicatorWithTreadID)
void sendToLockManager(OrderMsg *pOrderMsg)
static void showOrderAction(OrderMsg *pOrderMsg, char cSE)
virtual void work() override
void closeBase(OrderMsg *pOrderMsg)
void getKnownBases(std::vector< std::string > &rKnownBasesVector) const
std::map< std::string, SchemaMapItem *, std::less< std::string > > m_SchemaMap
Definition GloManager.h:1028
static Manager * getAvailableInstance()
int sendABORTtoTransactionManager(const TransactionOwner &rCommunicatorWithTreadID, std::string sSchemaName)
void getAllClients(std::vector< ClientInfo > &rClientInfoVector, std::string *psSchemaName=0) const
static void showActionString(const std::string &sActionString)
void getAllClients(OrderMsg *pOrderMsg) const
void unlockTransactionStepList(std::list< TransactionManager::TransactionBase * > &rTransactionStepList, const TransactionOwner &rCommunicatorWithTreadID, const std::string &rsSchemaName, TransactionIndexPool *pTransactionIndexPool, bool bDelete)
static int destroy()
void switchOnRecieverReader(std::string sSchemaName)
SchemaInterface * getSchemaInterface(const std::string &rsSchemaName) const
std::size_t getNumberReceiver(std::string sSchemaName) const
bool m_bWorkingExclusiv
Definition GloManager.h:1120
static void showReaderAction(OrderMsg *pOrderMsg, const std::string &rsActionString, char cSE)
std::queue< OrderMsg * > m_MsgQueue
Definition GloManager.h:1039
void reindexBase(OrderMsg *pOrderMsg)
void sendToWriter(OrderMsg *pOrderMsg)
unsigned int m_uiCommunicatorID
Definition GloManager.h:993
static void setShowLevel(ShowLevel ulLevel)
Manager(const std::string &rsSchemaPath, const std::vector< std::string > &rAllowedSchemes)
RealIndexPool * m_pRealIndexPool
Definition GloManager.h:1107
static void showAction(const OrderMsg *pOrderMsg, const std::string &rsActiontype, const std::string &rsActionString, char cSE)
void processNewConnectedClient(OrderMsg *pOrderMsg)
void switchOnAllRecieverReader()
int takeOrder(OrderMsg *pOrderMsg)
void sendToReaderThread(OrderMsg *pOrderMsg)
void processDisconnectedClient(OrderMsg *pOrderMsg)
static Manager * m_pInstance
Definition GloManager.h:958
bool isBaseOpen(Communicator *pCommunicator)
void switchOffRecieverReader(std::string sSchemaName)
Manager::Receiver * getReceiver(Communicator *pCommunicator)
TransactionManager * m_pTransactionManager
Definition GloManager.h:1085
An object ID consists of the class ID, a database ID and the actual unique object number (all unsigne...
Definition GloObjID.h:84
This class is used to handle the communication between the application that uses GlobalObjects and Gl...
Definition GloOrderMsg.h:84
EnOrderType
Definition GloOrderMsg.h:105
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 accesses tables and reads data records (Record) and binary files (eut::Blob).
Definition GloTableReaderInterface.h:87
An object of this class accesses tables and writes data records (Record) and binary files (eut::Blob)...
Definition GloTableWriterInterface.h:77
Class that communicates with a tcp::Client via a SOCKET and delivers the result of the reception of t...
Definition GloTcpServerReceiver.h:81
This index is generated in each transaction and changes such as saving, deleting or inserting an obje...
Definition GloTransactionIndexPool.h:66
class to guarantee transactions.
Definition GloTransactionManager.h:172
EnStoreDelete
Definition GloTransactionManager.h:186
In order to make transactions available not only to a glo::Communicator, but also to individual threa...
Definition GloTransactionOwner.h:81
Classes to monitor persistent objects and to notify the respective clients of changes.
Definition GloWatchNotifyManager.h:352
Definition GloAbstractBaseLot.h:49
EnDeepMode
Definition GloTypes.h:254
unsigned long ShowLevel
Definition GloTypes.h:839
unsigned long TdWatchNotifyMode
Definition GloTypes.h:558
A structure to map the object ID of a persistent object with the data records of the dependent object...
Definition GloManager.h:469
ObjIdWithDepends(const ObjID &rObjID, std::map< ObjID, Record *, std::less< ObjID > > *pDependRecordMap)
std::map< ObjID, Record *, std::less< ObjID > > * m_pDependRecordMap
Definition GloManager.h:498
ObjID m_ObjID
Definition GloManager.h:482