BankAndCustomer
|
A reference (as attribute) of a persistent object to another persistent object in the database. More...
#include <GloTOndemand.h>
Public Member Functions | |
TOndemand () | |
TOndemand (const ObjID &rObjID) | |
TOndemand (Base &rBase) | |
TOndemand (unsigned long ulDatabaseID) | |
TOndemand (const ObjID &rObjID, Base &rBase) | |
TOndemand (const ObjID &rObjID, unsigned long ulDatabaseID) | |
TOndemand (const TOndemand &rT) | |
virtual | ~TOndemand () |
int | get (T *&prObj) |
int | get (std::shared_ptr< T > &rRetVal) |
virtual int | setReference (const ObjID &rObjID) override |
int | set (const T *rObj) |
Adopts the object ID of the passed object as reference. | |
int | set (const T &rObj) |
Adopts the object ID of the passed object as reference. | |
int | set (const std::shared_ptr< T > &rObj) |
Adopts the object ID of the passed object as reference. | |
TOndemand< T > & | operator= (const TOndemand &rT) |
Assignment operator. | |
bool | operator== (const TOndemand &rT) const |
Comparison operator. | |
bool | operator!= (const TOndemand &rT) const |
Comparison operator. | |
![]() | |
Reference () | |
Reference (const ObjID &rObjID) | |
Reference (Base &rBase) | |
Reference (unsigned long ulDatabaseID) | |
Reference (const ObjID &rObjID, Base &rBase) | |
Reference (const ObjID &rObjID, unsigned long ulDatabaseID) | |
Reference (const Reference &rT) | |
virtual | ~Reference () |
virtual int | setBase (Base *pBase) override |
virtual Base * | getBase () const override |
virtual int | getTypeAsString (std::string &rsTypeName) override |
bool | isNULL () const |
void | setNULL () |
ObjID | getObjID () const |
const ObjID * | getObjIDAsPointer () const |
int | setReference (const BasePersistent *pObj) |
int | setReference (const BasePersistent &rObj) |
int | getReference (BasePersistent *&prRetVal) |
int | getReference (std::shared_ptr< BasePersistent > &rspRetVal) |
virtual int | deleteInBase (EnDeepMode eDeepMode=DM_SHALLOW) |
virtual int | lock (EnLockMode eLockMode=LK_DELETEvWRITE, EnDeepMode eDeepMode=DM_SHALLOW) const |
virtual int | lock (const LockSpecification &rLockSpecification) const |
virtual int | unlock (EnLockMode eLockMode=LK_DELETEvWRITE, EnDeepMode eDeepMode=DM_SHALLOW) const |
virtual int | unlock (const LockSpecification &rLockSpecification) const |
virtual int | isLocked (EnLockMode eLockMode=LK_DELETEvWRITE, EnDeepMode eDeepMode=DM_SHALLOW) const |
virtual int | isLocked (const LockSpecification &rLockSpecification) const |
virtual int | isPossible (bool bRead, bool bWrite, bool bDelete, EnDeepMode eDeepMode=DM_SHALLOW) const |
virtual int | isPossible (const LockPossibleSpecification &rLockPossibleSpec, EnDeepMode eDeepMode=DM_SHALLOW) const |
virtual int | setWatch (TdWatchNotifyMode ulWatchMode, EnDeepMode eDeepMode, CallBack *pCallBack=0) const |
virtual int | setWatch (const WatchSpecification &rWatchSpec) const |
virtual int | unsetWatch (TdWatchNotifyMode ulWatchMode, EnDeepMode eDeepMode, CallBack *pCallBack) const |
virtual int | unsetWatch (const WatchSpecification &rWatchSpec) const |
Reference & | operator= (const Reference &rT) |
bool | operator== (const Reference &rT) const |
Comparison operator. | |
bool | operator!= (const Reference &rT) const |
Comparison operator. | |
![]() | |
CallBack () | |
virtual | ~CallBack () |
virtual void | notify (NotifyNote &rNote) |
CallBack & | operator= (const CallBack &rT) |
bool | operator== (const CallBack &rT) const |
Comparison operator, all attributes are compared. | |
bool | operator!= (const CallBack &rT) const |
Comparison operator, all attributes are compared. | |
Static Public Member Functions | |
static unsigned long | getStaticGloClassID () |
Additional Inherited Members | |
![]() | |
std::string | m_strDebugInfo |
![]() | |
CallBack (const CallBack &rT) | |
void | init () |
void | deinit () |
A reference (as attribute) of a persistent object to another persistent object in the database.
In contrast to a pointer to a persistent object (where the referenced object is loaded with the referencing object), TOndemand is a reference to a persistent object via the object ID; it is not loaded with the referencing object from the database, but can be 'reloaded' if needed.
It makes sense to use TOndemand whenever an object references a 'large' object that is not necessarily available in memory.
E.g. in an image management system an image object could contain textual information, a thumpnail and a 'large' image. For some views it may not be useful to get the 'large' image from the database for every display due to speed reasons. In this case a reference via a TOndemand would be useful.
If objects in one object database should reference objects in another object database, this is only possible with glo::TOndemand.
glo::TOndemand< T >::TOndemand | ( | ) |
Standard constructor.
glo::TOndemand< T >::TOndemand | ( | const ObjID & | rObjID | ) |
Constructor with parameter passing.
[in] | rObjID | The object ID of the object to be referenced can be specified during creation. |
glo::TOndemand< T >::TOndemand | ( | Base & | rBase | ) |
Constructor with parameter passing.
[in] | rBase | The authoritative database can be specified during the creation. |
glo::TOndemand< T >::TOndemand | ( | unsigned long | ulDatabaseID | ) |
Constructor with parameter passing.
[in] | ulDatabaseID | The authoritative database id can be specified during the creation. |
glo::TOndemand< T >::TOndemand | ( | const ObjID & | rObjID, |
Base & | rBase ) |
Constructor with parameter passing.
[in] | rObjID | The object ID of the object to be referenced and... |
[in] | rBase | ...the relevant database can be specified during creation. |
glo::TOndemand< T >::TOndemand | ( | const ObjID & | rObjID, |
unsigned long | ulDatabaseID ) |
Constructor with parameter passing.
[in] | rObjID | The object ID of the object to be referenced and... |
[in] | ulDatabaseID | ...the relevant database id can be specified during creation. |
glo::TOndemand< T >::TOndemand | ( | const TOndemand< T > & | rT | ) |
Copy constructor.
[in] | rT | The data is copied from this object. |
|
virtual |
Destructor
int glo::TOndemand< T >::get | ( | std::shared_ptr< T > & | rRetVal | ) |
Returns the referenced object from the database (or from memory if already loaded) in a std::shared_ptr.
[in,out] | rRetVal | The referenced object in a std::shared_ptr. |
int glo::TOndemand< T >::get | ( | T *& | prObj | ) |
Returns the referenced object from the database (or from memory if already loaded).
[in,out] | prObj | The pointer reference to the referenced object. |
|
inlinestatic |
Returns the template class ID.
bool glo::TOndemand< T >::operator!= | ( | const TOndemand< T > & | rT | ) | const |
Comparison operator.
[in] | rT | The object to be compared with this one. |
TOndemand< T > & glo::TOndemand< T >::operator= | ( | const TOndemand< T > & | rT | ) |
Assignment operator.
[in] | rT | The data is transferred from this object. |
bool glo::TOndemand< T >::operator== | ( | const TOndemand< T > & | rT | ) | const |
Comparison operator.
[in] | rT | The object to be compared with this one. |
int glo::TOndemand< T >::set | ( | const std::shared_ptr< T > & | rObj | ) |
Adopts the object ID of the passed object as reference.
[in] | pObj | The pointer to the object to be referenced. |
int glo::TOndemand< T >::set | ( | const T & | rObj | ) |
Adopts the object ID of the passed object as reference.
[in] | pObj | The pointer to the object to be referenced. |
int glo::TOndemand< T >::set | ( | const T * | rObj | ) |
Adopts the object ID of the passed object as reference.
[in] | pObj | The pointer to the object to be referenced. |
|
overridevirtual |
Adopts the object ID as reference.
[in] | rObjID | The object ID to be referenced. |
Reimplemented from glo::Reference.