BankAndCustomer
Loading...
Searching...
No Matches
glo::TAllSet< T > Class Template Reference

AllSet, which returns objects from the database. More...

#include <GloTAllSet.h>

Inheritance diagram for glo::TAllSet< T >:
Collaboration diagram for glo::TAllSet< T >:

Public Member Functions

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

 TAllSet (const TAllSet &)
 
void transferObjIListIntoOndemandVector (const std::vector< glo::ObjID > &rSourceContainer, std::vector< glo::TOndemand< T > > &rTargetVevtor)
 
TAllSet< T > & operator= (const TAllSet &)
 

Additional Inherited Members

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

Detailed Description

template<class T>
class glo::TAllSet< T >

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.

An AllSet contains all objects of the corresponding class. This also includes objects that are derived from the AllSet's class. If an object of a derived class is now "fetched" from the (superclass) AllSet, the object of the subclass(es) is automatically instantiated.

Keywords for this: "dynamic_cast" and "Class-ID".

Attention
This means that a TAllSet must always be removed from memory before the Base.
int main( int argc, char* argv[] )
{
int t_iErr = 0;
FirstGloBaseObjCreator t_ObjCreator;
glo::Base t_Base( "LOCAL", "WindowsWatcher", t_ObjCreator );
t_iErr = t_Base.openBase();
if ( ! t_iErr )
{
std::shared_ptr<FirstClass> t_spShowPersObject;
glo::TAllSet<FirstClass> t_AllSet( t_Base );
t_iErr = t_AllSet.get( t_spShowPersObject, glo::START );
if ( ! t_iErr )
{
do
{
std::cout << "From AllSet ObjId: "
<< t_spShowPersObject->getObjID().toString()
<< "\n" ;
t_iErr = t_AllSet.get( t_spShowPersObject, glo::NEXT );
} while ( ! t_iErr );
}
t_iErr = ( t_iErr == glo::ERR_RANGE ? 0 : t_iErr );
t_Base.closeBase();
}
return t_iErr;
}
AllSet, which returns objects from the database.
Definition GloTAllSet.h:192

