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

AllSet, which returns generic objects. More...

#include <GloGenericAllSet.h>

Inheritance diagram for glo::GenericAllSet:

Public Member Functions

 GenericAllSet ()
 
 GenericAllSet (Base &rBase)
 
 GenericAllSet (Base &rBase, unsigned long ulClassID, bool bWithSubClasses=true)
 
 GenericAllSet (Base &rBase, unsigned long ulClassID, const std::string &rsFullIndexName)
 
virtual ~GenericAllSet ()
 
int get (GenericPersistent *&prRetVal, EnSeekMode eMode)
 
int get (ObjID &rObjID, GenericPersistent *&prRetVal, EnSeekMode eMode)
 
int get (ObjID &rObjID, std::shared_ptr< GenericPersistent > &rRetVal, EnSeekMode eMode)
 
int get (std::shared_ptr< GenericPersistent > &rRetVal, const ObjID &rObjID)
 
int get (std::shared_ptr< GenericPersistent > &rRetVal, EnSeekMode eMode)
 
virtual void setClassID (unsigned long ulClassID)
 
virtual int setWatch (TdWatchNotifyMode ulWatchMode, CallBack *pCallBack=0)
 
virtual int unsetWatch (TdWatchNotifyMode ulWatchMode, CallBack *pCallBack=0)
 
virtual int getPersistent (BasePersistent *&prRetVal, const ObjID &rObjID)
 Returns an object from the AllSet of the database with passed object ID.
 
int get (GenericPersistent *&prRetVal, const ObjID &rObjID)
 Returns an object from the AllSet of the database with passed object ID.
 
- Public Member Functions inherited from glo::BaseAllSet
 BaseAllSet ()
 
 BaseAllSet (Base &rBase)
 
 BaseAllSet (Base &rBase, unsigned long ulClassID, bool bWithSubClasses=true)
 
 BaseAllSet (Base &rBase, unsigned long ulClassID, const std::string &rsFullIndexName)
 
virtual ~BaseAllSet ()
 
int close ()
 
std::vector< AllSetIndexInfogetAvailableIndices ()
 
std::size_t getAvailableIndicesSize ()
 
unsigned long getClassID () const
 
std::string getFullIndexName () const
 
unsigned long getIndexClassID () const
 
int getIndexedObjIds (std::list< ObjID > &rObjIDList, const std::string &rsIndexName, const std::string &rsIndexSearchValue, EnComparisionOp eComparisionOp)
 
int getIndexedObjIds (std::list< ObjID > &rObjIDList, const std::string &rsIndexName, const std::string &rsIndexSearchValue, EnQueryType eQuerryType)
 
int getIndexedObjIds (std::list< ObjID > &rObjIDList, const std::string &rsIndexName, const std::string &rsRangeStartIndexSearchValue, const std::string &rsRangeEndIndexSearchValue)
 
int getIndexedObjIds (std::list< ObjID > &rObjIDList, const std::string &rsIndexName, unsigned long ulIndexClassID, const std::string &rsIndexSearchValue, EnComparisionOp eComparisionOp)
 
int getIndexedObjIds (std::list< ObjID > &rObjIDList, const std::string &rsIndexName, unsigned long ulIndexClassID, const std::string &rsIndexSearchValue, EnQueryType eQuerryType)
 
int getIndexedObjIds (std::list< ObjID > &rObjIDList, const std::string &rsIndexName, unsigned long ulIndexClassID, const std::string &rsRangeStartIndexSearchValue, const std::string &rsRangeEndIndexSearchValue)
 
int getIndexedObjIds (std::list< ObjID > &rObjIDList, const std::string &rsIndexSearchValue, EnComparisionOp eComparisionOp)
 
int getIndexedObjIds (std::list< ObjID > &rObjIDList, const std::string &rsIndexSearchValue, EnQueryType eQuerryType)
 
int getIndexedObjIds (std::list< ObjID > &rObjIDList, const std::string &rsRangeStartIndexSearchValue, const std::string &rsRangeEndIndexSearchValue)
 
std::string getIndexName () const
 
int getObjID (ObjID &rObjID, EnSeekMode eMode)
 
virtual int getTypeAsString (std::string &rsTypeName) override
 
virtual bool inLot (const ObjID &rObjID) const override
 
virtual bool inSet (const ObjID &rObjID) const
 
bool isIndexAvailable (const BaseAllSet::IndexNameClassIdTuple &rIndexNameClassIdTuple)
 
bool isIndexAvailable (const std::string &rsFullIndexName)
 
bool isIndexAvailable (unsigned long ulClassID, const std::string &rsIndexName)
 
int open ()
 
bool readWithSubClasses () const
 
