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 > &) |
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().
Definition at line 586 of file Map.h.
anonymous enum |
casacore::MapIter< key, value >::MapIter | ( | Map< key, value > * | other | ) | [inline] |
casacore::MapIter< key, value >::MapIter | ( | Map< key, value > & | st | ) | [inline] |
casacore::MapIter< key, value >::MapIter | ( | const MapIter< key, value > & | other | ) | [inline] |
casacore::MapIter< key, value >::MapIter | ( | const MapIter< key, value > * | other | ) | [inline] |
casacore::MapIter< key, value >::MapIter | ( | ) | [inline] |
casacore::MapIter< key, value >::~MapIter | ( | ) | [inline] |
void casacore::MapIter< key, value >::clear | ( | ) | [inline] |
Clear all of the mappings.
Definition at line 639 of file Map.h.
References casacore::ConstMapIter< key, value >::isValid(), casacore::ConstMapIter< key, value >::Rep, and casacore::throw_invalid_mapiter_error().
const Map<key,value>& casacore::MapIter< key, value >::container | ( | ) | const [inline] |
Returns the container on which this iterator is operating.
Reimplemented from casacore::ConstMapIter< key, value >.
Map<key,value>& casacore::MapIter< key, value >::container | ( | ) | [inline] |
Returns the container on which this iterator is operating.
Definition at line 742 of file Map.h.
References casacore::ConstMapIter< key, value >::Rep.
value& casacore::MapIter< key, value >::defaultVal | ( | ) | [inline] |
Definition at line 629 of file Map.h.
References casacore::ConstMapIter< key, value >::isValid(), casacore::ConstMapIter< key, value >::Rep, and casacore::throw_invalid_mapiter_error().
const value& casacore::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 casacore::ConstMapIter< key, value >.
value& casacore::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 casacore::ConstMapIter< key, value >::isValid(), casacore::ConstMapIter< key, value >::Rep, and casacore::throw_invalid_mapiter_error().
virtual const value& casacore::MapIter< key, value >::getVal | ( | ) | const [virtual] |
Reimplemented from casacore::ConstMapIter< key, value >.
virtual value& casacore::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.
value* casacore::MapIter< key, value >::isDefined | ( | const key & | ky | ) | [inline] |
Definition at line 675 of file Map.h.
References casacore::ConstMapIter< key, value >::isValid(), casacore::ConstMapIter< key, value >::Rep, and casacore::throw_invalid_mapiter_error().
const value* casacore::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 casacore::ConstMapIter< key, value >.
value& casacore::MapIter< key, value >::operator() | ( | const key & | ky | ) | [inline] |
Definition at line 656 of file Map.h.
References casacore::ConstMapIter< key, value >::isValid(), casacore::ConstMapIter< key, value >::Rep, and casacore::throw_invalid_mapiter_error().
const value& casacore::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 casacore::ConstMapIter< key, value >.
ConstMapIter<key,value>& casacore::MapIter< key, value >::operator= | ( | const ConstMapIter< key, value > * | ) | [inline, protected] |
Definition at line 769 of file Map.h.
References casacore::throw_mapiter_init_error().
ConstMapIter<key,value>& casacore::MapIter< key, value >::operator= | ( | const ConstMapIter< key, value > & | ) | [inline, protected] |
Definition at line 766 of file Map.h.
References casacore::throw_mapiter_init_error().
ConstMapIter<key,value>& casacore::MapIter< key, value >::operator= | ( | const Map< key, value > * | ) | [inline, protected, virtual] |
Reimplemented from casacore::ConstMapIter< key, value >.
Definition at line 763 of file Map.h.
References casacore::throw_mapiter_init_error().
ConstMapIter<key,value>& casacore::MapIter< key, value >::operator= | ( | const Map< key, value > & | other | ) | [inline, protected, virtual] |
Assign one map iterator to a map (with reference semantics).
Reimplemented from casacore::ConstMapIter< key, value >.
Definition at line 760 of file Map.h.
References casacore::throw_mapiter_init_error().
virtual MapIter<key,value>& casacore::MapIter< key, value >::operator= | ( | const MapIter< key, value > * | other | ) | [virtual] |
Reimplemented from casacore::ConstMapIter< key, value >.
virtual MapIter<key,value>& casacore::MapIter< key, value >::operator= | ( | const MapIter< key, value > & | other | ) | [virtual] |
virtual MapIter<key,value>& casacore::MapIter< key, value >::operator= | ( | Map< key, value > * | other | ) | [virtual] |
virtual MapIter<key,value>& casacore::MapIter< key, value >::operator= | ( | Map< key, value > & | other | ) | [virtual] |
void casacore::MapIter< key, value >::remove | ( | const key & | ky | ) | [inline] |
Definition at line 612 of file Map.h.
References casacore::ConstMapIter< key, value >::isValid(), casacore::ConstMapIter< key, value >::Rep, and casacore::throw_invalid_mapiter_error().