casa
5.7.0-16
|
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. More... | |
virtual Bool | atEnd () const =0 |
Check to see if the iterator position is at the end or beginning of the Map. More... | |
virtual Bool | atStart () const =0 |
virtual void | toStart ()=0 |
Move the iterator to the start of the Map. More... | |
virtual void | operator++ ()=0 |
Advance to the next element of the Map. More... | |
virtual void | operator++ (int)=0 |
virtual const key & | getKey () const =0 |
Get the key for the current position in the Map. More... | |
virtual value & | getVal ()=0 |
Return the value at the current location of the map iterator. More... | |
virtual const value & | getVal () const =0 |
const value & | defaultVal () const |
This returns the default value for the map that this iterator is tracking. More... | |
value & | defaultVal () |
value & | define (const key &ky, const value &val) |
These functions allow for the definition and removal of key/value relations. More... | |
void | remove (const key &ky) |
void | clear () |
Clear all of the mappings. More... | |
const value & | operator() (const key &ky) const |
Allows mapping functions to be performed with the map on which this iterator operates. More... | |
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. More... | |
value * | isDefined (const key &ky) |
uInt | ndefined () const |
Returns the number of user defined mappings. More... | |
Map< key, value > & | container () |
Returns the container on which this iterator is operating. More... | |
const Map< key, value > & | container () const |
virtual MapIterRep< key, value > * | Clone ()=0 |
Duplicate a map iterator. More... | |
MapIterRep (Map< key, value > &st) | |
This allows a MapIter to be constructed from a Map. More... | |
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 |
casacore::MapIterRep< key, value >::MapIterRep | ( | Map< key, value > & | st | ) |
casacore::MapIterRep< key, value >::MapIterRep | ( | Map< key, value > * | st | ) |
|
virtual |
|
pure virtual |
Check to see if the iterator position is at the end or beginning of the Map.
Implemented in casacore::OrderedMapIterRep< t, v >.
|
pure virtual |
Implemented in casacore::OrderedMapIterRep< t, v >.
void casacore::MapIterRep< key, value >::clear | ( | ) |
Clear all of the mappings.
|
pure virtual |
Duplicate a map iterator.
Implemented in casacore::OrderedMapIterRep< t, v >.
Map<key,value>& casacore::MapIterRep< key, value >::container | ( | ) |
Returns the container on which this iterator is operating.
Referenced by casacore::OrderedMapIterRep< t, v >::Clone(), casacore::OrderedMapIterRep< t, v >::getKey(), and casacore::OrderedMapIterRep< t, v >::getVal().
const Map<key,value>& casacore::MapIterRep< key, value >::container | ( | ) | const |
const value& casacore::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& casacore::MapIterRep< key, value >::defaultVal | ( | ) |
value& casacore::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.
|
pure virtual |
Get the key for the current position in the Map.
Implemented in casacore::OrderedMapIterRep< t, v >.
|
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 casacore::OrderedMapIterRep< t, v >.
|
pure virtual |
Implemented in casacore::OrderedMapIterRep< t, v >.
const value* casacore::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* casacore::MapIterRep< key, value >::isDefined | ( | const key & | ky | ) |
|
pure virtual |
Check to see if the iterator is in a valid state.
Implemented in casacore::OrderedMapIterRep< t, v >.
uInt casacore::MapIterRep< key, value >::ndefined | ( | ) | const |
Returns the number of user defined mappings.
const value& casacore::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& casacore::MapIterRep< key, value >::operator() | ( | const key & | ky | ) |
|
pure virtual |
Advance to the next element of the Map.
Implemented in casacore::OrderedMapIterRep< t, v >.
|
pure virtual |
Implemented in casacore::OrderedMapIterRep< t, v >.
void casacore::MapIterRep< key, value >::remove | ( | const key & | ky | ) |
|
pure virtual |
Move the iterator to the start of the Map.
Implemented in casacore::OrderedMapIterRep< t, v >.
|
protected |