GlobalObjects
|
AllSet, which returns objects from the database. More...
#include <GloTAllSet.h>
Public Member Functions | |
TAllSet () | |
TAllSet (Base &rBase, bool bWithSubClasses=true) | |
TAllSet (Base &rBase, const std::string &rsFullIndexName) | |
virtual | ~TAllSet () |
int | get (ObjID &rObjID, std::shared_ptr< T > &rRetVal, EnSeekMode eMode) |
int | get (ObjID &rObjID, T *&prRetVal, EnSeekMode eMode) |
int | get (std::shared_ptr< T > &rRetVal, const ObjID &rObjID) |
int | get (std::shared_ptr< T > &rRetVal, EnSeekMode eMode) |
int | get (T *&prRetVal, EnSeekMode eMode) |
int | getIndexedOndemands (std::vector< TOndemand< T > > &rOndemandVector, const std::string &rsIndexName, const std::string &rsIndexSearchValue, EnComparisionOp eComparisionOp) |
int | getIndexedOndemands (std::vector< TOndemand< T > > &rOndemandVector, const std::string &rsIndexName, const std::string &rsIndexSearchValue, EnQueryType eQuerryType) |
int | getIndexedOndemands (std::vector< TOndemand< T > > &rOndemandVector, const std::string &rsIndexName, const std::string &rsRangeStartIndexSearchValue, const std::string &rsRangeEndIndexSearchValue) |
int | getIndexedOndemands (std::vector< TOndemand< T > > &rOndemandVector, const std::string &rsIndexName, unsigned long ulIndexClassID, const std::string &rsIndexSearchValue, EnComparisionOp eComparisionOp) |
int | getIndexedOndemands (std::vector< TOndemand< T > > &rOndemandVector, const std::string &rsIndexName, unsigned long ulIndexClassID, const std::string &rsIndexSearchValue, EnQueryType eQuerryType) |
int | getIndexedOndemands (std::vector< TOndemand< T > > &rOndemandVector, const std::string &rsIndexName, unsigned long ulIndexClassID, const std::string &rsRangeStartIndexSearchValue, const std::string &rsRangeEndIndexSearchValue) |
int | getIndexedOndemands (std::vector< TOndemand< T > > &rOndemandVector, const std::string &rsIndexSearchValue, EnComparisionOp eComparisionOp) |
int | getIndexedOndemands (std::vector< TOndemand< T > > &rOndemandVector, const std::string &rsIndexSearchValue, EnQueryType eQuerryType) |
int | getIndexedOndemands (std::vector< TOndemand< T > > &rOndemandVector, const std::string &rsRangeStartIndex, const std::string &rsRangeEndIndex) |
int | getOndemand (std::shared_ptr< TOndemand< T > > &rRetVal, EnSeekMode eMode) |
int | getOndemand (TOndemand< T > &rRetVal, EnSeekMode eMode) |
int | getOndemand (TOndemand< T > *&prRetVal, EnSeekMode eMode) |
virtual int | getPersistent (std::shared_ptr< BasePersistent > &rRetVal, const ObjID &rObjID) |
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 (T *&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< AllSetIndexInfo > | getAvailableIndices () |
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 | setCurrentObject (const BasePersistent &rObject) |
Public Member Functions inherited from glo::CallBack | |
CallBack () | |
CallBack (Base &rBase) | |
virtual | ~CallBack () |
Base * | getBase () const |
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. | |
Private Member Functions | |
TAllSet (const TAllSet &) | |
TAllSet< T > & | operator= (const TAllSet &) |
void | transferObjIListIntoOndemandVector (const std::list< ObjID > &rSourceList, std::vector< TOndemand< T > > &rTargetVevtor) |
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 () |
virtual void | setClassID (unsigned long ulClassID) |
void | setClassIDFromTemplate (unsigned long ulClassID) |
Protected Member Functions inherited from glo::CallBack | |
CallBack (const CallBack &rT) | |
AllSet, which returns objects from the database.
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.
Indexesbr> An AllSet can also be instantiated with an index or an index can be set (see BaseAllSet::setIndexName (...) ) if the index is defined in the schema. When iterating through the objects, the sorting of the selected index is used.
If an index is set, it is possible to filter the output during iteration (see setIndexFilter( const std::string & rsIndexFilter ), setIndexFilter( const std::string & rsIndexFilter,
EnComparisionOp eComparisionOp )
and
setIndexFilter( const std::string & rsRangeStartIndexFilter, const std::string & rsRangeEndIndexFilter ).
An AllSet can also return result sets, which can be restricted as with filtering (see
getIndexedObjIds( std::list< ObjID > & rObjIDList, const std::string & rsIndexSearchValue, EnQueryType eQuerryType ),
getIndexedObjIds( std::list< ObjID > & rObjIDList, const std::string & rsIndexSearchValue, EnComparisionOp eComparisionOp ),
getIndexedObjIds( std::list< ObjID > & rObjIDList, const std::string & rsRangeStartIndexSearchValue, const std::string & rsRangeEndIndexSearchValue ),
getIndexedOndemands( std::vector< TOndemand<T> > & rOndemandVector, const std::string & rsIndex, EnQueryType eQuerryType ),
getIndexedOndemands( std::vector< TOndemand<T> > & rOndemandVector, const std::string & rsIndex, EnComparisionOp eComparisionOp )
and
getIndexedOndemands( std::vector< TOndemand<T> > & rOndemandVector, const std::string & rsRangeStartIndex, const std::string & rsRangeEndIndex ).
Watch / Notify
An AllSet can be observed with its objects and corresponding observers can be notified (see also TAllSet< T >::setWatch (...) and TAllSet< T >::unsetWatch (...).
glo::TAllSet< T >::TAllSet | ( | ) |
Standard constructor.
glo::TAllSet< T >::TAllSet | ( | Base & | rBase, |
bool | bWithSubClasses = true ) |
Constructor with parameter passing.
[in] | rBase | The authoritative database is passed. |
[in] | bWithSubClasses | If false, only objects of the template type without subclasses are considered. |
eut::ErrorNException | An exception is thrown if an error occurs. |
glo::TAllSet< T >::TAllSet | ( | Base & | rBase, |
const std::string & | rsFullIndexName ) |
Constructor with parameter passing.
[in] | rBase | The authoritative database is passed. |
[in] | rsFullIndexName | An AllSet can be sorted by an index. The index name must be passed preceded by the full class name (e.g. "mynamespace::MyClassName.IndexName"). |
eut::ErrorNException | An exception is thrown if an error occurs. |
|
virtual |
Destructor.
|
private |
The copy constructor is not available.
int glo::TAllSet< T >::get | ( | ObjID & | rObjID, |
std::shared_ptr< T > & | rRetVal, | ||
EnSeekMode | eMode ) |
Returns an object ID and if possible a 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).
[in,out] | rObjID | The object ID. |
[in,out] | rRetVal | The object in std::shared_ptr, if found. |
[in] | eMode | The seek mode. |
Parameter examples:
int glo::TAllSet< T >::get | ( | ObjID & | rObjID, |
T *& | prRetVal, | ||
EnSeekMode | eMode ) |
Returns an object ID and if possible a 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).
[in,out] | rObjID | The object ID. |
[in,out] | prRetVal | The object, if found. |
[in] | eMode | The seek mode. |
Parameter examples:
int glo::TAllSet< T >::get | ( | std::shared_ptr< T > & | rRetVal, |
const ObjID & | rObjID ) |
Returns an object in a std::shared_ptr from the AllSet of the database with passed object ID.
[in,out] | rRetVal | If no error, the fetched object in a std::shared_ptr. |
[in] | rObjID | The object ID. |
int glo::TAllSet< T >::get | ( | std::shared_ptr< T > & | rRetVal, |
EnSeekMode | eMode ) |
Returns a object from the AllSet of the referenced database in relation to eMode.
[in,out] | rRetVal | The object in a std::shared_ptr if found. |
[in] | eMode | The seek mode. |
Parameter examples:
int glo::TAllSet< T >::get | ( | T *& | prRetVal, |
const ObjID & | rObjID ) |
Returns an object from the AllSet of the database with passed object ID.
[in,out] | prRetVal | If no error, the fetched object. |
[in] | rObjID | The object ID. |
int glo::TAllSet< T >::get | ( | T *& | prRetVal, |
EnSeekMode | eMode ) |
Returns a object from the AllSet of the referenced database in relation to eMode.
[in,out] | prRetVal | The object if found. |
[in] | eMode | The seek mode. |
Parameter examples:
int glo::TAllSet< T >::getIndexedOndemands | ( | std::vector< TOndemand< T > > & | rOndemandVector, |
const std::string & | rsIndexName, | ||
const std::string & | rsIndexSearchValue, | ||
EnComparisionOp | eComparisionOp ) |
Returns a vector of TOndemand's from AllSet in relation to the passed parameters. The result can be defined using the parameter eComparisionOp. If e.g. parameter sIndex has the value "123" and parameter eComparisionOp has the value LESS, only all objects with the index lower than 123 will be delivered.
[in,out] | rOndemandVector | The TOndemand's found are returned to this vector. |
[in] | rsIndexName | The index name of the index to be searched. |
[in] | rsIndexSearchValue | The index value. |
[in] | eComparisionOp | The comparison operator. For example, if rsIndex has the value "123" and eComparisionOp has the value LESS, all objects with the index less than 123 are returned. |
int glo::TAllSet< T >::getIndexedOndemands | ( | std::vector< TOndemand< T > > & | rOndemandVector, |
const std::string & | rsIndexName, | ||
const std::string & | rsIndexSearchValue, | ||
EnQueryType | eQuerryType ) |
Returns a vector of TOndemand's from AllSet in relation to the passed parameters.
[in,out] | rOndemandVector | The TOndemand's found are returned to this vector. |
[in] | rsIndexName | The index name of the index to be searched. |
[in] | rsIndexSearchValue | The index expression can contain the placeholders '*' and '?', which are taken into account in the evaluation or if parameter eQueryType == eOQL, the string is interpreted as OQL expression. Please note; OQL is not yet implemented! |
[in] | eQuerryType | The query type. |
int glo::TAllSet< T >::getIndexedOndemands | ( | std::vector< TOndemand< T > > & | rOndemandVector, |
const std::string & | rsIndexName, | ||
const std::string & | rsRangeStartIndexSearchValue, | ||
const std::string & | rsRangeEndIndexSearchValue ) |
Returns a vector of TOndemand's from AllSet in relation to the passed parameters. The result can be defined with a range specification. For example, if parameter rsRangeStartIndexSearchValue has the value "123" and parameter rsRangeEndIndexSearchValue has the value "155", only all objects with an index greater than/equal to 123 and less than/equal to 155 will be delivered.
[in,out] | rOndemandVector | The TOndemand's found are returned to this list. |
[in] | rsIndexName | The index name of the index to be searched. |
[in] | rsRangeStartIndexSearchValue | The start index value. |
[in] | rsRangeEndIndexSearchValue | The end index value. |
int glo::TAllSet< T >::getIndexedOndemands | ( | std::vector< TOndemand< T > > & | rOndemandVector, |
const std::string & | rsIndexName, | ||
unsigned long | ulIndexClassID, | ||
const std::string & | rsIndexSearchValue, | ||
EnComparisionOp | eComparisionOp ) |
Returns a vector of TOndemand's from AllSet in relation to the passed parameters. The result can be defined using the parameter eComparisionOp. If e.g. parameter sIndex has the value "123" and parameter eComparisionOp has the value LESS, only all objects with the index lower than 123 will be delivered.
[in,out] | rOndemandVector | The TOndemand's found are returned to this vector. |
[in] | rsIndexName | The index name of the index to be searched. |
[in] | ulIndexClassID | The ID of the class indexed with the 'rsIndexName'. This allows you to use the index of a superclass. |
[in] | rsIndexSearchValue | The index value. |
[in] | eComparisionOp | The comparison operator. For example, if rsIndex has the value "123" and eComparisionOp has the value LESS, all objects with the index less than 123 are returned. |
int glo::TAllSet< T >::getIndexedOndemands | ( | std::vector< TOndemand< T > > & | rOndemandVector, |
const std::string & | rsIndexName, | ||
unsigned long | ulIndexClassID, | ||
const std::string & | rsIndexSearchValue, | ||
EnQueryType | eQuerryType ) |
Returns a vector of TOndemand's from AllSet in relation to the passed parameters.
[in,out] | rOndemandVector | The TOndemand's found are returned to this vector. |
[in] | rsIndexName | The index name of the index to be searched. |
[in] | ulIndexClassID | The ID of the class indexed with the 'rsIndexName'. This allows you to use the index of a superclass. |
[in] | rsIndexSearchValue | The index expression can contain the placeholders '*' and '?', which are taken into account in the evaluation or if parameter eQueryType == eOQL, the string is interpreted as OQL expression. Please note; OQL is not yet implemented! |
[in] | eQuerryType | The query type. |
int glo::TAllSet< T >::getIndexedOndemands | ( | std::vector< TOndemand< T > > & | rOndemandVector, |
const std::string & | rsIndexName, | ||
unsigned long | ulIndexClassID, | ||
const std::string & | rsRangeStartIndexSearchValue, | ||
const std::string & | rsRangeEndIndexSearchValue ) |
Returns a list of TOndemand's from AllSet in relation to the passed parameters. The result can be defined with a range specification. For example, if parameter rsRangeStartIndexSearchValue has the value "123" and parameter rsRangeEndIndexSearchValue has the value "155", only all objects with an index greater than/equal to 123 and less than/equal to 155 will be delivered.
[in,out] | rOndemandVector | The TOndemand's found are returned to this vector. |
[in] | rsIndexName | The index name of the index to be searched. |
[in] | ulIndexClassID | The ID of the class indexed with the 'rsIndexName'. This allows you to use the index of a superclass. |
[in] | rsRangeStartIndexSearchValue | The start index value. |
[in] | rsRangeEndIndexSearchValue | The end index value. |
int glo::TAllSet< T >::getIndexedOndemands | ( | std::vector< TOndemand< T > > & | rOndemandVector, |
const std::string & | rsIndexSearchValue, | ||
EnComparisionOp | eComparisionOp ) |
Returns a vector of TOndemand's from AllSet in relation to the passed parameters. The result can be defined using the parameter eComparisionOp. If e.g. parameter sIndex has the value "123" and parameter eComparisionOp has the value LESS, only all objects with the index lower than 123 will be delivered.
[in,out] | rOndemandVector | The TOndemand's found are returned to this vector. |
[in] | rsIndexSearchValue | The index value. |
[in] | eComparisionOp | The comparison operator. For example, if rsIndex has the value "123" and eComparisionOp has the value LESS, all objects with the index less than 123 are returned. |
int glo::TAllSet< T >::getIndexedOndemands | ( | std::vector< TOndemand< T > > & | rOndemandVector, |
const std::string & | rsIndexSearchValue, | ||
EnQueryType | eQuerryType ) |
Returns a vector of TOndemand's from AllSet in relation to the passed parameters.
[in,out] | rOndemandVector | The TOndemand's found are returned to this vector. |
[in] | rsIndexSearchValue | The index expression can contain the placeholders '*' and '?', which are taken into account in the evaluation or if parameter eQueryType == eOQL, the string is interpreted as OQL expression. Please note; OQL is not yet implemented! |
[in] | eQuerryType | The query type. |
int glo::TAllSet< T >::getIndexedOndemands | ( | std::vector< TOndemand< T > > & | rOndemandVector, |
const std::string & | rsRangeStartIndex, | ||
const std::string & | rsRangeEndIndex ) |
Returns a vector of TOndemand's from AllSet in relation to the passed parameters. The result can be defined with a range specification. For example, if parameter rsRangeStartIndex has the value "123" and parameter rsRangeEndIndex has the value "155", only all objects with an index greater than/equal to 123 and less than/equal to 155 will be delivered.
[in,out] | rOndemandVector | The TOndemand's found are returned to this vector. |
[in] | rsRangeStartIndex | The start index value. |
[in] | rsRangeEndIndex | The end index value. |
int glo::TAllSet< T >::getOndemand | ( | std::shared_ptr< TOndemand< T > > & | rRetVal, |
EnSeekMode | eMode ) |
Returns a TOndemand object in a std::shared_ptr from the AllSet of the referenced database in relation to eMode.
[in,out] | rRetVal | The object in a std::shared_ptr if found. |
[in] | eMode | The seek mode. |
Parameter examples:
int glo::TAllSet< T >::getOndemand | ( | TOndemand< T > & | rRetVal, |
EnSeekMode | eMode ) |
Returns a object in passed TOndemand from the AllSet of the referenced database in relation to eMode.
[in,out] | rRetVal | The object in the passed TOndemand if found. |
[in] | eMode | The seek mode. |
Parameter examples:
int glo::TAllSet< T >::getOndemand | ( | TOndemand< T > *& | prRetVal, |
EnSeekMode | eMode ) |
Returns a new TOndemand object from the AllSet of the referenced database in relation to eMode.
[in,out] | prRetVal | The object in a new TOndemand if found. |
[in] | eMode | The seek mode. |
Parameter examples:
|
virtual |
Returns an object from the AllSet of the database with passed object ID.
[in,out] | prRetVal | If no error, the fetched object. |
[in] | rObjID | The object ID. |
Implements glo::AbstractBaseLot.
|
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. |
Reimplemented from glo::AbstractBaseLot.
|
private |
The assignment operator is not available.
|
virtual |
The AllSet is monitored in the database.
[in] | ulWatchMode | The monitoring mode. Allowed watch modes:
|
[in] | pCallBack | The 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. |
Implements glo::BaseAllSet.
|
private |
|
virtual |
Monitoring of the AllSet in the referenced database is cancelled.
[in] | ulWatchMode | The monitoring mode. Allowed watch modes:
|
[in] | pCallBack | The CallBack object, which should be notified via its method CallBack::notify(NotifyNote&). |
Implements glo::BaseAllSet.