Indexesbr> An AllSet can also be instantiated with an index or an index can be set (see setFullIndexName(const std::string&) ) 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::vector< glo::ObjID > & t_ObjIDContainer, const std::string & rsIndexSearchValue, EnQueryType eQuerryType ),
getIndexedObjIds( std::vector< glo::ObjID > & t_ObjIDContainer, const std::string & rsIndexSearchValue, EnComparisionOp eComparisionOp ),
getIndexedObjIds( std::vector< glo::ObjID > & t_ObjIDContainer, const std::string & rsRangeStartIndexSearchValue, const std::string & rsRangeEndIndexSearchValue ),
getIndexedOndemands( std::vector< glo::TOndemand<T> > & rOndemandVector, const std::string & rsIndex, EnQueryType eQuerryType ),
getIndexedOndemands( std::vector< glo::TOndemand<T> > & rOndemandVector, const std::string & rsIndex, EnComparisionOp eComparisionOp )
and
getIndexedOndemands( std::vector< glo::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 (...).

Attention
A TAllSet must always be removed from memory before the Base.
Author
Helmut Jakoby

Constructor & Destructor Documentation

◆ TAllSet() [1/4]

template<class T >
glo::TAllSet< T >::TAllSet ( )

Standard constructor.

◆ TAllSet() [2/4]

template<class T >
glo::TAllSet< T >::TAllSet ( Base & rBase,
bool bWithSubClasses = true )

Constructor with parameter passing.

Parameters
[in]rBaseThe authoritative database is passed.
[in]bWithSubClassesIf false, only objects of the template type without subclasses are considered.
Exceptions
eut::ErrorNExceptionAn exception is thrown if an error occurs.

◆ TAllSet() [3/4]

template<class T >
glo::TAllSet< T >::TAllSet ( Base & rBase,
const std::string & rsFullIndexName )

Constructor with parameter passing.

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

◆ ~TAllSet()

template<class T >
glo::TAllSet< T >::~TAllSet ( )
virtual

Destructor.

◆ TAllSet() [4/4]

template<class T >
glo::TAllSet< T >::TAllSet ( const TAllSet< T > & )
private

The copy constructor is not available.

Member Function Documentation

◆ get() [1/6]

template<class T >
int glo::TAllSet< T >::get ( glo::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).

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

Parameter examples:

  • glo::START = returns first element
  • glo::END = returns last element
  • glo::CURRENT = returns current element
  • glo::NEXT = returns next element
  • glo::PREVIOUS = returns previous element
Returns
A return value < 0 indicates an error. A return == glo::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() [2/6]

template<class T >
int glo::TAllSet< T >::get ( glo::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).

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

Parameter examples:

  • glo::START = returns first element
  • glo::END = returns last element
  • glo::CURRENT = returns current element
  • glo::NEXT = returns next element
  • glo::PREVIOUS = returns previous element
Returns
A return value < 0 indicates an error. A return == glo::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 Persistent::forget().
Note
It is recommended, if possible, to consider using std::shared_ptr and to use the method get(glo::ObjID&, std::shared_ptr<T>&, EnSeekMode)

◆ get() [3/6]

template<class T >
int glo::TAllSet< T >::get ( std::shared_ptr< T > & rRetVal,
const glo::ObjID & rObjID )

Returns an 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() [4/6]

template<class T >
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.

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

Parameter examples:

  • glo::START = returns first element
  • glo::END = returns last element
  • glo::CURRENT = returns current element
  • glo::NEXT = returns next element
  • glo::PREVIOUS = returns previous element
Returns
A return < 0 indicates an error. A return == glo::ERR_RANGE indicates the end of the AllSet.

◆ get() [5/6]

template<class T >
int glo::TAllSet< T >::get ( T *& prRetVal,
const glo::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 getPersistent(std::shared_ptr<BasePersistent>&, const glo::ObjID&) or get( std::shared_ptr<T> & rRetVal, const glo::ObjID & rObjID )

◆ get() [6/6]

template<class T >
int glo::TAllSet< T >::get ( T *& prRetVal,
EnSeekMode eMode )

Returns a 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:

  • glo::START = returns first element
  • glo::END = returns last element
  • glo::CURRENT = returns current element
  • glo::NEXT = returns next element
  • glo::PREVIOUS = returns previous element
Returns
A return < 0 indicates an error. A return == glo::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 Persistent::forget().
Note
It is recommended, if possible, to consider using std::shared_ptr and to use the method get(std::shared_ptr<T>&, EnSeekMode).

◆ getIndexedOndemands() [1/9]

template<class T >
int glo::TAllSet< T >::getIndexedOndemands ( std::vector< glo::TOndemand< T > > & rOndemandVector,
const std::string & rsFullIndexName,
const std::string & rsIndexSearchValue,
EnComparisionOp eComparisionOp )

Returns a vector of glo::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 glo::LESS, only all objects with the index lower than 123 will be delivered.

Parameters
[in,out]rOndemandVectorThe glo::TOndemand's found are returned to this vector.
[in]rsFullIndexNameThe index name of the index to be searched. The index name must be passed with the full class name (e.g. "mynamespace::MyClassName.IndexName").
[in]rsIndexSearchValueThe index value.
[in]eComparisionOpThe comparison operator. For example, if rsIndex has the value "123" and eComparisionOp has the value glo::LESS, all objects with the index glo::LESS than 123 are returned.
Returns
A return value < 0 indicates an error.
Note
Any placeholders '*' and '?' in the parameter rsIndexSearchValue are NOT taken into account.
The IndexName must be set in AllSet.
Indexes are only determined after opening the AllSet.
See also
setFullIndexName(const std::string&)

◆ getIndexedOndemands() [2/9]

template<class T >
int glo::TAllSet< T >::getIndexedOndemands ( std::vector< glo::TOndemand< T > > & rOndemandVector,
const std::string & rsFullIndexName,
const std::string & rsIndexSearchValue,
EnQueryType eQuerryType )

Returns a vector of glo::TOndemand's from AllSet in relation to the passed parameters.

Parameters
[in,out]rOndemandVectorThe glo::TOndemand's found are returned to this vector.
[in]rsFullIndexNameThe index name of the index to be searched. The index name must be passed with the full class name (e.g. "mynamespace::MyClassName.IndexName").
[in]rsIndexSearchValueThe 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]eQuerryTypeThe query type.
Returns
A return value < 0 indicates an error.
Note
The IndexName must be set in AllSet.
Indexes are only determined after opening the AllSet.
See also
setFullIndexName(const std::string&)

◆ getIndexedOndemands() [3/9]

template<class T >
int glo::TAllSet< T >::getIndexedOndemands ( std::vector< glo::TOndemand< T > > & rOndemandVector,
const std::string & rsFullIndexName,
const std::string & rsRangeStartIndexSearchValue,
const std::string & rsRangeEndIndexSearchValue )

Returns a vector of glo::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.

Parameters
[in,out]rOndemandVectorThe glo::TOndemand's found are returned to this list.
[in]rsFullIndexNameThe index name of the index to be searched. The index name must be passed with the full class name (e.g. "mynamespace::MyClassName.IndexName").
[in]rsRangeStartIndexSearchValueThe start index value.
[in]rsRangeEndIndexSearchValueThe end index value.
Note
Any placeholders '*' and '?' in the parameter rsIndexSearchValue are NOT taken into account.
The IndexName must be set in AllSet.
Indexes are only determined after opening the AllSet.
See also
setFullIndexName(const std::string&)

◆ getIndexedOndemands() [4/9]

template<class T >
int glo::TAllSet< T >::getIndexedOndemands ( std::vector< glo::TOndemand< T > > & rOndemandVector,
const std::string & rsIndexName,
unsigned long ulIndexClassID,
const std::string & rsIndexSearchValue,
EnComparisionOp eComparisionOp )

Returns a vector of glo::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 glo::LESS, only all objects with the index lower than 123 will be delivered.

Parameters
[in,out]rOndemandVectorThe glo::TOndemand's found are returned to this vector.
[in]rsIndexNameThe index name of the index to be searched. The index name must be passed with the full class name (e.g. "mynamespace::MyClassName.IndexName").
[in]ulIndexClassIDThe ID of the class indexed with the 'rsIndexName'. This allows you to use the index of a superclass.
[in]rsIndexSearchValueThe index value.
[in]eComparisionOpThe comparison operator. For example, if rsIndex has the value "123" and eComparisionOp has the value glo::LESS, all objects with the index glo::LESS than 123 are returned.
Returns
A return value < 0 indicates an error.
Note
Any placeholders '*' and '?' in the parameter rsIndexSearchValue are NOT taken into account.
The IndexName must be set in AllSet.
Indexes are only determined after opening the AllSet.
See also
setFullIndexName(const std::string&)

◆ getIndexedOndemands() [5/9]

template<class T >
int glo::TAllSet< T >::getIndexedOndemands ( std::vector< glo::TOndemand< T > > & rOndemandVector,
const std::string & rsIndexName,
unsigned long ulIndexClassID,
const std::string & rsIndexSearchValue,
EnQueryType eQuerryType )

Returns a vector of glo::TOndemand's from AllSet in relation to the passed parameters.

Parameters
[in,out]rOndemandVectorThe glo::TOndemand's found are returned to this vector.
[in]rsIndexNameThe index name of the index to be searched. The index name must be passed with the full class name (e.g. "mynamespace::MyClassName.IndexName").
[in]ulIndexClassIDThe ID of the class indexed with the 'rsIndexName'. This allows you to use the index of a superclass.
[in]rsIndexSearchValueThe 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]eQuerryTypeThe query type.
Returns
A return value < 0 indicates an error.
Note
The IndexName must be set in AllSet.
Indexes are only determined after opening the AllSet.
See also
setFullIndexName(const std::string&)

