GlobalObjects
Loading...
Searching...
No Matches
glo::IndexPool::ObjectStrIndexIterator Class Reference

Has a pointer to an ObjectStrIndex and allows iteration through this index. Is instantiated e.g. for AllSets so that they can iterate independently through StringIndexes. More...

#include <GloIndexPool.h>

Public Member Functions

 ObjectStrIndexIterator (const ObjectStrIndexIterator &rT)
 
 ObjectStrIndexIterator (ObjectStrIndex *pObjectStrIndex)
 
 ~ObjectStrIndexIterator ()
 
unsigned long getClassID () const
 
std::size_t getObjectStrIndexSize () const
 
int getObjStrIdTuple (ObjStrIdTuple &rRetVal, EnSeekMode eMode)
 
int getObjStrIdTupleList (std::list< ObjStrIdTuple > &rRetVal, const std::string &rsIndex, EnComparisionOp eComparisionOp) const
 
int getObjStrIdTupleList (std::list< ObjStrIdTuple > &rRetVal, const std::string &rsIndex, EnQueryType eQuerryType) const
 
int getObjStrIdTupleList (std::list< ObjStrIdTuple > &rRetVal, const std::string &rsRangeStartIndex, const std::string &rsRangeEndIndex) const
 
bool inObjectStrIndex (const ObjID &rObjID)
 
bool inObjectStrIndex (const std::string &rsIndex)
 
IndexPool::ObjectStrIndexIteratoroperator= (const ObjectStrIndexIterator &rT)
 
void removeFilter ()
 
int setCurrentObject (const ObjID &rObjID)
 
void setFilter (const std::string &rsIndexFilterValue)
 
void setFilter (const std::string &rsIndexFilterValue, EnComparisionOp eComparisionOp)
 
void setFilter (const std::string &rsRangeStartIndex, const std::string &rsRangeEndIndex)
 
void setFilter (IndexFilter *pIndexFilter)
 
bool setNearestObject (const std::string &rsIndex)
 
int setPosition (std::size_t nPosition)
 

Protected Member Functions

 ObjectStrIndexIterator ()
 
int getSearchModeAndSearchIndex (std::string &rsSearchIndex, const std::string rsSourceIndex) const
 
bool setNearestObjectInMap (std::map< std::string, ObjStrIdTuple * >::const_iterator &rIterator, const std::string &rsIndex)
 
bool setNearestObjectInMultiMap (std::multimap< std::string, ObjStrIdTuple * >::const_iterator &rIterator, const std::string &rsIndex)
 
bool valueMatchesComparisonFilter (const std::string &rsSearchIndex, IndexComparisionFilter &rIndexComparisionFilter) const
 
bool valueMatchesIndexFilter (const std::string &rsSearchIndex, IndexFilter &rIndexFilter) const
 
bool valueMatchesRangeFilter (const std::string &rsSearchIndex, IndexRangeFilter &rIndexRangeFilter) const
 

Private Attributes

IndexFilterm_pIndexFilter
 
ObjStrIdTuplem_pLastObjectStrIndexItem
 
ObjectStrIndexm_pObjectStrIndex
 

Detailed Description

Has a pointer to an ObjectStrIndex and allows iteration through this index. Is instantiated e.g. for AllSets so that they can iterate independently through StringIndexes.

Author
Helmut Jakoby

Constructor & Destructor Documentation

◆ ObjectStrIndexIterator() [1/3]

glo::IndexPool::ObjectStrIndexIterator::ObjectStrIndexIterator ( )
protected

The default constructor is not available.

◆ ObjectStrIndexIterator() [2/3]

glo::IndexPool::ObjectStrIndexIterator::ObjectStrIndexIterator ( ObjectStrIndex * pObjectStrIndex)

Constructor with parameter passing.

Parameters
[in]pObjectStrIndexPointer to a ObjectStrIndex through which an object of this class can iterate independently.
Exceptions
eut::ErrorNExceptionAn exception is thrown if an error occurs.

◆ ObjectStrIndexIterator() [3/3]

glo::IndexPool::ObjectStrIndexIterator::ObjectStrIndexIterator ( const ObjectStrIndexIterator & rT)

Copy constructor.

Parameters
[in]rTThe data is copied from this object.

◆ ~ObjectStrIndexIterator()

