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

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

#include <GloIndexPool.h>

Public Member Functions

 TableObjIdIndexIterator (const TableObjIdIndexIterator &rT)
 
 TableObjIdIndexIterator (TableObjIdIndex *pTableObjIdIndex)
 
 ~TableObjIdIndexIterator ()
 
unsigned long getClassID () const
 
int getObjIdPosTuple (ObjIdPosTuple *&prRetVal, EnSeekMode eMode)
 
std::size_t getTableObjIdIndexSize () const
 
bool inObjIdIndex (const ObjID &rObjID)
 
IndexPool::TableObjIdIndexIteratoroperator= (const TableObjIdIndexIterator &rT)
 
int setCurrentObject (const ObjID &rObjID)
 
bool setNearestObject (const ObjID &rObjID)
 
int setPosition (std::size_t nPosition)
 
void setWithSubClasses (bool bWithSubClasses)
 
bool withSubClasses () const
 

Protected Member Functions

 TableObjIdIndexIterator ()
 
bool setNearestObject (std::map< ObjID, ObjIdPosTuple * >::iterator &rIterator, const ObjID &rObjID)
 

Private Attributes

bool m_bWithSubClasses
 
ObjIdPosTuplem_pLastTableObjIdIndexItem
 
TableObjIdIndexm_pTableObjIdIndex
 

Detailed Description

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

Author
Helmut Jakoby

Constructor & Destructor Documentation

◆ TableObjIdIndexIterator() [1/3]

glo::IndexPool::TableObjIdIndexIterator::TableObjIdIndexIterator ( )
protected

The default constructor is not available.

◆ TableObjIdIndexIterator() [2/3]

glo::IndexPool::TableObjIdIndexIterator::TableObjIdIndexIterator ( TableObjIdIndex * pTableObjIdIndex)

Constructor with parameter passing.

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

◆ TableObjIdIndexIterator() [3/3]

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

Copy constructor.

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

◆ ~TableObjIdIndexIterator()

glo::IndexPool::TableObjIdIndexIterator::~TableObjIdIndexIterator ( )

Destructor.

Member Function Documentation

◆ getClassID()

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

Returns the class ID from m_pTableObjIdIndex.

Returns
The class ID.

◆ getObjIdPosTuple()

int glo::IndexPool::TableObjIdIndexIterator::getObjIdPosTuple ( ObjIdPosTuple *& prRetVal,
EnSeekMode eMode )

Returns in passed reference a pointer to a copied ObjIdPosTuple from the map that manages the stored object IDs and their table position, in relation to eMode.

Parameters
[in,out]prRetValThe objects found, if any
[in]eModeThe seek mode.

Parameter examples:

Returns
A return < 0 indicates an error.
A return == ERR_RANGE indicates the end of the list.
Attention
The calling instance must remove the returned object from memory.

◆ getTableObjIdIndexSize()

std::size_t glo::IndexPool::TableObjIdIndexIterator::getTableObjIdIndexSize ( ) const

Returns the number of elements in the map which manages the stored object IDs and their table position from m_pTableObjIdIndex.

Returns
The quantity.

◆ inObjIdIndex()

bool glo::IndexPool::TableObjIdIndexIterator::inObjIdIndex ( const ObjID & rObjID)

Checks if an ObjIdPosTuple with passed object ID exists in the map, which manages the stored object IDs and their table position.

Parameters
[in]rObjIDThe object ID you are looking for.
Returns
If true, it exists.

◆ operator=()

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

Assignment operator.

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

◆ setCurrentObject()

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

Sets the internal iterator to the position of the passed object ID in the map, which manages the stored object IDs and their table position.

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

◆ setNearestObject() [1/2]

bool glo::IndexPool::TableObjIdIndexIterator::setNearestObject ( const ObjID & rObjID)

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

Parameters
[in]rObjIDThe object ID.
Returns
If true, then was found directly, otherwise the next or none.

◆ setNearestObject() [2/2]

bool glo::IndexPool::TableObjIdIndexIterator::setNearestObject ( std::map< ObjID, ObjIdPosTuple * >::iterator & rIterator,
const ObjID & rObjID )
protected

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

Help method for
TableObjIdIndexIterator::getObjIdPosTuple(ObjIdPosTuple *& prRetVal, EnSeekMode eMode)
and
TableObjIdIndexIterator::setNearestObject(const ObjID & rObjID)

Parameters
[in,out]rIteratorThe iterator to set.
[in]rObjIDThe object ID.
Returns
If true, then the object was found directly, otherwise the next or nothing.

◆ setPosition()

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

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

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

◆ setWithSubClasses()

void glo::IndexPool::TableObjIdIndexIterator::setWithSubClasses ( bool bWithSubClasses)

Sets m_bWithSubClasses.

Parameters
[in]bWithSubClassesIf true, the ObjIdPosTuple of the subclasses are also returned for queries, otherwise not.

◆ withSubClasses()

bool glo::IndexPool::TableObjIdIndexIterator::withSubClasses ( ) const

Returns m_bWithSubClasses.

Returns
If true, the ObjIdPosTuple of the subclasses are also returned for queries, otherwise not.

Member Data Documentation

◆ m_bWithSubClasses

bool glo::IndexPool::TableObjIdIndexIterator::m_bWithSubClasses
private

If set, then the ObjIdPosTuple of the subclasses are also returned, otherwise not. The referenced TableObjIdIndex has a class ID, but also manages the subclasses.

◆ m_pLastTableObjIdIndexItem

ObjIdPosTuple* glo::IndexPool::TableObjIdIndexIterator::m_pLastTableObjIdIndexItem
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 m_pTableObjIdIndex.

◆ m_pTableObjIdIndex

TableObjIdIndex* glo::IndexPool::TableObjIdIndexIterator::m_pTableObjIdIndex
private

A pointer to a TableObjIdIndex, through which an object of this class can iterate independently.


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