◆ getIndexedOndemands() [6/9]

template<class T >
int glo::TAllSet< T >::getIndexedOndemands ( std::vector< glo::TOndemand< T > > & rOndemandVector,
const std::string & rsIndexName,
unsigned long ulIndexClassID,
const std::string & rsRangeStartIndexSearchValue,
const std::string & rsRangeEndIndexSearchValue )

Returns a list of glo::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.

Parameters
[in,out]rOndemandVectorThe glo::TOndemand's found are returned to this vector.
[in]rsIndexNameThe index name of the index to be searched. The index name must be passed with the full class name (e.g. "mynamespace::MyClassName.IndexName").
[in]ulIndexClassIDThe ID of the class indexed with the 'rsIndexName'. This allows you to use the index of a superclass.
[in]rsRangeStartIndexSearchValueThe start index value.
[in]rsRangeEndIndexSearchValueThe end index value.
Note
Any placeholders '*' and '?' in the parameter rsIndexSearchValue are NOT taken into account.
The IndexName must be set in AllSet.
Indexes are only determined after opening the AllSet.
See also
setFullIndexName(const std::string&)

◆ getIndexedOndemands() [7/9]

template<class T >
int glo::TAllSet< T >::getIndexedOndemands ( std::vector< glo::TOndemand< T > > & rOndemandVector,
const std::string & rsIndexSearchValue,
EnComparisionOp eComparisionOp )

