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>
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.
- Copyright
- © 2010 Helmut Jakoby
- Author
- Helmut Jakoby
◆ 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] | pObjectStrIndex | Pointer to a ObjectStrIndex through which an object of this class can iterate independently. |
- Exceptions
-
◆ ObjectStrIndexIterator() [3/3]
Copy constructor.
- Parameters
-
[in] | rT | The data is copied from this object. |
◆ ~ObjectStrIndexIterator()
glo::IndexPool::ObjectStrIndexIterator::~ObjectStrIndexIterator |
( |
| ) |
|
◆ getClassID()
unsigned long glo::IndexPool::ObjectStrIndexIterator::getClassID |
( |
| ) |
const |
◆ 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()
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] | rRetVal | The possibly found ObjStrIdTuple. |
[in] | eMode | The 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] | rRetVal | The list with the found ObjStrIdTuple. |
[in] | rsIndex | The index value. |
[in] | eComparisionOp | The 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] | rRetVal | The list of found ObjStrIdTuples. |
[in] | rsIndex | 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 an OQL expression. |
[in] | eQuerryType | The 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] | rRetVal | The list with the found ObjStrIdTuple. |
[in] | rsRangeStartIndex | The start index value. |
[in] | rsRangeEndIndex | The 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] | rsSearchIndex | The 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] | rsSourceIndex | The 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] | rObjID | The 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] | rsIndex | The index string to search for. |
- Returns
- If true, then present.
◆ operator=()
Assignment operator.
- Parameters
-
[in] | rT | The data is transferred from this object. |
◆ removeFilter()
void glo::IndexPool::ObjectStrIndexIterator::removeFilter |
( |
| ) |
|
◆ 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
-
- 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] | rsIndexFilterValue | The 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] | rsIndexFilterValue | The 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] | eComparisionOp | The 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] | rsRangeStartIndex | The 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] | rsRangeEndIndex | The end index value. |
- See also
- IndexRangeFilter
◆ setFilter() [4/4]
void glo::IndexPool::ObjectStrIndexIterator::setFilter |
( |
IndexFilter * | pIndexFilter | ) |
|
◆ 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] | rsIndex | The 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] | rIterator | The iterator to set. |
[in] | rsIndex | The 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] | rIterator | The iterator to set. |
[in] | rsIndex | The 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] | nPosition | The 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] | rsSearchIndex | The search index. |
[in] | rIndexComparisionFilter | The 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] | rsSearchIndex | The search index. |
[in] | rIndexFilter | The 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] | rsSearchIndex | The search index. |
[in] | rIndexRangeFilter | The index filter. |
- Returns
- If true, the search index matches the IndexFilter.
◆ m_pIndexFilter
IndexFilter* glo::IndexPool::ObjectStrIndexIterator::m_pIndexFilter |
|
private |
◆ 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: