GlobalObjects
Loading...
Searching...
No Matches
glo::PointerSet Class Reference

Is the base class of a template set. The persistent objects are managed in a std::set.
Objects can be inserted only once. More...

#include <GloPointerSet.h>

Inheritance diagram for glo::PointerSet:

Public Member Functions

 PointerSet ()
 
 PointerSet (Base &rBase)
 
virtual ~PointerSet ()
 
virtual void clear ()
 
virtual int getPers (BasePersistent *&prRetVal, EnSeekMode eMode)
 
virtual int getPersistent (BasePersistent *&prRetVal, const ObjID &rObjID)
 
virtual int insertPers (BasePersistent *pNewObj)
 
virtual int removePers (BasePersistent *pObject)
 
std::set< BasePersistent * > & Set ()
 
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.
 
- Public Member Functions inherited from glo::PointerLot
 PointerLot ()
 
 PointerLot (Base &rBase)
 
virtual ~PointerLot ()
 
virtual int getObjID (ObjID &rObjID, EnSeekMode eMode)
 
- Public Member Functions inherited from glo::BaseLot
 BaseLot ()
 
 BaseLot (Base &rBase)
 
virtual ~BaseLot ()
 
virtual int getPers (std::shared_ptr< BasePersistent > &rRetVal, EnSeekMode eMode)
 
virtual int getTypeAsString (std::string &rsTypeName) override
 
virtual int insertPers (std::shared_ptr< BasePersistent > spNewObj)
 
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)
 
- Public Member Functions inherited from glo::AbstractBaseLot
 AbstractBaseLot ()
 
virtual ~AbstractBaseLot ()
 
virtual int getPersistent (std::shared_ptr< BasePersistent > &rRetVal, const ObjID &rObjID)
 
virtual int setCurrentObject (const BasePersistent &rObject)
 
- Public Member Functions inherited from glo::CallBack
 CallBack ()
 
 CallBack (Base &rBase)
 
virtual ~CallBack ()
 
BasegetBase () const
 
virtual void notify (NotifyNote &rNote)
 
CallBackoperator= (const CallBack &rT)
 
virtual void setBase (Base *pBase)
 
bool operator== (const CallBack &rT) const
 Comparison operator, all attributes are compared.
 
bool operator!= (const CallBack &rT) const
 Comparison operator, all attributes are compared.
 

Private Member Functions

 PointerSet (const PointerSet &)
 
PointerSetoperator= (const PointerSet &)
 
virtual int appendPers (BasePersistent *)
 Is not available for a set.
 
virtual int appendPers (std::shared_ptr< BasePersistent >)
 Is not available for a set.
 
virtual int insertPersBefore (BasePersistent *, const BasePersistent *)
 Is not available for a set.
 
virtual int insertPersBefore (std::shared_ptr< BasePersistent >, const std::shared_ptr< BasePersistent >)
 Is not available for a set.
 

Private Attributes

std::set< BasePersistent * > m_poObjSet
 
std::set< BasePersistent * >::iterator m_poObjSetIterator
 

Additional Inherited Members

- Public Attributes inherited from glo::CallBack
std::string m_strDebugInfo
 
- Protected Member Functions inherited from glo::BaseLot
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)
 
- Protected Member Functions inherited from glo::CallBack
 CallBack (const CallBack &rT)
 
- Protected Attributes inherited from glo::BaseLot
unsigned long m_ulClassID
 

Detailed Description

Is the base class of a template set. The persistent objects are managed in a std::set.
Objects can be inserted only once.

Author
Helmut Jakoby

Constructor & Destructor Documentation

◆ PointerSet() [1/3]

glo::PointerSet::PointerSet ( )

Standard constructor.

◆ PointerSet() [2/3]

glo::PointerSet::PointerSet ( Base & rBase)

Constructor with parameter passing.

Parameters
[in]rBaseThe database in which the persistent objects are stored.

◆ ~PointerSet()

virtual glo::PointerSet::~PointerSet ( )
virtual

Destructor, for all objects in the object set the set-specific lock and watch mode is cancelled, the reference counter is decremented by calling GloBasePersisten::forget() and then the object set is cleared.

◆ PointerSet() [3/3]

glo::PointerSet::PointerSet ( const PointerSet & )
private

The copy constructor is not available.

Member Function Documentation

◆ appendPers() [1/2]

virtual int glo::PointerSet::appendPers ( BasePersistent * )
inlineprivatevirtual

Is not available for a set.

Reimplemented from glo::BaseLot.

◆ appendPers() [2/2]

virtual int glo::PointerSet::appendPers ( std::shared_ptr< BasePersistent > )
inlineprivatevirtual

Is not available for a set.

Reimplemented from glo::BaseLot.

◆ clear()

virtual void glo::PointerSet::clear ( )
virtual

All objects are removed from the set. The set-specific lock and watching mode is removed for all objects in the set.