Returns a vector of glo::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 glo::LESS, only all objects with the index lower than 123 will be delivered.

Parameters
[in,out]rOndemandVectorThe glo::TOndemand's found are returned to this vector.
[in]rsIndexSearchValueThe index value.
[in]eComparisionOpThe comparison operator. For example, if rsIndex has the value "123" and eComparisionOp has the value glo::LESS, all objects with the index glo::LESS than 123 are returned.
Returns
A return value < 0 indicates an error.
Note
Any placeholders '*' and '?' in the parameter rsIndexSearchValue are NOT taken into account.
The IndexName must be set in AllSet.
Indexes are only determined after opening the AllSet.
See also
setFullIndexName(const std::string&)

◆ getIndexedOndemands() [8/9]

template<class T >
int glo::TAllSet< T >::getIndexedOndemands ( std::vector< glo::TOndemand< T > > & rOndemandVector,
const std::string & rsIndexSearchValue,
EnQueryType eQuerryType )

Returns a vector of glo::TOndemand's from AllSet in relation to the passed parameters.

Parameters
[in,out]rOndemandVectorThe glo::TOndemand's found are returned to this vector.
[in]rsIndexSearchValueThe 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]eQuerryTypeThe query type.
Returns
A return value < 0 indicates an error.
Note
The IndexName must be set in AllSet.
Indexes are only determined after opening the AllSet.
See also
setFullIndexName(const std::string&)

◆ getIndexedOndemands() [9/9]

template<class T >
int glo::TAllSet< T >::getIndexedOndemands ( std::vector< glo::TOndemand< T > > & rOndemandVector,
const std::string & rsRangeStartIndex,
const std::string & rsRangeEndIndex )

Returns a vector of glo::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.

Parameters
[in,out]rOndemandVectorThe glo::TOndemand's found are returned to this vector.
[in]rsRangeStartIndexThe start index value.
[in]rsRangeEndIndexThe end index value.
Returns
A return value < 0 indicates an error.
Note
The IndexName must be set in AllSet.
Indexes are only determined after opening the AllSet.
See also
setFullIndexName(const std::string&)

◆ getOndemand() [1/3]

template<class T >
int glo::TAllSet< T >::getOndemand ( glo::TOndemand< T > & rRetVal,
EnSeekMode eMode )

Returns a object in passed glo::TOndemand from the AllSet of the referenced database in relation to eMode.

Parameters
[in,out]rRetValThe object in the passed glo::TOndemand if found.
[in]eModeThe seek mode.

Parameter examples:

  • glo::START = returns first element
  • glo::END = returns last element
  • glo::CURRENT = returns current element
  • glo::NEXT = returns next element
  • glo::PREVIOUS = returns previous element
Returns
A return < 0 indicates an error. A return == glo::ERR_RANGE indicates the end of the AllSet.

◆ getOndemand() [2/3]

template<class T >
int glo::TAllSet< T >::getOndemand ( glo::TOndemand< T > *& prRetVal,
EnSeekMode eMode )

Returns a new glo::TOndemand object from the AllSet of the referenced database in relation to eMode.

Parameters
[in,out]prRetValThe object in a new glo::TOndemand if found.
[in]eModeThe seek mode.

Parameter examples:

  • glo::START = returns first element
  • glo::END = returns last element
  • glo::CURRENT = returns current element
  • glo::NEXT = returns next element
  • glo::PREVIOUS = returns previous element
Returns
A return < 0 indicates an error. A return == glo::ERR_RANGE indicates the end of the AllSet.
Attention
If prRetVal is valid, this object must be removed from memory by the calling instance.
Note
It is recommended, if possible, to consider using std::shared_ptr and to use the method getOndemand(std::shared_ptr< glo::TOndemand<T> >&, EnSeekMode) or getOndemand(glo::TOndemand<T>&, EnSeekMode)