glo::IndexPool::ObjectStrIndexIterator::~ObjectStrIndexIterator ( )

Destructor.

Member Function Documentation

◆ getClassID()

unsigned long glo::IndexPool::ObjectStrIndexIterator::getClassID ( ) const

Returns the class ID from m_pObjectStrIndex.

Returns
The class ID.

◆ getObjectStrIndexSize()

std::size_t glo::IndexPool::ObjectStrIndexIterator::getObjectStrIndexSize ( ) const

Returns the number of elements in the map which manages the stored string indices and object IDs (from m_pObjectStrIndex).

Returns
The number.

◆ getObjStrIdTuple()

int glo::IndexPool::ObjectStrIndexIterator::getObjStrIdTuple ( ObjStrIdTuple & rRetVal,
EnSeekMode eMode )

Returns in passed reference the value of an ObjStrIdTuple from the map that manages the stored string indexes and object IDs, in relation to eMode.

Parameters
[in,out]rRetValThe possibly found ObjStrIdTuple.
[in]eModeThe seek mode.

Parameter examples:

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

◆ getObjStrIdTupleList() [1/3]

int glo::IndexPool::ObjectStrIndexIterator::getObjStrIdTupleList ( std::list< ObjStrIdTuple > & rRetVal,
const std::string & rsIndex,
EnComparisionOp eComparisionOp ) const

Returns in the passed reference the values of the ObjStrIdTuples from the map which manages the stored string indices and object IDs (from m_pObjectStrIndex), in relation to passed parameters. Results can be defined using the parameter eComparisionOp. For example, if rsIndex has the value "123" and eComparisionOp has the value LESS, all objects with an index lower than 123 are returned.

Parameters
[in,out]rRetValThe list with the found ObjStrIdTuple.
[in]rsIndexThe index value.
[in]eComparisionOpThe comparison operator.
Returns
A return value < 0 indicates an error.

◆ getObjStrIdTupleList() [2/3]

int glo::IndexPool::ObjectStrIndexIterator::getObjStrIdTupleList ( std::list< ObjStrIdTuple > & rRetVal,
const std::string & rsIndex,
EnQueryType eQuerryType ) const

Returns in the passed reference the values of the ObjStrIdTuples from the map which manages the stored string indices and object IDs (from m_pObjectStrIndex), in relation to passed parameters.

Parameters
[in,out]rRetValThe list of found ObjStrIdTuples.
[in]rsIndexThe 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 an OQL expression.
[in]eQuerryTypeThe query type.
Returns
A return value < 0 indicates an error.

◆ getObjStrIdTupleList() [3/3]

int glo::IndexPool::ObjectStrIndexIterator::getObjStrIdTupleList ( std::list< ObjStrIdTuple > & rRetVal,
const std::string & rsRangeStartIndex,
const std::string & rsRangeEndIndex ) const

Returns in the passed reference the values of the ObjStrIdTuples from the map which manages the stored string indices and object IDs (from m_pObjectStrIndex), in relation to passed parameters. Results can be defined with a range specification. For example, if parameter sIndex has the value "123" and parameter sRangeEndIndex has the value "155", all objects with an index greater than/equal to 123 and less than/equal to 155 will be delivered.

Parameters
[in,out]rRetValThe list with the found ObjStrIdTuple.
[in]rsRangeStartIndexThe start index value.
[in]rsRangeEndIndexThe end index value.
Returns
A return value < 0 indicates an error.

◆ getSearchModeAndSearchIndex()

int glo::IndexPool::ObjectStrIndexIterator::getSearchModeAndSearchIndex ( std::string & rsSearchIndex,
const std::string rsSourceIndex ) const
protected

Returns a search mode (see return) and the resulting search index from a search string with the possible wildcards '*' and '?'.

Parameters
[in,out]rsSearchIndexThe search index. This goes up to the first wild card, if one exists. If the first character is a wildcard, an empty search index is returned.
[in]rsSourceIndexThe index string.
Returns
The search mode results from the passed rsSourceIndex.
For example, if this is "123" the return value is 0 and the rsSearchIndex is "123".
if "12*" the return value is 1 and the rsSearchIndex is "12".
If "*23" the return value is 2 and the rsSearchIndex is empty.
If no conversion could be done, ERR_PARA_MISMATCH is returned.

◆ inObjectStrIndex() [1/2]