Implements glo::BaseLot.

◆ getAllClassIDs()

virtual void glo::PointerSet::getAllClassIDs ( std::list< ObjID > & rAllClassIDs) const
virtual

See description in superclass.

◆ getPers()

virtual int glo::PointerSet::getPers ( BasePersistent *& prRetVal,
EnSeekMode eMode )
virtual

Returns an object from the set in relation to eMode.

Parameters
[in,out]prRetValIf no error, the fetched object.
[in]eModeThe seek mode.

Parameter examples:

Returns
A return < 0 indicates an error. A return == ERR_RANGE indicates the end of the AllSet.
Attention
If prRetVal is valid, this object must be removed from memory by the calling instance.

Implements glo::PointerLot.

◆ getPersistent()

virtual int glo::PointerSet::getPersistent ( BasePersistent *& prRetVal,
const ObjID & rObjID )
virtual

Returns an object with passed object ID from the container.

Parameters
[in,out]prRetValIf no error, the fetched object.
[in]rObjIDThe object ID.
Returns
A return value < 0 indicates an error.
Attention
If prRetVal is valid, this object must be removed from memory by the calling instance using BasePersistent::forget().

Implements glo::AbstractBaseLot.

◆ inLot() [1/3]

virtual bool glo::PointerSet::inLot ( const BasePersistent & object) const
virtual

See description in superclass.

Reimplemented from glo::PointerLot.

◆ inLot() [2/3]

virtual bool glo::PointerSet::inLot ( const ObjID & object) const
virtual

See description in superclass.

Implements glo::PointerLot.

◆ inLot() [3/3]

virtual bool glo::PointerSet::inLot ( const std::shared_ptr< BasePersistent > object) const
virtual

See description in superclass.

Reimplemented from glo::PointerLot.

◆ insertPers()

virtual int glo::PointerSet::insertPers ( BasePersistent * pNewObj)
virtual

Inserts a 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.

Parameters
[in]pNewObjThe persistent object to be inserted. If no error, the linkcounter is incremented by pNewObj.
Returns
A return value < 0 indicates an error.
Attention
The internal iterator m_poObjSetIterator points to the inserted element if the insertion is successful.

Reimplemented from glo::BaseLot.

◆ insertPersBefore() [1/2]

virtual int glo::PointerSet::insertPersBefore ( BasePersistent * ,
const BasePersistent *  )
inlineprivatevirtual

Is not available for a set.

Reimplemented from glo::PointerLot.

◆ insertPersBefore() [2/2]

virtual int glo::PointerSet::insertPersBefore ( std::shared_ptr< BasePersistent > ,
const std::shared_ptr< BasePersistent >  )
inlineprivatevirtual

Is not available for a set.

Reimplemented from glo::BaseLot.

◆ operator=()

PointerSet & glo::PointerSet::operator= ( const PointerSet & )
inlineprivate

The assignment operator is not available.

◆ removePers()

virtual int glo::PointerSet::removePers ( BasePersistent * pObject)
virtual

Removes 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.

Parameters
[in]pObjectThe persistent object to be removed. The linkcounter of pObj is decremented, if in Set.
Returns
A return value < 0 indicates an error.
Attention
The internal iterator m_poObjSetIterator points to the element following the removed one if the deletion was successful. If there is no subsequent element, the internal iterator m_poObjSetIterator points to the container end.

Implements glo::PointerLot.

◆ Set()

std::set< BasePersistent * > & glo::PointerSet::Set ( )

Returns the reference to the internal object set.

Attention
This possibility of access should only be limited to accessing the objects with another iterator. Adding or removing objects can cause undefined behavior.

◆ setCurrentObject()

virtual int glo::PointerSet::setCurrentObject ( const ObjID & rObjID)
virtual

Sets the internal iterator to the position of the object with passed object ID.

Parameters
[in]rObjIDThe object ID.
Returns
A return value < 0 indicates an error.

Implements glo::AbstractBaseLot.

◆ setPosition()

virtual int glo::PointerSet::setPosition ( std::size_t nPosition)
virtual

Sets the internal iterator to the passed position.

Parameters
[in]nPositionThe position to be set.
Returns
A return value < 0 indicates an error.

Implements glo::AbstractBaseLot.

◆ size()

virtual std::size_t glo::PointerSet::size ( ) const
virtual

Returns the number of objects in the container.

Returns
The number or a return value < 0 indicates an error.

Implements glo::AbstractBaseLot.

Member Data Documentation

◆ m_poObjSet

std::set<BasePersistent *> glo::PointerSet::m_poObjSet
private

The set of pointers to objects of type BasePersistent.

◆ m_poObjSetIterator

std::set<BasePersistent*>::iterator glo::PointerSet::m_poObjSetIterator
private

An object-internal iterator to the set of pointers to objects of type BasePersistent.


The documentation for this class was generated from the following file: