casa
$Rev:20696$
|
Associative array iterator. More...
#include <Map.h>
Public Types | |
enum | { MapIterVersion } |
Public Member Functions | |
virtual value & | getVal () |
Return the value at the current location of the map iterator. | |
virtual const value & | getVal () const |
value & | define (const key &ky, const value &val) |
These functions allow for the definition and removal of key/value relations. | |
void | remove (const key &ky) |
const value & | defaultVal () const |
This returns the default value for the map that this iterator is tracking. | |
value & | defaultVal () |
void | clear () |
Clear all of the mappings. | |
const value & | operator() (const key &ky) const |
Allows mapping functions to be performed with the map on which this iterator operates. | |
value & | operator() (const key &ky) |
const value * | isDefined (const key &ky) const |
Allows one to check to see if a given key is defined in the map which this iterator tracks. | |
value * | isDefined (const key &ky) |
MapIter (Map< key, value > *other) | |
This allows a MapIter to be constructed from a Map. | |
MapIter (Map< key, value > &st) | |
MapIter (const MapIter< key, value > &other) | |
This allows a MapIter to be constructed from another MapIter. | |
MapIter (const MapIter< key, value > *other) | |
MapIter () | |
Default constructor creates an invalid Map iterator. | |
virtual MapIter< key, value > & | operator= (Map< key, value > &other) |
This assignment operator allows the Map which this MapIter tracks to be changed. | |
virtual MapIter< key, value > & | operator= (Map< key, value > *other) |
virtual MapIter< key, value > & | operator= (const MapIter< key, value > &other) |
This assignment operator allows the Map which this MapIter tracks to be changed. | |
virtual MapIter< key, value > & | operator= (const MapIter< key, value > *other) |
Map< key, value > & | container () |
Returns the container on which this iterator is operating. | |
const Map< key, value > & | container () const |
Returns the container on which this iterator is operating. | |
~MapIter () | |
Protected Member Functions | |
ConstMapIter< key, value > & | operator= (const Map< key, value > &) |
Assign one map iterator to a map (with reference semantics). | |
ConstMapIter< key, value > & | operator= (const Map< key, value > *) |
ConstMapIter< key, value > & | operator= (const ConstMapIter< key, value > &) |
Assign one map iterator to another iterator (with reference semantics). | |
ConstMapIter< key, value > & | operator= (const ConstMapIter< key, value > *) |
Associative array iterator.
This class implements the mechanism for traversing associative arrays, i.e. "Map"s. It provides the traversal mechanisms of the ConstMapIter, but adds the mechansims to modify the values, and perform other modification functions which the Maps provide, e.g. define().
anonymous enum |
casa::MapIter< key, value >::MapIter | ( | Map< key, value > * | other | ) | [inline] |
casa::MapIter< key, value >::MapIter | ( | Map< key, value > & | st | ) | [inline] |
casa::MapIter< key, value >::MapIter | ( | const MapIter< key, value > & | other | ) | [inline] |
casa::MapIter< key, value >::MapIter | ( | const MapIter< key, value > * | other | ) | [inline] |
casa::MapIter< key, value >::MapIter | ( | ) | [inline] |
casa::MapIter< key, value >::~MapIter | ( | ) | [inline] |
void casa::MapIter< key, value >::clear | ( | ) | [inline] |
Clear all of the mappings.
Definition at line 639 of file Map.h.
References casa::ConstMapIter< key, value >::isValid(), casa::ConstMapIter< key, value >::Rep, and casa::throw_invalid_mapiter_error().
Map<key,value>& casa::MapIter< key, value >::container | ( | ) | [inline] |
Returns the container on which this iterator is operating.
Definition at line 742 of file Map.h.
References casa::ConstMapIter< key, value >::Rep.
const Map<key,value>& casa::MapIter< key, value >::container | ( | ) | const [inline] |
Returns the container on which this iterator is operating.
Reimplemented from casa::ConstMapIter< key, value >.
const value& casa::MapIter< key, value >::defaultVal | ( | ) | const [inline] |
This returns the default value for the map that this iterator is tracking.
With a non-const iterator the default value can be changed.
Reimplemented from casa::ConstMapIter< key, value >.
value& casa::MapIter< key, value >::defaultVal | ( | ) | [inline] |
Definition at line 629 of file Map.h.
References casa::ConstMapIter< key, value >::isValid(), casa::ConstMapIter< key, value >::Rep, and casa::throw_invalid_mapiter_error().
value& casa::MapIter< key, value >::define | ( | const key & | ky, |
const value & | val | ||
) | [inline] |
These functions allow for the definition and removal of key/value relations.
The "define(key &, value &)" function defines a key/value relation, and "remove(key &)" function removes a relation if it has been previously defined.
Definition at line 607 of file Map.h.
References casa::ConstMapIter< key, value >::isValid(), casa::ConstMapIter< key, value >::Rep, and casa::throw_invalid_mapiter_error().
virtual value& casa::MapIter< key, value >::getVal | ( | ) | [virtual] |
Return the value at the current location of the map iterator.
Should throw an exception if the iterator is "past the end of the Map" or if the iterator is invalid.
virtual const value& casa::MapIter< key, value >::getVal | ( | ) | const [virtual] |
Reimplemented from casa::ConstMapIter< key, value >.
const value* casa::MapIter< key, value >::isDefined | ( | const key & | ky | ) | const [inline] |
Allows one to check to see if a given key is defined in the map which this iterator tracks.
If this iterator is invalid, then an exception will be thrown. With a non-const iterator the returned pointer can be used to change the value in the map.
Reimplemented from casa::ConstMapIter< key, value >.
value* casa::MapIter< key, value >::isDefined | ( | const key & | ky | ) | [inline] |
Definition at line 675 of file Map.h.
References casa::ConstMapIter< key, value >::isValid(), casa::ConstMapIter< key, value >::Rep, and casa::throw_invalid_mapiter_error().
const value& casa::MapIter< key, value >::operator() | ( | const key & | ky | ) | const [inline] |
Allows mapping functions to be performed with the map on which this iterator operates.
If this iterator is invalid, then an exception will be thrown. With a non-const operator, the value can be changed.
Reimplemented from casa::ConstMapIter< key, value >.
value& casa::MapIter< key, value >::operator() | ( | const key & | ky | ) | [inline] |
Definition at line 656 of file Map.h.
References casa::ConstMapIter< key, value >::isValid(), casa::ConstMapIter< key, value >::Rep, and casa::throw_invalid_mapiter_error().
virtual MapIter<key,value>& casa::MapIter< key, value >::operator= | ( | Map< key, value > * | other | ) | [virtual] |
virtual MapIter<key,value>& casa::MapIter< key, value >::operator= | ( | const MapIter< key, value > * | other | ) | [virtual] |
ConstMapIter<key,value>& casa::MapIter< key, value >::operator= | ( | const Map< key, value > & | other | ) | [inline, protected, virtual] |
Assign one map iterator to a map (with reference semantics).
Reimplemented from casa::ConstMapIter< key, value >.
Definition at line 760 of file Map.h.
References casa::throw_mapiter_init_error().
ConstMapIter<key,value>& casa::MapIter< key, value >::operator= | ( | const Map< key, value > * | ) | [inline, protected, virtual] |
Reimplemented from casa::ConstMapIter< key, value >.
Definition at line 763 of file Map.h.
References casa::throw_mapiter_init_error().
ConstMapIter<key,value>& casa::MapIter< key, value >::operator= | ( | const ConstMapIter< key, value > & | other | ) | [inline, protected, virtual] |
Assign one map iterator to another iterator (with reference semantics).
Reimplemented from casa::ConstMapIter< key, value >.
Definition at line 766 of file Map.h.
References casa::throw_mapiter_init_error().
ConstMapIter<key,value>& casa::MapIter< key, value >::operator= | ( | const ConstMapIter< key, value > * | ) | [inline, protected, virtual] |
Reimplemented from casa::ConstMapIter< key, value >.
Definition at line 769 of file Map.h.
References casa::throw_mapiter_init_error().
void casa::MapIter< key, value >::remove | ( | const key & | ky | ) | [inline] |
Definition at line 612 of file Map.h.
References casa::ConstMapIter< key, value >::isValid(), casa::ConstMapIter< key, value >::Rep, and casa::throw_invalid_mapiter_error().