GlobalObjects
Lade ...
Suche ...
Keine Treffer
GloTransactionManager.h
gehe zur Dokumentation dieser Datei
1#ifndef INC_GLOTRANSACTIONMANAGER_H
2#define INC_GLOTRANSACTIONMANAGER_H
3//-----------------------------------------------------------------------------
40//-----------------------------------------------------------------------------
41#include <list>
42#include <map>
43
44#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__)
45 #include <basetsd.h>
46#elif defined(__GNUC__)
47 #define INT_PTR intptr_t
48#endif
49
50#include "GloTypes.h"
51#include "GloObjID.h"
52//-----------------------------------------------------------------------------
53namespace glo
54{
55 //---------------------------------------------------------------------------
56 /* Forwards */
57 class Record;
58 class Communicator;
59 //---------------------------------------------------------------------------
60 #ifdef _MSC_VER
61 /* 'Bezeichner': Klasse 'Typ' benötigt eine DLL-Schnittstelle, die von... */
62 #pragma warning( disable : 4251 )
63 #endif
64 //---------------------------------------------------------------------------
65 // doxygen -> warning: unable to resolve reference to 'GLO_REF_DEPENDENT' for \ref command
66 // Is a reference to the GlobalObjects documentation.
67 //---------------------------------------------------------------------------
162 {
163 public:
164 //============== Enumeration
165 //-----------------------------------------------------------------------
176 {
177 eTRX_STORE,
186 eTRX_DELETE
195 };
196 //-----------------------------------------------------------------------
197
198 //-----------------------------------------------------------------------
199 // >>>>>>>>>>>>>>>>>>>>>> TransactionBase >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
200 //-----------------------------------------------------------------------
214 {
215 public:
216 //============= De- und Konstruktoren
217 //---------------------------------------------------------------------
228 //---------------------------------------------------------------------
239 //---------------------------------------------------------------------
240
241 private:
242 //---------------------------------------------------------------------
253 //---------------------------------------------------------------------
254
255 //============== Operatoren
256 //---------------------------------------------------------------------
267 //---------------------------------------------------------------------
268 };
269 //-----------------------------------------------------------------------
270 // <<<<<<<<<<<<<<<<<<<<<<<< TransactionBase <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
271 //-----------------------------------------------------------------------
272
273 //-----------------------------------------------------------------------
274 // >>>>>>>>>>>>>>>>>>>>>>> TransactionPoint >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
275 //-----------------------------------------------------------------------
289 {
290 private:
291 //============== Attribute
292 //---------------------------------------------------------------------
307 //---------------------------------------------------------------------
308
309 public:
310 //============= Konstruktoren
311 //---------------------------------------------------------------------
322 //---------------------------------------------------------------------
334 TransactionPoint( int iCount );
335 //---------------------------------------------------------------------
336
337 private:
338 //============= Konstruktor
339 //---------------------------------------------------------------------
350 //---------------------------------------------------------------------
351
352 public:
353 //============= Destruktor
354 //---------------------------------------------------------------------
365 //---------------------------------------------------------------------
366
367 //============== Methoden
368 //---------------------------------------------------------------------
380 int getCount() const;
381 //---------------------------------------------------------------------
382
383 private:
384 //============== Operatoren
385 //---------------------------------------------------------------------
396 //---------------------------------------------------------------------
397 };
398 //-----------------------------------------------------------------------
399 // <<<<<<<<<<<<<<<<<<<<< TransactionPoint <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
400 //-----------------------------------------------------------------------
401
402 //-----------------------------------------------------------------------
403 // >>>>>>>>>>>>>>>>>>>>> TransactionStep >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
404 //-----------------------------------------------------------------------
418 {
419 private:
420 //============== Attribute
421 //---------------------------------------------------------------------
435 //---------------------------------------------------------------------
446 //---------------------------------------------------------------------
458 //---------------------------------------------------------------------
459
460 protected:
461 //============== Konstruktoren
462 //---------------------------------------------------------------------
473 //---------------------------------------------------------------------
474
475 public:
476 //============== Konstruktoren
477 //---------------------------------------------------------------------
509 Record * pActionRecord,
510 bool bLocalCopy = false );
511 //---------------------------------------------------------------------
512
513 private:
514 //============= Konstruktor
515 //---------------------------------------------------------------------
526 //---------------------------------------------------------------------
527
528 public:
529 //============= Destruktor
530 //---------------------------------------------------------------------
541 //---------------------------------------------------------------------
542
543 //============== Methoden
544 //---------------------------------------------------------------------
561 void getActionRecord( Record *& prRetVal ) const;
562 //---------------------------------------------------------------------
582 const Record * getActionRecord() const;
583 //---------------------------------------------------------------------
597 //---------------------------------------------------------------------
611 //---------------------------------------------------------------------
624 //---------------------------------------------------------------------
648 int takeOverObjIDsFilePos( const Record & rSourceRecord );
649 //---------------------------------------------------------------------
650
651 private:
652 //============== Operatoren
653 //---------------------------------------------------------------------
664 //---------------------------------------------------------------------
665 };
666 //-----------------------------------------------------------------------
667 // <<<<<<<<<<<<<<<<<<<<<<< TransactionStep <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
668 //-----------------------------------------------------------------------
669
670 //-----------------------------------------------------------------------
671 // >>>>>>>>>>>>>>>> CommunicatorTransactionStack >>>>>>>>>>>>>>>>>>>>>>>>>>
672 //-----------------------------------------------------------------------
686 {
687 private:
688 //============== Attribute
689 //---------------------------------------------------------------------
700 //---------------------------------------------------------------------
712 std::list<TransactionBase *> m_TransactionStack;
713 //---------------------------------------------------------------------
724 //---------------------------------------------------------------------
725
726 protected:
727 //============= Konstruktor
728 //---------------------------------------------------------------------
739 //---------------------------------------------------------------------
740
741 public:
742 //============= De- und Konstruktoren
743 //---------------------------------------------------------------------
760 //---------------------------------------------------------------------
772 //---------------------------------------------------------------------
773
774 private:
775 //============== Copy-Konstruktor
776 //---------------------------------------------------------------------
787 //---------------------------------------------------------------------
788
789 public:
790 //============== Methoden
791 //---------------------------------------------------------------------
805 //---------------------------------------------------------------------
818 //---------------------------------------------------------------------
834 //---------------------------------------------------------------------
866 bool abortTransaction( std::list< TransactionBase * > & rAbortedTransactionStepList );
867 //---------------------------------------------------------------------
893 int setTransactionStep( NUM_PTR & nNewTrxStepAddr,
894 EnStoreDelete eAction,
895 Record * pActionRecord );
896 //---------------------------------------------------------------------
908 std::list< TransactionManager::TransactionBase * > & getTransactionStack();
909 //---------------------------------------------------------------------
910
911 private:
912 //============== Operatoren
913 //---------------------------------------------------------------------
924 //---------------------------------------------------------------------
925 };
926 //-----------------------------------------------------------------------
927 // <<<<<<<<<<<<<<<<< CommunicatorTransactionStack <<<<<<<<<<<<<<<<<<<<<<<<<
928 //-----------------------------------------------------------------------
929
930 private:
931 //============== Attribute
932 //-----------------------------------------------------------------------
945 std::map< NUM_PTR, CommunicatorTransactionStack *, std::less<NUM_PTR> > m_TransactionStackMap;
946 //-----------------------------------------------------------------------
956 std::map< NUM_PTR, CommunicatorTransactionStack * >::iterator m_TransactionStackMapIterator;
957 //-----------------------------------------------------------------------
968 std::map< ObjID, Record *, std::less<ObjID> > m_RecursionRecordMap;
969 //-----------------------------------------------------------------------
970
971 public:
972 //============== De- und Konstruktor
973 //-----------------------------------------------------------------------
984 //-----------------------------------------------------------------------
995 //-----------------------------------------------------------------------
996
997 private:
998 //============== Copy-Konstruktor
999 //-----------------------------------------------------------------------
1010 //-----------------------------------------------------------------------
1011
1012 public:
1013 //============== Methoden
1014 //-----------------------------------------------------------------------
1032 void beginTransaction( Communicator * pCommunicator );
1033 //-----------------------------------------------------------------------
1064 Communicator * pCommunicator );
1065 //-----------------------------------------------------------------------
1090 int abortTransaction( std::list< TransactionBase * > & rAbortedTransactionStepList,
1091 Communicator * pCommunicator );
1092 //-----------------------------------------------------------------------
1120 int setTransactionStep( NUM_PTR & nNewTrxStepAddr,
1121 Communicator * pCommunicator,
1122 EnStoreDelete eAction,
1123 Record * pActionRecord);
1124 //-----------------------------------------------------------------------
1165 int getActionRecord( Record *& prRetVal,
1166 EnStoreDelete & reAction,
1167 Communicator * pCommunicator,
1168 const ObjID & rObjID,
1169 const std::string & rsDataPath,
1170 bool bInRecursion = false );
1171 //-----------------------------------------------------------------------
1186 bool inTransaction( Communicator * pCommunicator ) const;
1187 //-----------------------------------------------------------------------
1201 void deleteTransaction( Communicator * pCommunicator );
1202 //-----------------------------------------------------------------------
1203
1204 protected:
1205 //============== Methoden
1206 //-----------------------------------------------------------------------
1226 //-----------------------------------------------------------------------
1241 //-----------------------------------------------------------------------
1242
1243 private:
1244 //-----------------------------------------------------------------------
1255 //-----------------------------------------------------------------------
1256
1257 //============== Operatoren
1258 //-----------------------------------------------------------------------
1269 //-----------------------------------------------------------------------
1270 };
1271 //---------------------------------------------------------------------------
1272 #ifdef _MSC_VER
1273 /* 'Bezeichner': Klasse 'Typ' benötigt eine DLL-Schnittstelle, die von... */
1274 #pragma warning( default : 4251 )
1275 #endif
1276 //---------------------------------------------------------------------------
1277} // namespace glo
1278#endif
long long NUM_PTR
Definition EuDef_NULL_PTR.h:93
Header für ObjID
Für jede Bibliothek, hier 'GlobalObjects' gibt es eine Typen-Datei.
#define __glo_export_dll
Definition GloTypes.h:63
OberKlasse von LocalThread, ClientThread und ServerThread, weil diese als Sender und Empfänger (Kommu...
Definition GloCommunicator.h:86
Ein Objekt-ID besteht aus der Klassen-ID, einer Datenbank-ID und der eigentlichen eindeutigen ObjektZ...
Definition GloObjID.h:77
Objekte dieser Klasse transportieren die Daten von den Tabellen ins persistente Objekt und von diesen...
Definition GloRecord.h:101
Der Transaktions-Stack eines Client-Kommunikators für eine Datenbank.
Definition GloTransactionManager.h:686
CommunicatorTransactionStack(Communicator *pCommunicator)
int setTransactionStep(NUM_PTR &nNewTrxStepAddr, EnStoreDelete eAction, Record *pActionRecord)
Communicator * m_pCommunicator
Definition GloTransactionManager.h:699
CommunicatorTransactionStack(const CommunicatorTransactionStack &)
std::list< TransactionManager::TransactionBase * > & getTransactionStack()
std::list< TransactionBase * > m_TransactionStack
Definition GloTransactionManager.h:712
bool abortTransaction(std::list< TransactionBase * > &rAbortedTransactionStepList)
int m_iCurrentTransactionPoint
Definition GloTransactionManager.h:723
Basisklasse für TransactionPoint und TransactionStep.
Definition GloTransactionManager.h:214
TransactionBase(const TransactionBase &)
Objekte dieser Klasse spiegeln einen Transaktions-Start wieder.
Definition GloTransactionManager.h:289
TransactionPoint(const TransactionPoint &)
int m_iCount
Definition GloTransactionManager.h:306
Objekte dieser Klasse spiegeln eine Datensatz-Operation wieder.
Definition GloTransactionManager.h:418
TransactionStep(EnStoreDelete eAction, Record *pActionRecord, bool bLocalCopy=false)
TransactionManager::EnStoreDelete m_eAction
Definition GloTransactionManager.h:457
bool m_bLocalCopyRecord
Definition GloTransactionManager.h:434
TransactionStep(const TransactionStep &)
TransactionManager::EnStoreDelete getAction() const
int takeOverObjIDsFilePos(const Record &rSourceRecord)
void getActionRecord(Record *&prRetVal) const
Record * m_pActionRecord
Definition GloTransactionManager.h:445
const Record * getActionRecord() const
Klasse um Transaktionen zu gewährleisten.
Definition GloTransactionManager.h:162
EnStoreDelete
Definition GloTransactionManager.h:176
std::map< NUM_PTR, CommunicatorTransactionStack *, std::less< NUM_PTR > > m_TransactionStackMap
Definition GloTransactionManager.h:945
void removeCurrentTransactionStack()
void beginTransaction(Communicator *pCommunicator)
bool inTransaction(Communicator *pCommunicator) const
std::map< NUM_PTR, CommunicatorTransactionStack * >::iterator m_TransactionStackMapIterator
Definition GloTransactionManager.h:956
void deleteTransaction(Communicator *pCommunicator)
int writeTransactionFile(CommunicatorTransactionStack *pTransactionStack)
int setTransactionStep(NUM_PTR &nNewTrxStepAddr, Communicator *pCommunicator, EnStoreDelete eAction, Record *pActionRecord)
int abortTransaction(std::list< TransactionBase * > &rAbortedTransactionStepList, Communicator *pCommunicator)
int getActionRecord(Record *&prRetVal, EnStoreDelete &reAction, Communicator *pCommunicator, const ObjID &rObjID, const std::string &rsDataPath, bool bInRecursion=false)
int commitTransaction(CommunicatorTransactionStack *&prRetVal, Communicator *pCommunicator)
std::map< ObjID, Record *, std::less< ObjID > > m_RecursionRecordMap
Definition GloTransactionManager.h:968
TransactionManager::CommunicatorTransactionStack * getTransactionStack(Communicator *pCommunicator)
TransactionManager(const TransactionManager &)
Definition GloAbstractBaseLot.h:42