BankAndCustomer
Loading...
Searching...
No Matches
glo::BaseAllSet Class Referenceabstract

Is the base class of template AllSets and the generic AllSet. More...

#include <GloBaseAllSet.h>

Inheritance diagram for glo::BaseAllSet:
Collaboration diagram for glo::BaseAllSet:

Classes

struct  IndexNameClassIdTuple
 Tuple of IndexName and the class ID of the indexed class. More...
 

Public Member Functions

 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
 
virtual int setWatch (TdWatchNotifyMode ulWatchMode, CallBack *pCallBack=0)=0
 
virtual int unsetWatch (TdWatchNotifyMode ulWatchMode, CallBack *pCallBack=0)=0
 
void setReadWithSubClasses (bool bWithSubClasses)
 
bool readWithSubClasses () const
 
- Public Member Functions inherited from glo::AbstractBaseLot
 AbstractBaseLot ()
 
virtual ~AbstractBaseLot ()
 
virtual int getPersistent (BasePersistent *&prRetVal, const ObjID &prObjID)=0
 
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 ()
 
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.
 

Protected Member Functions

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 ()
 

Private Member Functions

 BaseAllSet (const BaseAllSet &)
 
int init (Base &rBase)
 
BaseAllSet::IndexNameClassIdTuple getIndexNameClassIdTuple (unsigned long ulClassID, const std::string &rsIndexName)
 
BaseAllSet::IndexNameClassIdTuple getIndexNameClassIdTuple (const std::string &rsFullIndexName)
 
BaseAllSetoperator= (const BaseAllSet &)
 

Private Attributes

Basem_pBase
 
bool m_bAllSetOpen
 
unsigned long m_ulClassID
 
bool m_bWithSubClasses
 
IndexNameClassIdTuple m_IndexNameWithClassID
 
std::vector< AllSetIndexInfo > m_AvailableIndices
 
bool m_AvailableIndicesRead
 

Friends

class Base
 
class PrivateBase
 

Additional Inherited Members

- Public Attributes inherited from glo::CallBack
std::string m_strDebugInfo
 

Detailed Description

Is the base class of template AllSets and the generic AllSet.

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

Author
Helmut Jakoby

Constructor & Destructor Documentation

◆ BaseAllSet() [1/5]

glo::BaseAllSet::BaseAllSet ( )

Standard constructor.

◆ BaseAllSet() [2/5]

glo::BaseAllSet::BaseAllSet ( Base & rBase)

Constructor with parameter passing.

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

◆ BaseAllSet() [3/5]

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

Constructor with parameter passing.

Parameters
[in]rBaseThe authoritative database is passed.
[in]ulClassIDThe class ID.
[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.

◆ BaseAllSet() [4/5]

glo::BaseAllSet::BaseAllSet ( 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 with the full class name (e.g. "mynamespace::MyClassName.IndexName").
Exceptions
eut::ErrorNExceptionAn exception is thrown if an error occurs.

◆ ~BaseAllSet()

virtual glo::BaseAllSet::~BaseAllSet ( )
virtual

Destructor. When the AllSet is 'open', it will be closed.

See also
close()

◆ BaseAllSet() [5/5]

glo::BaseAllSet::BaseAllSet ( const BaseAllSet & )
private

The copy constructor is not available.

Member Function Documentation

◆ close()

int glo::BaseAllSet::close ( )

For this AllSet the created iterator is removed from the referenced database.

Returns
A return value < 0 indicates an error.

◆ getAvailableIndices()

std::vector< AllSetIndexInfo > glo::BaseAllSet::getAvailableIndices ( )

Returns all available indices. If not already done, the index information will be determined.

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

◆ getAvailableIndicesSize()

std::size_t glo::BaseAllSet::getAvailableIndicesSize ( )

Returns the number of all available indexes. If not already done, the index information will be determined.

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

◆ getBase()

virtual Base * glo::BaseAllSet::getBase ( ) const
overridevirtual
Returns
Returns pointers to the database.
Attention
The object returned must not be removed from memory by the calling instance.
See also
setBase(Base*)

Reimplemented from glo::CallBack.

◆ getClassID()

unsigned long glo::BaseAllSet::getClassID ( ) const

Returned the class id of the allset.

Returns
The class id.

◆ getFullIndexName()

std::string glo::BaseAllSet::getFullIndexName ( ) const

Returns the complete index name (e.g. "mynamespace::MyClassName.IndexName") of the AllSet.

Returns
The index designation. If return is empty, the AllSet is sorted by the glo::ObjID.

◆ getIndexClassID()

unsigned long glo::BaseAllSet::getIndexClassID ( ) const

Returns the index class ID of the AllSet.

Returns
The index class ID; can only be greater than 0 if a valid index is set.
See also
IndexNameClassIdTuple::m_ulIndexClassID

◆ getIndexedObjIds() [1/9]

int glo::BaseAllSet::getIndexedObjIds ( std::vector< glo::ObjID > & rObjIDContainer,
const std::string & rsFullIndexName,
const std::string & rsIndexSearchValue,
EnComparisionOp eComparisionOp )

Returns a container of object IDs from the 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]rObjIDContainerThe object IDs 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]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 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.
See also
setFullIndexName(const std::string&)