int removeIndexFilter ()
 
virtual void setBase (Base &rBase)
 
virtual void setBase (Base *pBase) override
 
virtual int setCurrentObject (const ObjID &rObjID) override
 
int setFullIndexName (const std::string &rsFullIndexName)
 
int setIndex (const BaseAllSet::IndexNameClassIdTuple &rIndexNameClassIdTuple)
 
int setIndexFilter (const std::string &rsIndexFilter)
 
int setIndexFilter (const std::string &rsIndexFilter, EnComparisionOp eComparisionOp)
 
int setIndexFilter (const std::string &rsRangeStartIndexFilter, const std::string &rsRangeEndIndexFilter)
 
virtual int setPosition (std::size_t nPosition) override
 
void setReadWithSubClasses (bool bWithSubClasses)
 
virtual std::size_t size () const override
 
- 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)
 
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

 GenericAllSet (const GenericAllSet &)
 
GenericAllSetoperator= (const GenericAllSet &)
 

Additional Inherited Members

- Public Attributes inherited from glo::CallBack
std::string m_strDebugInfo
 
- Protected Member Functions inherited from glo::BaseAllSet
void setAllSetOpen (bool bOpen)
 
int setAvailableIndices ()
 
void setClassIDFromTemplate (unsigned long ulClassID)
 
- Protected Member Functions inherited from glo::CallBack
 CallBack (const CallBack &rT)
 

Detailed Description

AllSet, which returns generic objects.

AllSets contains all instances of an object type in the database.

When an object of this class is instantiated and opened (only works with a valid database), the Manager creates an iterator that allows iteration through the internal AllSet. In the destructor the Manager is notified, which destroys the iterator again.

Attention
This means that a GenericAllSet must always be removed from memory before the Base.
Author
Helmut Jakoby

Constructor & Destructor Documentation

◆ GenericAllSet() [1/5]

glo::GenericAllSet::GenericAllSet ( )

Standard constructor.

◆ GenericAllSet() [2/5]

glo::GenericAllSet::GenericAllSet ( Base & rBase)

Constructor with parameter passing.

Parameters
[in]rBaseThe authoritative database is passed.
Exceptions
eut::ErrorNExceptionAn exception is thrown if an error occurs.

◆ GenericAllSet() [3/5]

glo::GenericAllSet::GenericAllSet ( Base & rBase,
unsigned long ulClassID,
bool bWithSubClasses = true )

Constructor with parameter passing.

Parameters
[in]rBaseThe authoritative database is passed.
[in]ulClassIDA generic AllSet must know which object type is involved. This is guaranteed by the class ID from the schema.
[in]bWithSubClassesIf false, only objects with the class ID from m_ulClassID without subclasses are considered.
Exceptions
eut::ErrorNExceptionAn exception is thrown if an error occurs.
eut::ErrorNExceptionBei einem Fehler wird eine Exception geworfen.

◆ GenericAllSet() [4/5]

glo::GenericAllSet::GenericAllSet ( Base & rBase,
unsigned long ulClassID,
const std::string & rsFullIndexName )

Constructor with parameter passing.

Parameters
[in]rBaseThe authoritative database is passed.
[in]ulClassIDThe class ID.
[in]rsFullIndexNameAn AllSet can be sorted by an index. The index name must be passed preceded by the full class name (e.g. "mynamespace::MyClassName.IndexName").
Exceptions
eut::ErrorNExceptionAn exception is thrown if an error occurs.

◆ ~GenericAllSet()

virtual glo::GenericAllSet::~GenericAllSet ( )
virtual

Destructor.

◆ GenericAllSet() [5/5]

glo::GenericAllSet::GenericAllSet ( const GenericAllSet & )
private

The copy constructor is not available.

Member Function Documentation

◆ get() [1/6]

int glo::GenericAllSet::get ( GenericPersistent *& prRetVal,
const ObjID & rObjID )

Returns an object from the AllSet of the database with passed object ID.

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 GenericPersistent::forget().
Note
It is recommended, if possible, to consider using std::shared_ptr and to use the method get(std::shared_ptr<GenericPersistent>&, const ObjID&) bzw.

◆ get() [2/6]

int glo::GenericAllSet::get ( GenericPersistent *& prRetVal,
EnSeekMode eMode )

Returns a generic object from the AllSet of the referenced database in relation to eMode.

