casa
$Rev:20696$
|
Abstract base class for associative array iterators. More...
#include <Map.h>
Public Types | |
enum | { MapIterRepVersion } |
Public Member Functions | |
virtual Bool | isValid () const =0 |
Check to see if the iterator is in a valid state. | |
virtual Bool | atEnd () const =0 |
Check to see if the iterator position is at the end or beginning of the Map. | |
virtual Bool | atStart () const =0 |
virtual void | toStart ()=0 |
Move the iterator to the start of the Map. | |
virtual void | operator++ ()=0 |
Advance to the next element of the Map. | |
virtual void | operator++ (int)=0 |
virtual const key & | getKey () const =0 |
Get the key for the current position in the Map. | |
virtual value & | getVal ()=0 |
Return the value at the current location of the map iterator. | |
virtual const value & | getVal () const =0 |
const value & | defaultVal () const |
This returns the default value for the map that this iterator is tracking. | |
value & | defaultVal () |
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) |
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) |
uInt | ndefined () const |
Returns the number of user defined mappings. | |
Map< key, value > & | container () |
Returns the container on which this iterator is operating. | |
const Map< key, value > & | container () const |
virtual MapIterRep< key, value > * | Clone ()=0 |
Duplicate a map iterator. | |
MapIterRep (Map< key, value > &st) | |
This allows a MapIter to be constructed from a Map. | |
MapIterRep (Map< key, value > *st) | |
virtual | ~MapIterRep () |
Protected Attributes | |
Map< key, value > * | Container |
Abstract base class for associative array iterators.
This is the abstract base class for all (Const)MapIter "letters". That is all Map specializations must provide a "IterRep" for the particular specialization which will allow the (Const)MapIter envelope to traverse the new type of map.
anonymous enum |
casa::MapIterRep< key, value >::MapIterRep | ( | Map< key, value > & | st | ) |
casa::MapIterRep< key, value >::MapIterRep | ( | Map< key, value > * | st | ) |
virtual casa::MapIterRep< key, value >::~MapIterRep | ( | ) | [virtual] |
virtual Bool casa::MapIterRep< key, value >::atEnd | ( | ) | const [pure virtual] |
Check to see if the iterator position is at the end or beginning of the Map.
Implemented in casa::OrderedMapIterRep< key, value >.
virtual Bool casa::MapIterRep< key, value >::atStart | ( | ) | const [pure virtual] |
Implemented in casa::OrderedMapIterRep< key, value >.
void casa::MapIterRep< key, value >::clear | ( | ) |
Clear all of the mappings.
virtual MapIterRep<key,value>* casa::MapIterRep< key, value >::Clone | ( | ) | [pure virtual] |
Map<key,value>& casa::MapIterRep< key, value >::container | ( | ) |
Returns the container on which this iterator is operating.
Referenced by casa::OrderedMapIterRep< key, value >::Clone(), casa::OrderedMapIterRep< key, value >::getKey(), and casa::OrderedMapIterRep< key, value >::getVal().
const Map<key,value>& casa::MapIterRep< key, value >::container | ( | ) | const |
const value& casa::MapIterRep< key, value >::defaultVal | ( | ) | const |
This returns the default value for the map that this iterator is tracking.
With a non-const iterator the default value can be changed.
value& casa::MapIterRep< key, value >::defaultVal | ( | ) |
value& casa::MapIterRep< key, value >::define | ( | const key & | ky, |
const value & | val | ||
) |
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.
virtual const key& casa::MapIterRep< key, value >::getKey | ( | ) | const [pure virtual] |
Get the key for the current position in the Map.
Implemented in casa::OrderedMapIterRep< key, value >.
virtual value& casa::MapIterRep< key, value >::getVal | ( | ) | [pure 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.
Implemented in casa::OrderedMapIterRep< key, value >.
virtual const value& casa::MapIterRep< key, value >::getVal | ( | ) | const [pure virtual] |
Implemented in casa::OrderedMapIterRep< key, value >.
const value* casa::MapIterRep< key, 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.
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.
value* casa::MapIterRep< key, value >::isDefined | ( | const key & | ky | ) |
virtual Bool casa::MapIterRep< key, value >::isValid | ( | ) | const [pure virtual] |
Check to see if the iterator is in a valid state.
Implemented in casa::OrderedMapIterRep< key, value >.
uInt casa::MapIterRep< key, value >::ndefined | ( | ) | const |
Returns the number of user defined mappings.
const value& casa::MapIterRep< key, value >::operator() | ( | const key & | ky | ) | const |
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.
value& casa::MapIterRep< key, value >::operator() | ( | const key & | ky | ) |
virtual void casa::MapIterRep< key, value >::operator++ | ( | ) | [pure virtual] |
Advance to the next element of the Map.
Implemented in casa::OrderedMapIterRep< key, value >.
virtual void casa::MapIterRep< key, value >::operator++ | ( | int | ) | [pure virtual] |
Implemented in casa::OrderedMapIterRep< key, value >.
void casa::MapIterRep< key, value >::remove | ( | const key & | ky | ) |
virtual void casa::MapIterRep< key, value >::toStart | ( | ) | [pure virtual] |
Move the iterator to the start of the Map.
Implemented in casa::OrderedMapIterRep< key, value >.
Map<key,value>* casa::MapIterRep< key, value >::Container [protected] |