casa
5.7.0-16
|
Step through a non-const HashMap. More...
#include <HashMapIter.h>
Public Member Functions | |
val & | getVal () |
Get the key or value for the current position in the Map. More... | |
virtual const val & | getVal () const |
val & | define (const key &k, const val &v) |
These functions allow for the definition and removal of key/value relations. More... | |
void | remove (const key &k) |
const val & | defaultVal () const |
This returns the default value for the map that this iterator is tracking. More... | |
val & | defaultVal () |
void | clear () |
Clear all of the mappings. More... | |
const val & | operator() (const key &ky) const |
Allows mapping functions to be performed with the map on which this iterator operates. More... | |
val & | operator() (const key &ky) |
HashMapIter (HashMap< key, val > &st) | |
This allows a MapIter to be constructed from a Map. More... | |
HashMapIter (const HashMapIter< key, val > &other) | |
This allows a MapIter to be constructed from another MapIter. More... | |
HashMapIter () | |
Default constructor creates an invalid Map iterator. More... | |
virtual HashMapIter< key, val > & | operator= (HashMap< key, val > &other) |
This assignment operator allows the Map which this MapIter tracks to be changed. More... | |
virtual HashMapIter< key, val > & | operator= (const HashMapIter< key, val > &other) |
This assignment operator allows the Map which this MapIter tracks to be changed. More... | |
HashMap< key, val > & | container () |
Returns the container on which this iterator is operating. More... | |
const HashMap< key, val > & | container () const |
~HashMapIter () | |
dtor More... | |
Public Member Functions inherited from casacore::ConstHashMapIter< key, val > | |
void | toStart () |
Move the iterator to the start of the Map. More... | |
void | operator++ () |
Advance to the next element of the Map. More... | |
void | operator++ (int) |
const key & | getKey () const |
Get the key or value for the current position in the Map. More... | |
const val & | getVal () const |
Bool | atEnd () const |
Check to see if the iterator position is at the end or beginning of the Map. More... | |
Bool | atStart () const |
Bool | isValid () const |
Check to see if the iterator is in a valid state. More... | |
ConstHashMapIter (const HashMap< key, val > &st) | |
Constructs a Map iterator from a Map (with reference semantics). More... | |
ConstHashMapIter (const ConstHashMapIter< key, val > &st) | |
Constructs a Map iterator from another iterator (with reference semantics). More... | |
ConstHashMapIter () | |
Default constructor creates an invalid Map iterator. More... | |
const val & | defaultVal () const |
Returns the default value for the Map on which this iterator is operating if it is a valid iterator, otherwise it throws an exception. More... | |
const val & | operator() (const key &ky) const |
Allows mapping functions to be performed with the map on which this iterator operates. More... | |
Bool | 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... | |
uInt | ndefined () const |
Returns the number of user defined mappings. More... | |
const HashMap< key, val > & | container () const |
Returns the container on which this iterator is operating. More... | |
virtual | ~ConstHashMapIter () |
dtor More... | |
Protected Member Functions | |
ConstHashMapIter< key, val > & | operator= (const HashMap< key, val > &) |
Assign one map iterator to a map (with reference semantics). More... | |
ConstHashMapIter< key, val > & | operator= (const ConstHashMapIter< key, val > &) |
Assign one map iterator to another iterator (with reference semantics). More... | |
Protected Member Functions inherited from casacore::ConstHashMapIter< key, val > | |
void | step () |
Additional Inherited Members | |
Protected Attributes inherited from casacore::ConstHashMapIter< key, val > | |
ListIter< OrderedPair< key, val > > | iter |
HashMap< key, val > * | Container |
uInt | curBucket |
Bool | atEnd_ |
Step through a non-const HashMap.
Public interface
This class is an iterator, and it used to step through non-const HashMap
s. This is useful when one wishes to find each of the user defined mappings in a particular map.
Same as ConstHashMapIter
, but allows for modification of the underlying structure.
Definition at line 257 of file HashMapIter.h.
|
inline |
|
inline |
|
inline |
Default constructor creates an invalid Map iterator.
Definition at line 351 of file HashMapIter.h.
casacore::HashMapIter< key, val >::~HashMapIter | ( | ) |
dtor
|
inline |
Clear all of the mappings.
Definition at line 308 of file HashMapIter.h.
References casacore::ConstHashMapIter< key, val >::Container, casacore::ConstHashMapIter< key, val >::isValid(), and casacore::throw_invalid_hashmapiter_error().
|
inline |
Returns the container on which this iterator is operating.
Definition at line 374 of file HashMapIter.h.
References casacore::ConstHashMapIter< key, val >::Container, casacore::ConstHashMapIter< key, val >::isValid(), and casacore::throw_invalid_hashmapiter_error().
|
inline |
Definition at line 379 of file HashMapIter.h.
References casacore::ConstHashMapIter< key, val >::Container, casacore::ConstHashMapIter< key, val >::isValid(), and casacore::throw_invalid_hashmapiter_error().
|
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.
Definition at line 294 of file HashMapIter.h.
References casacore::ConstHashMapIter< key, val >::defaultVal().
|
inline |
Definition at line 298 of file HashMapIter.h.
References casacore::ConstHashMapIter< key, val >::Container, casacore::ConstHashMapIter< key, val >::isValid(), and casacore::throw_invalid_hashmapiter_error().
|
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 276 of file HashMapIter.h.
References casacore::ConstHashMapIter< key, val >::Container, casacore::ConstHashMapIter< key, val >::isValid(), and casacore::throw_invalid_hashmapiter_error().
val& casacore::HashMapIter< key, val >::getVal | ( | ) |
Get the key or value for the current position in the Map.
|
virtual |
|
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.
Definition at line 321 of file HashMapIter.h.
References casacore::ConstHashMapIter< key, val >::operator()().
|
inline |
Definition at line 325 of file HashMapIter.h.
References casacore::ConstHashMapIter< key, val >::Container, casacore::ConstHashMapIter< key, val >::isValid(), and casacore::throw_invalid_hashmapiter_error().
|
virtual |
|
virtual |
|
inlineprotectedvirtual |
Assign one map iterator to a map (with reference semantics).
Reimplemented from casacore::ConstHashMapIter< key, val >.
Definition at line 397 of file HashMapIter.h.
References casacore::throw_hashmapiter_init_error().
|
inlineprotectedvirtual |
Assign one map iterator to another iterator (with reference semantics).
Reimplemented from casacore::ConstHashMapIter< key, val >.
Definition at line 400 of file HashMapIter.h.
References casacore::throw_hashmapiter_init_error().
|
inline |
Definition at line 281 of file HashMapIter.h.
References casacore::ConstHashMapIter< key, val >::Container, casacore::ConstHashMapIter< key, val >::isValid(), and casacore::throw_invalid_hashmapiter_error().