bool glo::IndexPool::ObjectStrIndexIterator::inObjectStrIndex ( const ObjID & rObjID)

Checks if an ObjStrIdTuple with passed object ID is present in the map which manages the stored string indices and object IDs (from m_pObjectStrIndex)

Parameters
[in]rObjIDThe searched object ID.
Returns
If true, then present.

◆ inObjectStrIndex() [2/2]

bool glo::IndexPool::ObjectStrIndexIterator::inObjectStrIndex ( const std::string & rsIndex)

Checks if an ObjStrIdTuple with passed index string exists in the map which manages the stored string indices and object IDs (from m_pObjectStrIndex).

Parameters
[in]rsIndexThe index string to search for.
Returns
If true, then present.

◆ operator=()

IndexPool::ObjectStrIndexIterator & glo::IndexPool::ObjectStrIndexIterator::operator= ( const ObjectStrIndexIterator & rT)

Assignment operator.

Parameters
[in]rTThe data is transferred from this object.

◆ removeFilter()

void glo::IndexPool::ObjectStrIndexIterator::removeFilter ( )

Sets the m_pIndexFilter to NULL_PTR. A possibly existing filter will be removed from memory.

◆ setCurrentObject()

int glo::IndexPool::ObjectStrIndexIterator::setCurrentObject ( const ObjID & rObjID)

Sets the internal iterator to the first position of the passed object ID in the map, which manages the stored string indices and object IDs.

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

◆ setFilter() [1/4]

void glo::IndexPool::ObjectStrIndexIterator::setFilter ( const std::string & rsIndexFilterValue)

Sets the m_pIndexFilter. Any existing filter is removed from memory.

Parameters
[in]rsIndexFilterValueThe filter to be set can contain the placeholders '*' and '?', which will be taken into account in the evaluation.
If not empty, a corresponding IndexFilter is created and stored in m_pIndexFilter.
If rsIndexFilterValue is empty, a possibly existing filter in m_pIndexFilter will be removed from memory.
See also
IndexFilter

◆ setFilter() [2/4]

void glo::IndexPool::ObjectStrIndexIterator::setFilter ( const std::string & rsIndexFilterValue,
EnComparisionOp eComparisionOp )

Sets the m_pIndexFilter. A possibly existing filter is removed from memory.
The filter can be defined in more detail using the parameter eComparisionOp.
If e.g. parameter rsIndexFilterValue has the value "123" and parameter eComparisionOp has the value LESS, all objects with an index greater/equal "123" are filtered out during iteration.

Parameters
[in]rsIndexFilterValueThe filter value. If not empty, a corresponding IndexComparisionFilter is created and stored in m_pIndexFilter. If rsIndexFilterValue is empty, a possibly existing filter in m_pIndexFilter will be removed from memory.
[in]eComparisionOpThe comparison operator.
See also
IndexComparisionFilter

◆ setFilter() [3/4]

void glo::IndexPool::ObjectStrIndexIterator::setFilter ( const std::string & rsRangeStartIndex,
const std::string & rsRangeEndIndex )

Sets the m_pIndexFilter. A possibly existing filter is removed from memory.
Results can be defined with a range specification.
If e.g. parameter rsRangeStartIndex has the value "123" and parameter rsRangeEndIndex has the value "155", all objects with an index lower than "123" and higher than "155" are filtered out during iteration.

Parameters
[in]rsRangeStartIndexThe start index value. If not empty, a corresponding IndexRangeFilter is created and stored in m_pIndexFilter. If rsIndexFilterValue is empty, a possibly existing filter in m_pIndexFilter will be removed from memory.
[in]rsRangeEndIndexThe end index value.
See also
IndexRangeFilter

◆ setFilter() [4/4]

void glo::IndexPool::ObjectStrIndexIterator::setFilter ( IndexFilter * pIndexFilter)

Sets the m_pIndexFilter. A possibly existing filter will be removed.

Parameters
[in]pIndexFilterThe filter to set can also be a NULL_PTR.
Attention
A passed IndexFilter is taken over here. The calling instance must not remove it from memory.
See also
IndexFilter, IndexComparisionFilter und IndexRangeFilter

◆ setNearestObject()

bool glo::IndexPool::ObjectStrIndexIterator::setNearestObject ( const std::string & rsIndex)

