A type-safe set of references to persistent objects in the database (intended as an attribute for persistent objects).
Objects can be inserted only once.
More...
#include <GloTOndemandSet.h>
Public Member Functions | |
TOndemandSet () | |
TOndemandSet (Base &rBase) | |
virtual | ~TOndemandSet () |
virtual int | get (glo::ObjID &rObjID, T *&prRetVal, EnSeekMode eMode) |
virtual int | get (std::shared_ptr< T > &rRetVal, const ObjID &rObjID) |
virtual int | get (T *&prRetVal, const ObjID &rObjID) |
virtual int | get (T *&prRetVal, EnSeekMode eMode) |
virtual int | getTypeAsString (std::string &rsTypeName) override |
virtual int | insert (T *NewObj) |
Inserts the passed persistent object into the set. | |
virtual int | insert (std::shared_ptr< T > NewObj) |
Inserts the passed persistent object into the set. | |
virtual int | remove (T *Object) |
Removes the passed persistent object from the set. | |
virtual int | remove (std::shared_ptr< T > Object) |
Removes the passed persistent object from the set. | |
virtual int | get (std::shared_ptr< T > &rRetVal, EnSeekMode eMode) |
Returns an object from the set in relation to eMode. | |
virtual int | get (TOndemand< T > &rRetVal, EnSeekMode eMode) |
Returns an object from the set in relation to eMode. | |
virtual int | get (glo::ObjID &rObjID, std::shared_ptr< T > &rRetVal, EnSeekMode eMode) |
Returns an object ID and if possible a object from the container of the database in relation to eMode. | |
virtual int | get (glo::ObjID &rObjID, TOndemand< T > &rRetVal, EnSeekMode eMode) |
Returns an object ID and if possible a object from the container of the database in relation to eMode. | |
![]() | |
OndemandSet () | |
OndemandSet (Base &rBase) | |
virtual | ~OndemandSet () |
virtual void | clear () |
virtual Reference * | getOndemand (EnSeekMode eMode) |
virtual int | getPersistent (BasePersistent *&prRetVal, const ObjID &rObjID) |
virtual int | insertOndemand (const Reference &rNewOndemand) |
virtual int | insertPers (BasePersistent *pNewObj) |
virtual int | insertPers (std::shared_ptr< BasePersistent > spNewObj) |
virtual int | removeOndemand (const Reference &rOndemand) |
virtual int | setCurrentObject (const ObjID &rObjID) |
virtual int | setPosition (std::size_t nPosition) |
virtual std::size_t | size () const |
virtual bool | inLot (const ObjID &object) const |
See description in superclass. | |
virtual bool | inLot (const BasePersistent &object) const |
See description in superclass. | |
virtual bool | inLot (const std::shared_ptr< BasePersistent > object) const |
See description in superclass. | |
virtual bool | inLot (const Reference &object) const |
See description in superclass. | |
![]() | |
OndemandLot () | |
OndemandLot (Base &rBase) | |
virtual | ~OndemandLot () |
virtual Base * | getBase () const override |
virtual int | getObjID (ObjID &rObjID, EnSeekMode eMode) override |
virtual int | getPers (BasePersistent *&prRetVal, EnSeekMode eMode) override |
virtual int | getPers (glo::ObjID &rObjID, BasePersistent *&prRetVal, EnSeekMode eMode) |
virtual int | getPers (glo::ObjID &rObjID, std::shared_ptr< BasePersistent > &rRetVal, EnSeekMode eMode) |
virtual int | getPers (std::shared_ptr< BasePersistent > &rRetVal, EnSeekMode eMode) override |
std::list< Reference * > & | List () |
virtual int | removePers (BasePersistent *pObject) override |
virtual int | setBase (Base *pBase) override |
![]() | |
BaseLot () | |
virtual | ~BaseLot () |
virtual int | lock (const LockSpecification &rLockSpecification) |
virtual int | lock (EnLockMode eLockMode=LK_DELETEvWRITE, EnDeepMode eDeepMode=DM_SHALLOW) |
virtual int | removePers (std::shared_ptr< BasePersistent > spObject) |
virtual int | setWatch (const WatchSpecification &rWatchSpec) |
virtual int | setWatch (TdWatchNotifyMode ulWatchMode, EnDeepMode eDeepMode, CallBack *pCallBack=0) |
virtual int | unlock (const LockSpecification &rLockSpecification) |
virtual int | unlock (EnLockMode eLockMode=LK_DELETEvWRITE, EnDeepMode eDeepMode=DM_SHALLOW) |
virtual int | unsetWatch (const WatchSpecification &rWatchSpec) |
virtual int | unsetWatch (TdWatchNotifyMode ulWatchMode, EnDeepMode eDeepMode, CallBack *pCallBack=0) |
![]() | |
AbstractBaseLot () | |
virtual | ~AbstractBaseLot () |
virtual int | getPersistent (std::shared_ptr< BasePersistent > &rRetVal, const ObjID &rObjID) |
virtual int | setCurrentObject (const BasePersistent &rObject) |
![]() | |
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 () |
Private Member Functions | |
TOndemandSet (const TOndemandSet &) | |
TOndemandSet< T > & | operator= (const TOndemandSet &) |
Additional Inherited Members | |
![]() | |
std::string | m_strDebugInfo |
![]() | |
int | lockObjID (const ObjID &rObjID) |
int | setWatchObjID (const ObjID &rObjID) |
int | takeOverBase (const BasePersistent *pObj) |
int | takeOverBase (const Reference *pRef) |
int | unlockObjID (const ObjID &rObjID) |
int | unsetWatchObjID (const ObjID &rObjID) |
![]() | |
CallBack (const CallBack &rT) | |
void | deinit () |
void | init () |
![]() | |
std::list< Reference * > | m_odRefList |
std::list< Reference * >::iterator | m_odRefListIterator |
unsigned long | m_ulDatabaseID |
![]() | |
unsigned long | m_ulClassID |
A type-safe set of references to persistent objects in the database (intended as an attribute for persistent objects).
Objects can be inserted only once.
In contrast to a TPointerSet (where the referenced objects are automatically 'loaded'), the TOndemandSet is a set of references; the referenced objects are not loaded from the database with the referencing object, but can be 'reloaded' if required.
It is always useful if an object is to reference several 'large' objects that do not have to be available.
If objects in one object database are to reference multiple objects in another object database, this is only possible with glo::TOndemandList or glo::TOndemandSet.
glo::TOndemandSet< T >::TOndemandSet | ( | ) |
Standard constructor.
References glo::CallBack::m_strDebugInfo, and SUPER.
Referenced by TOndemandSet(), and operator=().
glo::TOndemandSet< T >::TOndemandSet | ( | Base & | rBase | ) |
Constructor with parameter passing.
[in] | rBase | The database is passed. |
References glo::CallBack::m_strDebugInfo, and SUPER.
|
virtual |
Destructor, for all objects in the object set the own lock and watch mode is cancelled and then the object set is emptied.
|
private |
The copy constructor is not available.
References TOndemandSet().
|
virtual |
Returns an object ID and if possible a object from the container of the database in relation to eMode.
This also makes it possible to iterate over objects that cannot be read (only the object ID is then returned).
[in,out] | rObjID | The object ID. |
[in,out] | rRetVal | If no error, the fetched object in a std::shared_ptr. |
[in] | eMode | The seek mode. |
References get().
|
virtual |
Returns an object ID and if possible a object from the container of the database in relation to eMode. This also makes it possible to iterate over objects that cannot be read (only the object ID is then returned).
[in,out] | rObjID | The object ID. |
[in,out] | prRetVal | If no error, the fetched object. |
[in] | eMode | The seek mode. |
|
virtual |
Returns an object ID and if possible a object from the container of the database in relation to eMode.
This also makes it possible to iterate over objects that cannot be read (only the object ID is then returned).
[in,out] | rObjID | The object ID. |
[in,out] | rRetVal | If no error, the fetched object in a std::shared_ptr. |
[in] | eMode | The seek mode. |
References get(), and glo::TOndemand< T >::set().
|
virtual |
Returns an object with passed object ID from the container.
[in,out] | rRetVal | If no error, the fetched object. |
[in] | rObjID | The object ID. |
References get().
|
virtual |
Returns an object from the set in relation to eMode.
[in,out] | rRetVal | If no error, the fetched object in a std::shared_ptr. |
[in] | eMode | The seek mode. |
References get().
|
virtual |
Returns an object with passed object ID from the container.
[in,out] | prRetVal | If no error, the fetched object. |
[in] | rObjID | The object ID. |
|
virtual |
Returns an object from the set in relation to eMode.
[in,out] | prRetVal | If no error, the fetched object. |
[in] | eMode | The seek mode. |
|
virtual |
Returns an object from the set in relation to eMode.
[in,out] | rRetVal | If no error, the fetched object in a std::shared_ptr. |
[in] | eMode | The seek mode. |
References get(), and glo::TOndemand< T >::set().
|
inlinestatic |
Returns the template class ID.
|
overridevirtual |
Returns the type of the template set, i.e. the class name as string when connected to the database.
[in,out] | rsTypeName | The type name. |
Reimplemented from glo::BaseLot.
|
virtual |
Inserts the passed persistent object into the set.
If the set is locked, the object to be inserted is locked with the lock mode of the set.
If the set is monitored, the object to be inserted is also monitored with the monitoring mode of the set.
[in] | NewObj | The persistent object to be inserted. |
|
virtual |
Inserts the passed persistent object into the set.
If the set is locked, the object to be inserted is locked with the lock mode of the set.
If the set is monitored, the object to be inserted is also monitored with the monitoring mode of the set.
[in] | NewObj | The persistent object to be inserted. |
|
private |
The assignment operator is not available.
References TOndemandSet().
|
virtual |
Removes the passed persistent object from the set.
If the set is locked, the object to be removed is released with the lock mode of the set.
If the set is monitored, the monitoring of the object to be removed is ended with the monitoring mode of the set.
[in] | Object | The persistent object to be removed. |
|
virtual |
Removes the passed persistent object from the set.
If the set is locked, the object to be removed is released with the lock mode of the set.
If the set is monitored, the monitoring of the object to be removed is ended with the monitoring mode of the set.
[in] | Object | The persistent object to be removed. |