A reference (as attribute) of a persistent object to another persistent object in the database.
More...
|
| TOndemand () |
|
| TOndemand (Base &rBase) |
|
| TOndemand (const ObjID &rObjID) |
|
| TOndemand (const ObjID &rObjID, Base &rBase) |
|
| TOndemand (const ObjID &rObjID, unsigned long ulDatabaseID) |
|
| TOndemand (const TOndemand &rT) |
|
| TOndemand (unsigned long ulDatabaseID) |
|
virtual | ~TOndemand () |
|
int | get (std::shared_ptr< T > &rRetVal) |
|
int | get (T *&prObj) |
|
int | set (const std::shared_ptr< T > &spObj) |
|
int | set (const T &rObj) |
|
int | set (const T *pObj) |
|
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 (Base &rBase) |
|
| Reference (const ObjID &rObjID) |
|
| Reference (const ObjID &rObjID, Base &rBase) |
|
| Reference (const ObjID &rObjID, unsigned long ulDatabaseID) |
|
| Reference (const Reference &rT) |
|
| Reference (unsigned long ulDatabaseID) |
|
virtual | ~Reference () |
|
virtual int | deleteInBase (EnDeepMode eDeepMode=DM_SHALLOW) |
|
virtual Base * | getBase () const override |
|
ObjID | getObjID () const |
|
const ObjID * | getObjIDAsPointer () const |
|
int | getReference (BasePersistent *&prRetVal) |
|
int | getReference (std::shared_ptr< BasePersistent > &sprRetVal) |
|
virtual int | getTypeAsString (std::string &rsTypeName) override |
|
virtual int | isLocked (const LockSpecification &rLockSpecification) const |
|
virtual int | isLocked (EnLockMode eLockMode=LK_DELETEvWRITE, EnDeepMode eDeepMode=DM_SHALLOW) const |
|
bool | isNULL () 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 | lock (const LockSpecification &rLockSpecification) const |
|
virtual int | lock (EnLockMode eLockMode=LK_DELETEvWRITE, EnDeepMode eDeepMode=DM_SHALLOW) const |
|
Reference & | operator= (const Reference &rT) |
|
virtual int | setBase (Base *pBase) override |
|
void | setNULL () |
|
int | setReference (const BasePersistent &rObj) |
|
int | setReference (const BasePersistent *pObj) |
|
virtual int | setWatch (const WatchSpecification &rWatchSpec) const |
|
virtual int | setWatch (TdWatchNotifyMode ulWatchMode, EnDeepMode eDeepMode, CallBack *pCallBack=0) const |
|
virtual int | unlock (const LockSpecification &rLockSpecification) const |
|
virtual int | unlock (EnLockMode eLockMode=LK_DELETEvWRITE, EnDeepMode eDeepMode=DM_SHALLOW) const |
|
virtual int | unsetWatch (const WatchSpecification &rWatchSpec) const |
|
virtual int | unsetWatch (TdWatchNotifyMode ulWatchMode, EnDeepMode eDeepMode, CallBack *pCallBack) const |
|
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