A reference (as attribute) of a persistent object to another persistent object in the database.
More...
|
| 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 | set (const T *pObj) |
|
int | set (const T &rObj) |
|
int | set (const std::shared_ptr< T > &spObj) |
|
int | get (T *&prObj) |
|
int | get (std::shared_ptr< T > &rRetVal) |
|
virtual int | setReference (const ObjID &rObjID) override |
|
|
TOndemand< T > & | operator= (const TOndemand &rT) |
| Assignment operator.
|
|
TOndemand< T > & | operator= (const Reference &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 > &sprRetVal) |
|
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.
|
|
template<class T>
class glo::TOndemand< T >
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.
- Copyright
- © 2010 Helmut Jakoby
- Author
- Helmut Jakoby