BankAndCustomer
Lade ...
Suche ...
Keine Treffer
GloPersistent.h
gehe zur Dokumentation dieser Datei
1#ifndef INC_GLOPERSISTENT_H
2#define INC_GLOPERSISTENT_H
3//-----------------------------------------------------------------------------
43//-----------------------------------------------------------------------------
44#include "GloTypes.h"
45#include "GloBasePersistent.h"
46#include "GloPersObjectSpy.h"
47#include "GloAttributeID.h"
48#include "GloRecord.h"
49#include "GloTOndemand.h"
50#include "GloTPointerSet.h"
51#include "GloTOndemandSet.h"
52#include "GloTPointerList.h"
53#include "GloTOndemandList.h"
54#include "EuException.h"
55#include <string>
56#include <ctime>
57#include <list>
58//-----------------------------------------------------------------------------
59// Glo Macros
60//-----------------------------------------------------------------------------
82#define GLO_OBJECT(...) \
83 public: \
84 virtual unsigned long getGloClassID() const override; \
85 virtual int getTypeAsString( std::string & rsTypeName ) override; \
86 virtual int setGloAttribute( const glo::AttributeID & rAttributeID, void * pPara ) override; \
87 virtual void * getGloAttribute( const glo::AttributeID & rAttributeID ) override; \
88 virtual int setGloAttribute( const std::string & rstrAttributeName, void * pPara ) override; \
89 virtual void * getGloAttribute( const std::string & rstrAttributeName ) override; \
90 virtual bool isSameOrSuperClassFrom( const glo::Persistent * pPersistent ) const override; \
91 virtual bool isSameOrSuperClassFrom( const std::shared_ptr<glo::Persistent> spPersistent ) const override; \
92 virtual void _postAssign( glo::Base & rBase ) override; \
93 private:
94//-----------------------------------------------------------------------------
134#define GLO_INDEX(...)
135//-----------------------------------------------------------------------------
137#define GLO_ANNOTATE_ACCESS_SPECIFIER(x)
138//-----------------------------------------------------------------------------
144#define GLO_PERSISTENT_AREA GLO_ANNOTATE_ACCESS_SPECIFIER(x)
145//-----------------------------------------------------------------------------
166#define persistent GLO_PERSISTENT_AREA
167//-----------------------------------------------------------------------------
181#define transient GLO_PERSISTENT_AREA
182//-----------------------------------------------------------------------------
183
184//-----------------------------------------------------------------------------
185namespace glo
186{
241 class __glo_export_dll Persistent : public BasePersistent
242 {
243 //============== Attributes
244 //-----------------------------------------------------------------------
257 //-----------------------------------------------------------------------
268 std::time_t m_dtCreateDate;
269 //-----------------------------------------------------------------------
281 std::time_t m_dtLastChange;
282 //-----------------------------------------------------------------------
283
284 public:
285 //============== ctor
286 //-----------------------------------------------------------------------
297 //-----------------------------------------------------------------------
298
299 protected:
300 //============== detor
301 //-----------------------------------------------------------------------
317 virtual ~Persistent();
318 //-----------------------------------------------------------------------
319
320 public:
321 //============== copy ctor
322 //-----------------------------------------------------------------------
334 Persistent( const Persistent & rT );
335 //-----------------------------------------------------------------------
336
337 public:
338 //============== Methoden
339 //-----------------------------------------------------------------------
357 virtual void activate();
358 //-----------------------------------------------------------------------
386 virtual int assign( Base & rBase ) override;
387 //-----------------------------------------------------------------------
399 virtual void removeBase() override;
400 //-----------------------------------------------------------------------
410 virtual ObjID getObjID() const override;
411 //-----------------------------------------------------------------------
423 virtual std::time_t getCreateDate() const override;
424 //-----------------------------------------------------------------------
436 virtual std::time_t getLastChangeDate() const override;
437 //-----------------------------------------------------------------------
455 virtual void takeOverRecord( Record * pRecord ) override;
456 //-----------------------------------------------------------------------
492 virtual int preStore( EnDeepMode eDeepMode, void *& prData );
493 //-----------------------------------------------------------------------
528 virtual int store( EnDeepMode eDeepMode = DM_SHALLOW ) override;
529 //-----------------------------------------------------------------------
554 virtual void postStore( int iStoreErr, EnDeepMode eDeepMode, void * pData );
555 //-----------------------------------------------------------------------
594 virtual int preDeleteInBase( EnDeepMode eDeepMode, void *& prData );
595 //-----------------------------------------------------------------------
625 virtual int deleteInBase( EnDeepMode eDeepMode = DM_SHALLOW ) override;
626 //-----------------------------------------------------------------------
653 virtual void postDeleteInBase( int iDeleteErr, EnDeepMode eDeepMode, void * pData );
654 //-----------------------------------------------------------------------
690 virtual int preRefresh( void *& prData );
691 //-----------------------------------------------------------------------
722 virtual int refresh() override;
723 //-----------------------------------------------------------------------
748 virtual void postRefresh( int iRefreshErr, void * pData );
749 //-----------------------------------------------------------------------
791 virtual int preLock( EnLockMode eLockMode, EnDeepMode eDeepMode, void *& prData );
792 //-----------------------------------------------------------------------
830 virtual int lock( EnLockMode eLockMode = LK_DELETEvWRITE,
831 EnDeepMode eDeepMode = DM_SHALLOW ) override;
832 //-----------------------------------------------------------------------
868 virtual int lock( const LockSpecification & rLockSpecification ) override;
869 //-----------------------------------------------------------------------
915 virtual int lockAndRefresh( EnLockMode eLockMode = LK_DELETEvWRITE,
916 EnDeepMode eDeepMode = DM_SHALLOW ) override;
917 //-----------------------------------------------------------------------
961 virtual int lockAndRefresh( const LockSpecification & rLockSpecification ) override;
962 //-----------------------------------------------------------------------
991 virtual void postLock( int iLockErr, EnLockMode eLockMode, EnDeepMode eDeepMode, void * pData );
992 //-----------------------------------------------------------------------
1034 virtual int preRelock( EnLockMode eLockMode, EnDeepMode eDeepMode, void *& prData );
1035 //-----------------------------------------------------------------------
1083 virtual int relock( EnLockMode eLockMode = LK_DELETEvWRITE,
1084 EnDeepMode eDeepMode = DM_SHALLOW ) override;
1085 //-----------------------------------------------------------------------
1131 virtual int relock( const LockSpecification & rLockSpecification ) override;
1132 //-----------------------------------------------------------------------
1183 virtual int relockAndRefresh( EnLockMode eLockMode = LK_DELETEvWRITE,
1184 EnDeepMode eDeepMode = DM_SHALLOW ) override;
1185 //-----------------------------------------------------------------------
1234 virtual int relockAndRefresh( const LockSpecification & rLockSpecification ) override;
1235 //-----------------------------------------------------------------------
1264 virtual void postRelock( int iLockErr, EnLockMode eLockMode, EnDeepMode eDeepMode, void * pData );
1265 //-----------------------------------------------------------------------
1307 virtual int preUnlock( EnLockMode eLockMode, EnDeepMode eDeepMode, void *& prData );
1308 //-----------------------------------------------------------------------
1348 virtual int unlock( EnLockMode eLockMode = LK_DELETEvWRITE,
1349 EnDeepMode eDeepMode = DM_SHALLOW ) override;
1350 //-----------------------------------------------------------------------
1388 virtual int unlock( const LockSpecification & rLockSpecification ) override;
1389 //-----------------------------------------------------------------------
1419 virtual void postUnlock( int iUnlockErr, EnLockMode eLockMode, EnDeepMode eDeepMode, void * pData );
1420 //-----------------------------------------------------------------------
1471 virtual int preSetWatch( TdWatchNotifyMode ulWatchMode,
1472 EnDeepMode eDeepMode,
1473 CallBack * pCallBack,
1474 void *& prData );
1475 //-----------------------------------------------------------------------
1547 virtual int setWatch( TdWatchNotifyMode ulWatchMode,
1548 EnDeepMode eDeepMode,
1549 CallBack * pCallBack = 0 ) override;
1550 //-----------------------------------------------------------------------
1590 virtual void postSetWatch( int iSetWatchErr,
1591 TdWatchNotifyMode ulWatchMode,
1592 EnDeepMode eDeepMode,
1593 CallBack * pCallBack,
1594 void * pData );
1595 //-----------------------------------------------------------------------
1646 virtual int preUnsetWatch( TdWatchNotifyMode ulWatchMode,
1647 EnDeepMode eDeepMode,
1648 CallBack * pCallBack,
1649 void *& prData );
1650 //-----------------------------------------------------------------------
1721 virtual int unsetWatch( TdWatchNotifyMode ulWatchMode,
1722 EnDeepMode eDeepMode,
1723 CallBack * pCallBack = 0 ) override;
1724 //-----------------------------------------------------------------------
1763 virtual void postUnsetWatch( int iUnsetWatchErr,
1764 TdWatchNotifyMode ulWatchMode,
1765 EnDeepMode eDeepMode,
1766 CallBack * pCallBack,
1767 void * pData );
1768 //-----------------------------------------------------------------------
1769
1770 protected:
1771 //============== Methoden
1772 //-----------------------------------------------------------------------
1782 virtual void insertInObjectSpy() const override;
1783 //-----------------------------------------------------------------------
1793 virtual void removeInObjectSpy() const override;
1794 //-----------------------------------------------------------------------
1804 virtual void setCreateDate() override;
1805 //-----------------------------------------------------------------------
1806
1807 public:
1808 //============== Methoden
1809 //-----------------------------------------------------------------------
1825 virtual unsigned long getGloClassID() const override;
1826 //-----------------------------------------------------------------------
1840 virtual int getTypeAsString( std::string & rsTypeName ) override;
1841 //-----------------------------------------------------------------------
1867 virtual int setGloAttribute( const AttributeID & rAttributeID, void * pPara );
1868 //-----------------------------------------------------------------------
1891 virtual void * getGloAttribute( const AttributeID & rAttributeID );
1892 //-----------------------------------------------------------------------
1918 virtual int setGloAttribute (const std::string & rstrAttributName, void * pPara);
1919 //-----------------------------------------------------------------------
1941 virtual void * getGloAttribute (const std::string & rstrAttributName);
1942 //-----------------------------------------------------------------------
1944
1959 virtual bool isSameOrSuperClassFrom( const glo::Persistent * pPersistent ) const;
1960 virtual bool isSameOrSuperClassFrom( const std::shared_ptr<glo::Persistent> pPersistent ) const;
1962 //-----------------------------------------------------------------------
1963
1964 protected:
1965 //============== Methoden
1966 //-----------------------------------------------------------------------
1987 virtual void _postAssign( Base & rBase );
1988 //-----------------------------------------------------------------------
1989
1990 //============== Operatoren
1991 //-----------------------------------------------------------------------
2003 Persistent & operator= ( const Persistent & rT );
2004 //-----------------------------------------------------------------------
2006
2017 bool operator== ( const Persistent & rT ) const;
2018 bool operator!= ( const Persistent & rT ) const;
2020 //-----------------------------------------------------------------------
2021 };
2022 //---------------------------------------------------------------------------
2023} // namespace glo
2024#endif
Header für BasePersistent
Header und Source für TOndemand
Abstrakte Basisklasse für Persistent und die generische GenericPersistent.
Definition GloBasePersistent.h:124
Oberklasse für die Klassen, welche mit einer Base 'verbunden' sind.
Definition GloCallBack.h:81
Ein Objekt-ID besteht aus der Klassen-ID, einer Datenbank-ID und der eigentlichen eindeutigen ObjektZ...
Definition GloObjID.h:84
Die Basisklasse der persistenten Klassen. Von dieser Klasse müssen alle persistenten Klassen abgeleit...
Definition GloPersistent.h:242
virtual int setGloAttribute(const AttributeID &rAttributeID, void *pPara)
virtual int setWatch(TdWatchNotifyMode ulWatchMode, EnDeepMode eDeepMode, CallBack *pCallBack=0) override
virtual int preDeleteInBase(EnDeepMode eDeepMode, void *&prData)
virtual void removeInObjectSpy() const override
virtual int lock(EnLockMode eLockMode=LK_DELETEvWRITE, EnDeepMode eDeepMode=DM_SHALLOW) override
virtual unsigned long getGloClassID() const override
virtual int refresh() override
virtual int store(EnDeepMode eDeepMode=DM_SHALLOW) override
virtual void * getGloAttribute(const AttributeID &rAttributeID)
std::time_t m_dtCreateDate
Definition GloPersistent.h:268
virtual int unlock(EnLockMode eLockMode=LK_DELETEvWRITE, EnDeepMode eDeepMode=DM_SHALLOW) override
virtual int unsetWatch(TdWatchNotifyMode ulWatchMode, EnDeepMode eDeepMode, CallBack *pCallBack=0) override
virtual int lockAndRefresh(const LockSpecification &rLockSpecification) override
virtual int relock(EnLockMode eLockMode=LK_DELETEvWRITE, EnDeepMode eDeepMode=DM_SHALLOW) override
virtual void _postAssign(Base &rBase)
Persistent(const Persistent &rT)
ObjID m_ObjID
Definition GloPersistent.h:256
virtual void postSetWatch(int iSetWatchErr, TdWatchNotifyMode ulWatchMode, EnDeepMode eDeepMode, CallBack *pCallBack, void *pData)
virtual void takeOverRecord(Record *pRecord) override
virtual int assign(Base &rBase) override
virtual std::time_t getCreateDate() const override
virtual void * getGloAttribute(const std::string &rstrAttributName)
virtual ObjID getObjID() const override
std::time_t m_dtLastChange
Definition GloPersistent.h:281
virtual void setCreateDate() override
virtual int preLock(EnLockMode eLockMode, EnDeepMode eDeepMode, void *&prData)
virtual void postUnlock(int iUnlockErr, EnLockMode eLockMode, EnDeepMode eDeepMode, void *pData)
virtual void postDeleteInBase(int iDeleteErr, EnDeepMode eDeepMode, void *pData)
virtual void postLock(int iLockErr, EnLockMode eLockMode, EnDeepMode eDeepMode, void *pData)
virtual int deleteInBase(EnDeepMode eDeepMode=DM_SHALLOW) override
virtual bool isSameOrSuperClassFrom(const std::shared_ptr< glo::Persistent > pPersistent) const
Prüft ob übergebenes Objekt auf dieses gecastet werden kann.
virtual void insertInObjectSpy() const override
virtual void activate()
virtual int getTypeAsString(std::string &rsTypeName) override
virtual int preRelock(EnLockMode eLockMode, EnDeepMode eDeepMode, void *&prData)
virtual int preStore(EnDeepMode eDeepMode, void *&prData)
virtual bool isSameOrSuperClassFrom(const glo::Persistent *pPersistent) const
Prüft ob übergebenes Objekt auf dieses gecastet werden kann.
virtual void removeBase() override
virtual void postRelock(int iLockErr, EnLockMode eLockMode, EnDeepMode eDeepMode, void *pData)
virtual void postStore(int iStoreErr, EnDeepMode eDeepMode, void *pData)
virtual int preRefresh(void *&prData)
virtual int relock(const LockSpecification &rLockSpecification) override
virtual void postRefresh(int iRefreshErr, void *pData)
virtual int preUnsetWatch(TdWatchNotifyMode ulWatchMode, EnDeepMode eDeepMode, CallBack *pCallBack, void *&prData)
virtual int relockAndRefresh(EnLockMode eLockMode=LK_DELETEvWRITE, EnDeepMode eDeepMode=DM_SHALLOW) override
virtual int setGloAttribute(const std::string &rstrAttributName, void *pPara)
virtual int preUnlock(EnLockMode eLockMode, EnDeepMode eDeepMode, void *&prData)
virtual int lockAndRefresh(EnLockMode eLockMode=LK_DELETEvWRITE, EnDeepMode eDeepMode=DM_SHALLOW) override
virtual ~Persistent()
virtual std::time_t getLastChangeDate() const override
virtual int unlock(const LockSpecification &rLockSpecification) override
virtual int lock(const LockSpecification &rLockSpecification) override
virtual void postUnsetWatch(int iUnsetWatchErr, TdWatchNotifyMode ulWatchMode, EnDeepMode eDeepMode, CallBack *pCallBack, void *pData)
virtual int preSetWatch(TdWatchNotifyMode ulWatchMode, EnDeepMode eDeepMode, CallBack *pCallBack, void *&prData)
virtual int relockAndRefresh(const LockSpecification &rLockSpecification) override
Definition GloBasePersistent.h:60