UCommon
ost::MapIndex Class Reference

The MapIndex allows linear access into a MapTable, that otherwise could have its elements being retrieved only by key. More...

#include <object.h>

Public Member Functions

 MapIndex ()
 Creates an empty map index (pointing to nothing).
 
 MapIndex (const MapIndex &theIndex)
 Creates a copy of a given map index.
 
 MapIndex (MapObject *theObject)
 Creates a map index pointing to a specific map object.
 
bool operator!= (const MapIndex &theIndex) const
 
bool operator!= (const MapObject *theObject) const
 
void * operator* () const
 Dereference operator: the pointed object it is returned as void * for easy re-cast.
 
MapIndexoperator++ ()
 Prefix increment operator, to be used in loops and such.
 
MapIndex operator++ (int)
 Postfix increment operator, to be used in loops and such.
 
MapIndexoperator= (MapObject *theObject)
 Assignment operator to avoid implicit cast.
 
bool operator== (const MapIndex &theIndex) const
 Comparison operator, between two MapIndex's.
 
bool operator== (const MapObject *theObject) const
 Comparison operator, between the MapIndex and a MapObject, useful to avoid casts for sake of clearness.
 

Detailed Description

The MapIndex allows linear access into a MapTable, that otherwise could have its elements being retrieved only by key.

It can be increased, checked and dereferenced like a pointer, by means of suitable operators.

Author
Sergio Repetto s.rep.nosp@m.etto.nosp@m.@pent.nosp@m.aeng.nosp@m.ineer.nosp@m.ing..nosp@m.it

Index object to access MapTable elements

Definition at line 492 of file object.h.

Constructor & Destructor Documentation

◆ MapIndex() [1/3]

ost::MapIndex::MapIndex ( )
inline

Creates an empty map index (pointing to nothing).

Definition at line 501 of file object.h.

◆ MapIndex() [2/3]

ost::MapIndex::MapIndex ( MapObject * theObject)
inline

Creates a map index pointing to a specific map object.

Parameters
theindexed object

Definition at line 508 of file object.h.

◆ MapIndex() [3/3]

ost::MapIndex::MapIndex ( const MapIndex & theIndex)
inline

Creates a copy of a given map index.

Parameters
thesource index object

Definition at line 515 of file object.h.

Member Function Documentation

◆ operator!=() [1/2]

bool ost::MapIndex::operator!= ( const MapIndex & theIndex) const
inline

Definition at line 559 of file object.h.

◆ operator!=() [2/2]

bool ost::MapIndex::operator!= ( const MapObject * theObject) const
inline

Definition at line 573 of file object.h.

◆ operator*()

void * ost::MapIndex::operator* ( ) const
inline

Dereference operator: the pointed object it is returned as void * for easy re-cast.

Returns
pointer to indexed object.

Definition at line 523 of file object.h.

◆ operator++() [1/2]

MapIndex & ost::MapIndex::operator++ ( )

Prefix increment operator, to be used in loops and such.

Returns
the object itself, as changed.

◆ operator++() [2/2]

MapIndex ost::MapIndex::operator++ ( int )
inline

Postfix increment operator, to be used in loops and such.

Returns
the object itself, as changed.

Definition at line 546 of file object.h.

◆ operator=()

MapIndex & ost::MapIndex::operator= ( MapObject * theObject)

Assignment operator to avoid implicit cast.

Returns
the object itself, as changed.

◆ operator==() [1/2]

bool ost::MapIndex::operator== ( const MapIndex & theIndex) const
inline

Comparison operator, between two MapIndex's.

Returns
the object itself, as changed.

Definition at line 555 of file object.h.

◆ operator==() [2/2]

bool ost::MapIndex::operator== ( const MapObject * theObject) const
inline

Comparison operator, between the MapIndex and a MapObject, useful to avoid casts for sake of clearness.

Returns
the object itself, as changed.

Definition at line 569 of file object.h.


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