Parameters
[in,out]prRetValThe object if found.
[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 using GenericPersistent::forget().
Note
It is recommended, if possible, to consider using std::shared_ptr and to use the method get(std::shared_ptr<GenericPersistent>&, EnSeekMode)

◆ get() [3/6]

int glo::GenericAllSet::get ( ObjID & rObjID,
GenericPersistent *& prRetVal,
EnSeekMode eMode )

Returns an object ID and if possible a generic object from the AllSet of the database in relation to eMode. This also allows iteration over read-locked objects (only the object ID is returned).

Parameters
[in,out]rObjIDThe object ID.
[in,out]prRetValThe object, if found.
[in]eModeThe seek mode.

Parameter examples:

Returns
A return value < 0 indicates an error. A return == ERR_RANGE indicates the end of the AllSet. If you return == ERR_OBJECT_LOCKED, no object is returned but the object ID of the locked object is.
Attention
If prRetVal is valid, this object must be removed from memory by the calling instance using GenericPersistent::forget().
Note
It is recommended, if possible, to consider using std::shared_ptr and to use the method get(ObjID&, std::shared_ptr<GenericPersistent>&, EnSeekMode)

◆ get() [4/6]

int glo::GenericAllSet::get ( ObjID & rObjID,
std::shared_ptr< GenericPersistent > & rRetVal,
EnSeekMode eMode )

Returns an object ID and if possible a generic object in a std::shared_ptr from the AllSet of the database in relation to eMode. This also allows iteration over read-locked objects (only the object ID is returned).

Parameters
[in,out]rObjIDThe object ID.
[in,out]rRetValThe object in std::shared_ptr, if found.
[in]eModeThe seek mode.

Parameter examples:

Returns
A return value < 0 indicates an error. A return == ERR_RANGE indicates the end of the AllSet. If you return == ERR_OBJECT_LOCKED, no object is returned but the object ID of the locked object is.

◆ get() [5/6]

int glo::GenericAllSet::get ( std::shared_ptr< GenericPersistent > & rRetVal,
const ObjID & rObjID )

Returns a generic object in a std::shared_ptr from the AllSet of the database with passed object ID.

Parameters
[in,out]rRetValIf no error, the fetched object in a std::shared_ptr.
[in]rObjIDThe object ID.
Returns
A return value < 0 indicates an error.

◆ get() [6/6]

int glo::GenericAllSet::get ( std::shared_ptr< GenericPersistent > & rRetVal,
EnSeekMode eMode )

Returns a generic object in a std::shared_ptr from the AllSet of the referenced database in relation to eMode.

Parameters
[in,out]rRetValThe object in std::shared_ptr, if found.
[in]eModeThe seek mode.

Parameter examples:

Returns
A return < 0 indicates an error. A return == ERR_RANGE indicates the end of the AllSet.

◆ getPersistent()

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

Returns an object from the AllSet of the database with passed object ID.

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 GenericPersistent::forget().
Note
It is recommended, if possible, to consider using std::shared_ptr and to use the method get(std::shared_ptr<GenericPersistent>&, const ObjID&) bzw.

Implements glo::AbstractBaseLot.

◆ operator=()

GenericAllSet & glo::GenericAllSet::operator= ( const GenericAllSet & )
private

The assignment operator is not available.

◆ setClassID()

virtual void glo::GenericAllSet::setClassID ( unsigned long ulClassID)
virtual

Sets the class ID. If another class ID already exists, the AllSet of the last class ID is closed.

Exceptions
eut::ErrorNExceptionAn exception is thrown if an error occurs.

Reimplemented from glo::BaseAllSet.

◆ setWatch()

virtual int glo::GenericAllSet::setWatch ( TdWatchNotifyMode ulWatchMode,
CallBack * pCallBack = 0 )
virtual

The AllSet is monitored in the database.

Parameters
[in]ulWatchModeThe monitoring mode.
Allowed surveillance modes:
[in]pCallBackThe CallBack object that is notified via its method CallBack::notify(NotifyNote&). If no CallBack is passed, notify(NotifyNote&) is taken from this; in this case the method notify(NotifyNote&) should be overwritten in the respective derived class.
Returns
A return value < 0 indicates an error.
Note
To remove the monitoring, the corresponding method unsetWatch(TdWatchNotifyMode, CallBack*) with same parameter values can be used.
Attention
Basically pCallBack must not be destroyed before the monitoring has been cancelled!

Implements glo::BaseAllSet.

◆ unsetWatch()

virtual int glo::GenericAllSet::unsetWatch ( TdWatchNotifyMode ulWatchMode,
CallBack * pCallBack = 0 )
virtual

Monitoring of the AllSet in the referenced database is cancelled.

Parameters
[in]ulWatchModeThe monitoring mode.
Allowed surveillance modes:
[in]pCallBackThe CallBack object, which should be notified via its method CallBack::notify(NotifyNote&).
Returns
A return value < 0 indicates an error.

Implements glo::BaseAllSet.


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