1#ifndef INC_GLODBMANAGER_H
2#define INC_GLODBMANAGER_H
54#if defined (__PTHREADS)
65#if defined (__PTHREADS)
67 #include <semaphore.h>
75#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__)
77#elif defined(__GNUC__)
81 #include <sys/types.h>
82 #include <sys/socket.h>
83 #include <netinet/in.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)
98 class CommunicaterThread;
101 class ManagerActionVisualiser;
105 class SchemaInterface;
107 class TableReaderInterface;
108 class TransactionIndexPool;
109 class TableWriterInterface;
110 class WatchNotifyManager;
116 #pragma warning( disable : 4251 )
188 #if defined (__PTHREADS)
531 std::map<
ObjID,
Record *, std::less<ObjID> > * pDependRecordMap );
610 #if defined(_MSC_VER)
626 #elif defined(__MINGW32__) || defined(__MINGW64__)
640 void * m_hLockFileHandle;
642 #elif defined(__GNUC__)
656 int m_iLockFileHandle;
679 #if defined(_MSC_VER)
713 std::ofstream * pLockFile );
715 #elif defined(__MINGW32__) || defined(__MINGW64__)
750 void * hLockFileHandle );
752 #elif defined(__GNUC__)
787 int iLockFileHandle );
791 #if defined(_MSC_VER)
802 #elif defined(__MINGW32__) || defined(__MINGW64__)
813 #elif defined(__GNUC__)
1028 std::map< std::string, SchemaMapItem *, std::less< std::string > >
m_SchemaMap;
1063 std::map< Communicator *, Receiver * , std::less< Communicator * > >
m_ReceiverMap;
1134 #if defined (__PTHREADS)
1154 #if defined(__GNUC__)
1155 __attribute__((noreturn))
1178 const std::vector< std::string > & rAllowedSchemes );
1236 const std::vector< std::string > & rAllowedSchemes );
1357 const std::string & rsActiontype,
1358 const std::string & rsActionString,
1402 const std::string & rsActionString,
1425 const std::string & rsActionString,
1448 const std::string & rsActionString,
1552 std::string * psSchemaName = 0 )
const;
1627 const std::string & rsSchemaName )
const;
2059 std::string sSchemaName );
2088 std::string sSchemaName,
2089 std::map<
ObjID,
Record *, std::less<ObjID> > * pInputDataRecordMap );
2185 std::list<ObjID> * pObjectIDsToBeLocked,
2251 const ObjID & rObjID,
2253 const std::string & rsSchemaName );
2275 const std::list<ObjID> & rObjIDList,
2277 const std::string & rsSchemaName );
2282 #if defined(_MSC_VER)
2312 #elif defined(__MINGW32__) || defined(__MINGW64__)
2339 int lockBaseExclusive(
void *& prLockFileHandle,
2342 #elif defined(__GNUC__)
2369 int lockBaseExclusive(
int & riLockFileHandle,
2513 std::string * psSchemaName = 0,
2586 const std::map<
ObjID,
Record *, std::less<ObjID> > & rRecordMap,
2613 std::string & rsSchemaName );
2653 const std::string & rsSchemaName,
2844 #pragma warning( default : 4251 )
Header for CriticalSection
Header for EuEndlessPThread
Header for EuPCriticalSection
Header for RepeatingThread
Header for LockSpecification
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
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)
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
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)
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