A type-safe list of pointers to persistent objects in the database (intended as an attribute for persistent objects). More...
#include <GloTPointerList.h>
Public Member Functions | |
TPointerList () | |
TPointerList (Base &rBase) | |
virtual | ~TPointerList () |
virtual int | append (std::shared_ptr< T > spNewObj) |
virtual int | append (T *pNewObj) |
virtual int | get (std::shared_ptr< T > &rRetVal, EnSeekMode eMode) |
virtual int | get (T *&prRetVal, EnSeekMode eMode) |
virtual int | getTypeAsString (std::string &rsTypeName) override |
virtual int | insert (std::shared_ptr< T > spNewObj) |
virtual int | insert (T *pNewObj) |
virtual int | insertBefore (std::shared_ptr< T > spNewObj, const std::shared_ptr< T > spObject) |
virtual int | insertBefore (T *pNewObj, const T *pObject) |
virtual int | remove (std::shared_ptr< T > spObject) |
virtual int | remove (T *pObject) |
![]() | |
PointerList () | |
PointerList (Base &rBase) | |
virtual | ~PointerList () |
virtual int | appendPers (BasePersistent *pNewObj) |
virtual void | clear () |
virtual int | getPers (BasePersistent *&prRetVal, EnSeekMode eMode) |
virtual int | getPersistent (BasePersistent *&prRetVal, const ObjID &rObjID) |
virtual int | insertPers (BasePersistent *pNewObj) |
std::list< BasePersistent * > & | List () |
virtual int | removePers (BasePersistent *pObject) |
virtual int | setCurrentObject (const ObjID &rObjID) |
virtual int | setPosition (std::size_t nPosition) |
virtual std::size_t | size () const |
virtual void | getAllClassIDs (std::list< ObjID > &rAllClassIDs) const |
See description in superclass. | |
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. | |
![]() | |
PointerLot () | |
PointerLot (Base &rBase) | |
virtual | ~PointerLot () |
virtual Base * | getBase () const override |
virtual int | getObjID (ObjID &rObjID, EnSeekMode eMode) override |
virtual int | insertPersBefore (BasePersistent *pNewObj, const BasePersistent *pObject) override |
virtual int | setBase (Base *pBase) override |
![]() | |
BaseLot () | |
virtual | ~BaseLot () |
virtual int | appendPers (std::shared_ptr< BasePersistent > spNewObj) |
virtual int | getPers (std::shared_ptr< BasePersistent > &rRetVal, EnSeekMode eMode) |
virtual int | insertPers (std::shared_ptr< BasePersistent > spNewObj) |
virtual int | insertPersBefore (std::shared_ptr< BasePersistent > spNewObj, const std::shared_ptr< BasePersistent > spObject) |
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 | |
TPointerList (const TPointerList &) | |
TPointerList< T > & | operator= (const TPointerList &) |
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 () |
![]() | |
unsigned long | m_ulClassID |
A type-safe list of pointers to persistent objects in the database (intended as an attribute for persistent objects).
Objects can also be inserted multiple times and in any order.
When a persistent object with an attribute of type TPointerList is loaded from the database into memory, the objects contained in the TPointerList are automatically loaded into memory.
This class ensures that the method Persistent::forget() of the contained objects is called when the object is destroyed.
When an object is delivered, the method Persistent::remember() is called.
glo::TPointerList< T >::TPointerList | ( | ) |
Standard constructor.
References glo::CallBack::m_strDebugInfo, and SUPER.
Referenced by TPointerList(), and operator=().
glo::TPointerList< T >::TPointerList | ( | 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 TPointerList().
|
virtual |
Appends a persistent object to the end of the list.
If the list is locked, the object to be inserted is locked with the lock mode of the list.
If the list is monitored, the object to be inserted is also monitored with the monitoring mode of the list.
[in] | spNewObj | The persistent object to be inserted in a std::shared_ptr. |
|
virtual |
Appends a persistent object to the end of the list.
If the list is locked, the object to be inserted is locked with the lock mode of the list.
If the list is monitored, the object to be inserted is also monitored with the monitoring mode of the list.
[in] | pNewObj | The persistent object to be inserted. If no error, the linkcounter is incremented by pNewObj. |
|
virtual |
Returns an object from the list in relation to eMode.
[in,out] | rRetVal | If no error, the fetched object in a std::shared_ptr. |
[in] | eMode | The seek mode. |
Parameter examples:
References get().
|
virtual |
Returns an object from the list in relation to eMode.
[in,out] | prRetVal | If no error, the fetched object. |
[in] | eMode | The seek mode. |
Parameter examples:
Referenced by get().
|
inlinestatic |
Returns the template class ID.
|
overridevirtual |
Returns the type of the template list, 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 list behind the current position.
If the list is locked, the object to be inserted is locked with the lock mode of the list.
If the list is monitored, the object to be inserted is also monitored with the monitoring mode of the list.
[in] | spNewObj | The persistent object to be inserted in a std::shared_ptr. |
|
virtual |
Inserts the passed persistent object into the list behind the current position.
If the list is locked, the object to be inserted is locked with the lock mode of the list.
If the list is monitored, the object to be inserted is also monitored with the monitoring mode of the list.
[in] | pNewObj | The persistent object to be inserted. If no error, the linkcounter is incremented by pNewObj. |
|
virtual |
Inserts a persistent object before another object in the list.
If the list is locked, the object to be inserted is locked with the lock mode of the list.
If the list is monitored, the object to be inserted is also monitored with the monitoring mode of the list.
[in] | spNewObj | The persistent object to be inserted in a std::shared_ptr. |
[in] | spObject | The subsequent persistent object. |
|
virtual |
Inserts a persistent object before another object in the list.
If the list is locked, the object to be inserted is locked with the lock mode of the list.
If the list is monitored, the object to be inserted is also monitored with the monitoring mode of the list.
[in] | pNewObj | The persistent object to be inserted. If no error, the linkcounter is incremented by pNewObj. |
[in] | pObject | The subsequent persistent object. |
|
private |
The assignment operator is not available.
References TPointerList().
|
virtual |
Removes the passed persistent object from the list.
If the list is locked, the object to be removed is released with the lock mode of the list.
If the list is monitored, the monitoring of the object to be removed is ended with the monitoring mode of the list.
[in] | spObject | The persistent object to be removed in a std::shared_ptr. |
|
virtual |
Removes the passed persistent object from the list.
If the list is locked, the object to be removed is released with the lock mode of the list.
If the list is monitored, the monitoring of the object to be removed is ended with the monitoring mode of the list.
[in] | pObject | The persistent object to be removed. The linkcounter of pObj is decremented, if in list. |