◆ getIndexedObjIds() [2/9]

int glo::BaseAllSet::getIndexedObjIds ( std::vector< glo::ObjID > & rObjIDContainer,
const std::string & rsFullIndexName,
const std::string & rsIndexSearchValue,
EnQueryType eQuerryType )

Returns a container of object IDs from AllSet in relation to the passed parameters.

Parameters
[in,out]rObjIDContainerThe object IDs 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]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.
See also
setFullIndexName(const std::string&)

◆ getIndexedObjIds() [3/9]

int glo::BaseAllSet::getIndexedObjIds ( std::vector< glo::ObjID > & rObjIDContainer,
const std::string & rsFullIndexName,
const std::string & rsRangeStartIndexSearchValue,
const std::string & rsRangeEndIndexSearchValue )

Returns a container of object IDs from the 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]rObjIDContainerThe object IDs 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.
See also
setFullIndexName(const std::string&)

◆ getIndexedObjIds() [4/9]

int glo::BaseAllSet::getIndexedObjIds ( std::vector< glo::ObjID > & rObjIDContainer,
const std::string & rsIndexName,
unsigned long ulIndexClassID,
const std::string & rsIndexSearchValue,
EnComparisionOp eComparisionOp )

Returns a container of object IDs from the 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]rObjIDContainerThe object IDs found are returned to this list.
[in]rsIndexNameThe index name of the index to be searched. The
[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 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.
See also
setFullIndexName(const std::string&)

◆ getIndexedObjIds() [5/9]

int glo::BaseAllSet::getIndexedObjIds ( std::vector< glo::ObjID > & rObjIDContainer,
const std::string & rsIndexName,
unsigned long ulIndexClassID,
const std::string & rsIndexSearchValue,
EnQueryType eQuerryType )

Returns a ontainer of object IDs from the AllSet in relation to the passed parameters.

Parameters
[in,out]rObjIDContainerThe object IDs found are returned to this list.
[in]rsIndexNameThe index name of the index to be searched. The
[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.
See also
setFullIndexName(const std::string&)

◆ getIndexedObjIds() [6/9]

int glo::BaseAllSet::getIndexedObjIds ( std::vector< glo::ObjID > & rObjIDContainer,
const std::string & rsIndexName,
unsigned long ulIndexClassID,
const std::string & rsRangeStartIndexSearchValue,
const std::string & rsRangeEndIndexSearchValue )

Returns a container of object IDs from the 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]rObjIDContainerThe object IDs found are returned to this list.
[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.
See also
setFullIndexName(const std::string&)

◆ getIndexedObjIds() [7/9]

int glo::BaseAllSet::getIndexedObjIds ( std::vector< glo::ObjID > & rObjIDContainer,
const std::string & rsIndexSearchValue,
EnComparisionOp eComparisionOp )

Returns a container of object IDs from the 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]rObjIDContainerThe object IDs found are returned to this list.
[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 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.
See also
setFullIndexName(const std::string&)

◆ getIndexedObjIds() [8/9]

int glo::BaseAllSet::getIndexedObjIds ( std::vector< glo::ObjID > & rObjIDContainer,
const std::string & rsIndexSearchValue,
EnQueryType eQuerryType )

Returns a container of object IDs from the AllSet in relation to the passed parameters.

Parameters
[in,out]rObjIDContainerThe object IDs found are returned to this list.
[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.
See also
setFullIndexName(const std::string&)

◆ getIndexedObjIds() [9/9]

int glo::BaseAllSet::getIndexedObjIds ( std::vector< glo::ObjID > & rObjIDContainer,
const std::string & rsRangeStartIndexSearchValue,
const std::string & rsRangeEndIndexSearchValue )

Returns a container of object IDs from the 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]rObjIDContainerThe object IDs found are returned to this list.
[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.
See also
setFullIndexName(const std::string&)

◆ getIndexName()

std::string glo::BaseAllSet::getIndexName ( ) const

Returns the index name of the AllSet. An AllSet can be sorted by an index.

Returns
The index designation. If return is empty, the AllSet is sorted by the glo::ObjID.

◆ getIndexNameClassIdTuple() [1/2]

BaseAllSet::IndexNameClassIdTuple glo::BaseAllSet::getIndexNameClassIdTuple ( const std::string & rsFullIndexName)
private

Returns an IndexNameClassIdTuple if parent index is available for the allset's class from m_AvailableIndices.

Parameters
[in]rsFullIndexNameThe index name to be checked.
The index name must be passed preceded by the full class name (e.g. "mynamespace::MyClassName.IndexName").
Returns
If a valid index, the attributes of the returned IndexNameClassIdTuple are filled with the passed data.

◆ getIndexNameClassIdTuple() [2/2]

BaseAllSet::IndexNameClassIdTuple glo::BaseAllSet::getIndexNameClassIdTuple ( unsigned long ulClassID,
const std::string & rsIndexName )
private

Returns an IndexNameClassIdTuple if parent index is available for the allset's class from m_AvailableIndices.

Parameters
[in]ulClassIDThe class ID of the class to be checked(this or a superclass).
[in]rsIndexNameThe index name to check.
Returns
If a valid index, the attributes of the returned IndexNameClassIdTuple are filled with the passed data.

◆ getObjID()

int glo::BaseAllSet::getObjID ( glo::ObjID & rObjID,
EnSeekMode eMode )

Returns an object ID in rObjID from the AllSet of the referenced database in relation to eMode.

Parameters
[in,out]rObjIDThe object ID 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.

◆ getTypeAsString()

virtual int glo::BaseAllSet::getTypeAsString ( std::string & rsTypeName)
overridevirtual

Returns the type of the AllSet, i.e. the class name as string when connected to the database.

Parameters
[in,out]rsTypeNameThe type name.
Returns
If return value < 0, an error has occurred.

Reimplemented from glo::CallBack.

◆ init()

int glo::BaseAllSet::init ( Base & rBase)
private

The database is set, checked whether it is open and, if necessary, existing indexes are read in.
Called by the constructor.

Parameters
[in]rBaseThe authoritative database is passed.
Returns
If return value < 0, an error has occurred.
Exceptions
eut::ErrorNExceptionIf an error occurs, an exception is thrown.

◆ inLot()

virtual bool glo::BaseAllSet::inLot ( const glo::ObjID & rObjID) const
overridevirtual

Checks whether the passed object ID respectively an object with the passed object ID is in the AllSet.

Parameters
[in]rObjIDThe object ID you are looking for.
Returns
If true, an object with the passed object ID is in AllSet.
Note
If the AllSet is set to an index and a filter is set, an object ID otherwise in the AllSet may be is filtered out by the filter.
See also
setFullIndexName(const std::string&), setIndexFilter(const std::string & rsIndexFilter, EnComparisionOp eComparisionOp), setIndexFilter(const std::string & rsRangeStartIndexFilter, const std::string & rsRangeEndIndexFilter)

Implements glo::AbstractBaseLot.

◆ inSet()

virtual bool glo::BaseAllSet::inSet ( const glo::ObjID & rObjID) const
virtual

Checks whether an object ID in AllSet is in the database.

Parameters
[in]rObjIDThe object ID you are looking for.
Returns
If true, an object with the passed object ID is in AllSet.
Note
If the AllSet is set to an index and a filter is set, an object ID otherwise in the AllSet may be is filtered out by the filter.
See also
setFullIndexName(const std::string&), setIndexFilter(const std::string & rsIndexFilter, EnComparisionOp eComparisionOp), setIndexFilter(const std::string & rsRangeStartIndexFilter, const std::string & rsRangeEndIndexFilter)

◆ isIndexAvailable() [1/3]

bool glo::BaseAllSet::isIndexAvailable ( const BaseAllSet::IndexNameClassIdTuple & rIndexNameClassIdTuple)

Checks if the passed index can be used.

Parameters
[in]rIndexNameClassIdTupleThe index of a class with a name.
Returns
If true, the index can be used.

◆ isIndexAvailable() [2/3]

bool glo::BaseAllSet::isIndexAvailable ( const std::string & rsFullIndexName)

Checks whether the transferred index can be used. A valid IndexNameClassIdTuple will be returned if a database is referenced that is known to classes (to enable checking) and the index for that class exists.

Parameters
[in]rsFullIndexNameThe index name to be checked.
The index name must be passed preceded by the full class name (e.g. "mynamespace::MyClassName.IndexName").
Returns
If true, the index can be used.

◆ isIndexAvailable() [3/3]

bool glo::BaseAllSet::isIndexAvailable ( unsigned long ulClassID,
const std::string & rsIndexName )

Checks if the passed index can be used.

Parameters
[in]ulClassIDThe class ID of the class to be checked (this or a superclass).
[in]rsIndexNameThe index name to check. The index name must be passed with the full class name (e.g. "mynamespace::MyClassName.IndexName").
Returns
If true, the index can be used.

◆ open()

int glo::BaseAllSet::open ( )

An iterator is created for this AllSet in the referenced database, if not already done. This method does not need to be called separately because it is called by other methods that expect an open AllSet.

Returns
A return value < 0 indicates an error.

◆ operator=()

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

The assignment operator is not available.

◆ readWithSubClasses()

bool glo::BaseAllSet::readWithSubClasses ( ) const

Returns the information whether AllSet also returns the subclasses of the set class ID or not.

Returns
If true, the subclasses are also returned; otherwise not.

◆ removeIndexFilter()

int glo::BaseAllSet::removeIndexFilter ( )

Removes a filter that may have been set.

Returns
A return < 0 indicates an error.

◆ setAllSetOpen()

void glo::BaseAllSet::setAllSetOpen ( bool bOpen)
protected

Sets attribute m_bAllSetOpen.

Parameters
[in]bOpenThe value to be set.
Attention
This method may only be called by an object of this class respectively subclass or the PrivateBase.

◆ setAvailableIndices()

int glo::BaseAllSet::setAvailableIndices ( )
protected

If database and class ID is known, m_AvailableIndices will be filled to check if index is known when setting an index.

Returns
A return value < 0 indicates an error.

◆ setBase() [1/2]

virtual int glo::BaseAllSet::setBase ( Base & rBase)
virtual

Sets the database in which the AllSet objects are stored. If a database is already referenced and it does not match the database passed, a eut::ErrorNException is thrown.

Parameters
[in]rBaseThe database.
Returns
If return value < 0, then an error has occurred.
Attention
The database remains the responsibility of the calling entity.

◆ setBase() [2/2]

virtual int glo::BaseAllSet::setBase ( Base * pBase)
overridevirtual

Sets the database in which the AllSet objects are stored. If a database is already referenced and it does not match the database passed, a eut::ErrorNException is thrown.

Parameters
[in]pBaseThe database.
Exceptions
eut::ErrorNExceptionAn exception is thrown if an error occurs.
Attention
The database remains the responsibility of the calling entity. For example, if the database is removed from memory before Allset, for whatever reason, this method must first be called with nullptr.

Reimplemented from glo::CallBack.

◆ setClassID()

virtual void glo::BaseAllSet::setClassID ( unsigned long ulClassID)
protectedvirtual

Sets the class ID. If another class ID already exists, the AllSet of the last class ID is closed.
This method is virtual so that it can be called in the subclass GenericAllSet public.

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

◆ setClassIDFromTemplate()

void glo::BaseAllSet::setClassIDFromTemplate ( unsigned long ulClassID)
protected

Sets the class ID. This method is only used by subclass TAllSet.

◆ setCurrentObject()

virtual int glo::BaseAllSet::setCurrentObject ( const glo::ObjID & rObjID)
overridevirtual

Sets the iterator in the database 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.

◆ setFullIndexName()

int glo::BaseAllSet::setFullIndexName ( const std::string & rsFullIndexName)

Sets the index name of the AllSet. The AllSet is closed, the index name is set again, then opened again.

Parameters
[in]rsFullIndexNameAn AllSet can be sorted by an index. If an empty string is passed, the AllSet is sorted by the glo::ObjID.
The index name must be passed preceded by the full class name (e.g. "mynamespace::MyClassName.IndexName").
Returns
A return value < 0 indicates an error.
Note
The index can only be set if a database is referenced, the class ID is known (to be able to perform a check) and the index exists.

◆ setIndex()

int glo::BaseAllSet::setIndex ( const BaseAllSet::IndexNameClassIdTuple & rIndexNameClassIdTuple)

Sets the index name of the AllSet. The AllSet is closed, the index name is set again, then opened again.

Parameters
[in]rIndexNameClassIdTupleThe index of a class with a name.
Returns
A return value < 0 indicates an error.
Note
The index can only be set if a database is referenced, the class ID is known (to be able to perform a check) and the index exists.

◆ setIndexFilter() [1/3]

int glo::BaseAllSet::setIndexFilter ( const std::string & rsIndexFilter)

Sets a filter that controls the output of the AllSet in relation to the passed parameters.

Parameters
[in]rsIndexFilterThe index filter can contain the placeholders '*' and '?', which are taken into account in the evaluation.
Returns
A return value < 0 indicates an error.
Note
The IndexName must be set in AllSet.
See also
setFullIndexName(const std::string&)

◆ setIndexFilter() [2/3]

int glo::BaseAllSet::setIndexFilter ( const std::string & rsIndexFilter,
EnComparisionOp eComparisionOp )

Sets a filter that controls the output of the 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]rsIndexFilterThe index filter.
[in]eComparisionOpThe comparison operator. For example, if rsIndex has the value "123" and eComparisionOp has the value glo::LESS, all objects with the index 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.
See also
setFullIndexName(const std::string&)

◆ setIndexFilter() [3/3]

int glo::BaseAllSet::setIndexFilter ( const std::string & rsRangeStartIndexFilter,
const std::string & rsRangeEndIndexFilter )

Sets a filter that controls the output of the AllSet in relation to the passed parameters. The result can be defined with a range specification. For example, if parameter rsRangeStartIndexFilter has the value "123" and parameter rsRangeEndIndexFilter 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]rsRangeStartIndexFilterThe start index value.
[in]rsRangeEndIndexFilterThe end index value.
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.
See also
setFullIndexName(const std::string&)

◆ setPosition()

virtual int glo::BaseAllSet::setPosition ( std::size_t nPosition)
overridevirtual

Sets the iterator in the database to the passed position.

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

Implements glo::AbstractBaseLot.

◆ setReadWithSubClasses()

void glo::BaseAllSet::setReadWithSubClasses ( bool bWithSubClasses)

It is possible to restrict the reading of objects from AllSet to those objects with the class ID; that is, without subclasses.

Parameters
[in]bWithSubClassesIf only objects of the class ID without subclasses are to be delivered, false must be passed.
Attention
The setting has only effects if not yet opened and if no index!

◆ setWatch()

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

The AllSet is monitored in the database.

Parameters
[in]ulWatchModeThe watch 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.

Implemented in glo::TAllSet< T >.

◆ size()

virtual std::size_t glo::BaseAllSet::size ( ) const
overridevirtual

Returns the number of objects in AllSet.

Returns
The number of objects in AllSet. A return value < 0 indicates an error.
Note
This method opens the AllSet; see also open().

Implements glo::AbstractBaseLot.

◆ unsetWatch()

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

Monitoring of the AllSet in the referenced database is cancelled.

Parameters
[in]ulWatchModeThe watch 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.

Implemented in glo::TAllSet< T >.

Friends And Related Symbol Documentation

◆ Base

friend class Base
friend

◆ PrivateBase

friend class PrivateBase
friend

Member Data Documentation

◆ m_AvailableIndices

std::vector<AllSetIndexInfo> glo::BaseAllSet::m_AvailableIndices
private

The available indexes (their names, type, language code and whether 'CaseSensitive') of the class with the class ID from m_ulClassID and the indexes of their superclasses are determined if necessary.

◆ m_AvailableIndicesRead

bool glo::BaseAllSet::m_AvailableIndicesRead
private

The available indexes (their names, type, language code and whether 'CaseSensitive') of the class with the class ID from m_ulClassID and the indexes of their superclasses were determined. Since indexes do not change, reading them once is sufficient.

◆ m_bAllSetOpen

bool glo::BaseAllSet::m_bAllSetOpen
private

Is true if AllSet is open in the database.

◆ m_bWithSubClasses

bool glo::BaseAllSet::m_bWithSubClasses
private

If true, the AllSet is filled with objects with the m_ulClassID and subclasses. If false, the AllSet is only filled with objects with the m_ulClassID.
The default setting is true.

Note
This option is not evaluated when using an index!

◆ m_IndexNameWithClassID

IndexNameClassIdTuple glo::BaseAllSet::m_IndexNameWithClassID
private

An AllSet can be sorted by an index. If so, the index name and the class ID are in here. If there is nothing in IndexNameClassIdTuple::m_sIndexName, the AllSet is sorted by the glo::ObjID.

◆ m_pBase

Base* glo::BaseAllSet::m_pBase
private

AllSets belong to a database.

◆ m_ulClassID

unsigned long glo::BaseAllSet::m_ulClassID
private

An AllSet only applies to one class and its subclasses. Here is the class ID.


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