Sets the internal iterator to the "next", in the best case to the exact position of the passed string in the map, which manages the stored string indices and object IDs.

Parameters
[in]rsIndexThe index string.
Returns
If true, then the index was found directly, otherwise the next or no index.

◆ setNearestObjectInMap()

bool glo::IndexPool::ObjectStrIndexIterator::setNearestObjectInMap ( std::map< std::string, ObjStrIdTuple * >::const_iterator & rIterator,
const std::string & rsIndex )
protected

Sets passed iterator to the "next", in the best case to the exact position of the passed string in the map, which manages the stored string indices and object IDs (from m_pObjectStrIndex).

Help method for
ObjectStrIndexIterator::getObjStrIdTuple(ObjStrIdTuple *& prRetVal, EnSeekMode eMode)
and
ObjectStrIndexIterator::setNearestObject(const std::string & rsIndex)

Parameters
[in,out]rIteratorThe iterator to set.
[in]rsIndexThe index string.
Returns
If true, then it was found directly, otherwise the next or nothing.

◆ setNearestObjectInMultiMap()

bool glo::IndexPool::ObjectStrIndexIterator::setNearestObjectInMultiMap ( std::multimap< std::string, ObjStrIdTuple * >::const_iterator & rIterator,
const std::string & rsIndex )
protected

Sets passed iterator to the "next", in the best case to the exact position of the passed string in the multimap, which manages the stored string indices and object IDs (from m_pObjectStrIndex).

Help method for
ObjectStrIndexIterator::getObjStrIdTuple(ObjStrIdTuple *& prRetVal, EnSeekMode eMode)
and
ObjectStrIndexIterator::setNearestObject(const std::string & rsIndex)

Parameters
[in,out]rIteratorThe iterator to set.
[in]rsIndexThe index string.
Returns
If true, then it was found directly, otherwise the next or nothing.

◆ setPosition()

int glo::IndexPool::ObjectStrIndexIterator::setPosition ( std::size_t nPosition)

Sets internal iterator to passed position (start is at 0) in the map, which manages the stored string indices and object IDs.

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

◆ valueMatchesComparisonFilter()

bool glo::IndexPool::ObjectStrIndexIterator::valueMatchesComparisonFilter ( const std::string & rsSearchIndex,
IndexComparisionFilter & rIndexComparisionFilter ) const
protected

Compares a passed string with the passed IndexComparisionFilter.

Parameters
[in,out]rsSearchIndexThe search index.
[in]rIndexComparisionFilterThe index filter.
Returns
If true, the search index matches the IndexFilter.

◆ valueMatchesIndexFilter()

bool glo::IndexPool::ObjectStrIndexIterator::valueMatchesIndexFilter ( const std::string & rsSearchIndex,
IndexFilter & rIndexFilter ) const
protected

Compares a passed string with the passed IndexFilter.

Parameters
[in,out]rsSearchIndexThe search index.
[in]rIndexFilterThe index filter.
Returns
If true, the search index matches the IndexFilter.

◆ valueMatchesRangeFilter()

bool glo::IndexPool::ObjectStrIndexIterator::valueMatchesRangeFilter ( const std::string & rsSearchIndex,
IndexRangeFilter & rIndexRangeFilter ) const
protected

Compares a passed string with the passed IndexRangeFilter.

Parameters
[in,out]rsSearchIndexThe search index.
[in]rIndexRangeFilterThe index filter.
Returns
If true, the search index matches the IndexFilter.

Member Data Documentation

◆ m_pIndexFilter

IndexFilter* glo::IndexPool::ObjectStrIndexIterator::m_pIndexFilter
private

A filter that controls the iteration through an ObjectStrIndex.

◆ m_pLastObjectStrIndexItem

ObjStrIdTuple* glo::IndexPool::ObjectStrIndexIterator::m_pLastObjectStrIndexItem
private

The last delivered element (a copy) to be able to start the next iterator step. No own iterator is kept, because between two accesses the referenced element could have been deleted from the ObjectStrIndex.

◆ m_pObjectStrIndex

ObjectStrIndex* glo::IndexPool::ObjectStrIndexIterator::m_pObjectStrIndex
private

Has a pointer to a ObjectStrIndex and allows to iterate through this index. Is instantiated e.g. for AllSets so that they can iterate through indexes independently.


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