◆ getOndemand() [3/3]

template<class T >
int glo::TAllSet< T >::getOndemand ( std::shared_ptr< glo::TOndemand< T > > & rRetVal,
EnSeekMode eMode )

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

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

Parameter examples:

  • glo::START = returns first element
  • glo::END = returns last element
  • glo::CURRENT = returns current element
  • glo::NEXT = returns next element
  • glo::PREVIOUS = returns previous element
Returns
A return < 0 indicates an error. A return == glo::ERR_RANGE indicates the end of the AllSet.

◆ getPersistent() [1/2]

template<class T >
int glo::TAllSet< T >::getPersistent ( BasePersistent *& prRetVal,
const glo::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 getPersistent(std::shared_ptr<BasePersistent>&, const glo::ObjID&) or get( std::shared_ptr<T> & rRetVal, const glo::ObjID & rObjID )

Implements glo::AbstractBaseLot.

◆ getPersistent() [2/2]

template<class T >
int glo::TAllSet< T >::getPersistent ( std::shared_ptr< BasePersistent > & rRetVal,
const glo::ObjID & rObjID )
virtual

Returns an object with passed object ID from the container.

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

Reimplemented from glo::AbstractBaseLot.

◆ operator=()

template<class T >
TAllSet< T > & glo::TAllSet< T >::operator= ( const TAllSet< T > & )
private

The assignment operator is not available.

◆ setWatch()

template<class T >
int glo::TAllSet< T >::setWatch ( TdWatchNotifyMode ulWatchMode,
CallBack * pCallBack = 0 )
virtual

The AllSet is monitored in the database.

Parameters
[in]ulWatchModeThe monitoring mode.
Allowed watch modes:
  • ::WNM_WRITE = writing is reported
  • ::WNM_WRITE_TRANSACTION = like ::WNM_WRITE, but triggered in a transaction
  • ::WNM_DELETE = delete is reported
  • ::WNM_DELETE_TRANSACTION = like ::WNM_DELETE, but triggered in a transaction
  • ::WNM_LOCK = lock is reported
  • ::WNM_UNLOCK = release is reported
  • ::WNM_INSERT = inserting a new object in AllSet is reported
  • ::WNM_INSERT_TRANSACTION = like ::WNM_INSERT, but triggered in a transaction
[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!
See also
Watch and notify.

Implements glo::BaseAllSet.

◆ transferObjIListIntoOndemandVector()

template<class T >
void glo::TAllSet< T >::transferObjIListIntoOndemandVector ( const std::vector< glo::ObjID > & rSourceContainer,
std::vector< glo::TOndemand< T > > & rTargetVevtor )
private

Transfers the glo::ObjID's from the transferred rSourceContainer as glo::TOndemand's into the transferred rTargetVevtor.

Parameters
[in]rSourceContainerThe list with the glo::ObjID's.
[in,out]rTargetVevtorThe resulting vector of glo::TOndemand's.

◆ unsetWatch()

template<class T >
int glo::TAllSet< T >::unsetWatch ( TdWatchNotifyMode ulWatchMode,
CallBack * pCallBack = 0 )
virtual

Monitoring of the AllSet in the referenced database is cancelled.

Parameters
[in]ulWatchModeThe monitoring mode.
Allowed watch modes:
  • ::WNM_WRITE = writing is reported
  • ::WNM_WRITE_TRANSACTION = like ::WNM_WRITE, but triggered in a transaction
  • ::WNM_DELETE = delete is reported
  • ::WNM_DELETE_TRANSACTION = like ::WNM_DELETE, but triggered in a transaction
  • ::WNM_LOCK = lock is reported
  • ::WNM_UNLOCK = release is reported
  • ::WNM_INSERT = inserting a new object in AllSet is reported
  • ::WNM_INSERT_TRANSACTION = like ::WNM_INSERT, but triggered in a transaction
[in]pCallBackThe CallBack object, which should be notified via its method CallBack::notify(NotifyNote&).
Returns
A return value < 0 indicates an error.
Note
Clears the monitoring initiated by the corresponding method setWatch(TdWatchNotifyMode, CallBack*) if the parameters have the same values.
See also
Watch and notify.

Implements glo::BaseAllSet.


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