casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
casacore::ConstHashMapIter< key, val > Class Template Reference

#include <HashMap.h>

Inheritance diagram for casacore::ConstHashMapIter< key, val >:
casacore::HashMapIter< key, val >

Public Member Functions

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...
 
virtual ConstHashMapIter< key,
val > & 
operator= (const HashMap< key, val > &other)
 Assign one map iterator to a map (with reference semantics). More...
 
 ConstHashMapIter (const ConstHashMapIter< key, val > &st)
 Constructs a Map iterator from another iterator (with reference semantics). More...
 
virtual ConstHashMapIter< key,
val > & 
operator= (const ConstHashMapIter< key, val > &other)
 Assign one map iterator to 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

void step ()
 

Protected Attributes

ListIter< OrderedPair< key, val > > iter
 
HashMap< key, val > * Container
 
uInt curBucket
 
Bool atEnd_
 

Detailed Description

template<class key, class val>
class casacore::ConstHashMapIter< key, val >

Definition at line 45 of file HashMap.h.

Constructor & Destructor Documentation

template<class key , class val >
casacore::ConstHashMapIter< key, val >::ConstHashMapIter ( const HashMap< key, val > &  st)

Constructs a Map iterator from a Map (with reference semantics).

template<class key , class val >
casacore::ConstHashMapIter< key, val >::ConstHashMapIter ( const ConstHashMapIter< key, val > &  st)

Constructs a Map iterator from another iterator (with reference semantics).

template<class key , class val >
casacore::ConstHashMapIter< key, val >::ConstHashMapIter ( )
inline

Default constructor creates an invalid Map iterator.

Definition at line 147 of file HashMapIter.h.

template<class key , class val >
virtual casacore::ConstHashMapIter< key, val >::~ConstHashMapIter ( )
virtual

dtor

Member Function Documentation

template<class key , class val >
Bool casacore::ConstHashMapIter< key, val >::atEnd ( ) const
inline

Check to see if the iterator position is at the end or beginning of the Map.

Definition at line 115 of file HashMapIter.h.

References casacore::ConstHashMapIter< key, val >::atEnd_.

template<class key , class val >
Bool casacore::ConstHashMapIter< key, val >::atStart ( ) const
template<class key , class val >
const HashMap<key,val>& casacore::ConstHashMapIter< key, val >::container ( ) const
inline

Returns the container on which this iterator is operating.

Definition at line 196 of file HashMapIter.h.

References casacore::ConstHashMapIter< key, val >::Container, casacore::ConstHashMapIter< key, val >::isValid(), and casacore::throw_invalid_hashmapiter_error().

template<class key , class val >
const val& casacore::ConstHashMapIter< key, val >::defaultVal ( ) const
inline

Returns the default value for the Map on which this iterator is operating if it is a valid iterator, otherwise it throws an exception.

Definition at line 155 of file HashMapIter.h.

References casacore::ConstHashMapIter< key, val >::Container, casacore::ConstHashMapIter< key, val >::isValid(), and casacore::throw_invalid_hashmapiter_error().

Referenced by casacore::HashMapIter< key, val >::defaultVal().

template<class key , class val >
const key& casacore::ConstHashMapIter< key, val >::getKey ( ) const

Get the key or value for the current position in the Map.

template<class key , class val >
const val& casacore::ConstHashMapIter< key, val >::getVal ( ) const
template<class key , class val >
Bool casacore::ConstHashMapIter< key, val >::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.

Definition at line 177 of file HashMapIter.h.

References casacore::ConstHashMapIter< key, val >::Container, casacore::ConstHashMapIter< key, val >::isValid(), and casacore::throw_invalid_hashmapiter_error().

template<class key , class val >
Bool casacore::ConstHashMapIter< key, val >::isValid ( ) const
inline
template<class key , class val >
uInt casacore::ConstHashMapIter< key, val >::ndefined ( ) const
inline
template<class key , class val >
const val& casacore::ConstHashMapIter< key, val >::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.

Definition at line 166 of file HashMapIter.h.

References casacore::ConstHashMapIter< key, val >::Container, casacore::ConstHashMapIter< key, val >::isValid(), and casacore::throw_invalid_hashmapiter_error().

Referenced by casacore::HashMapIter< key, val >::operator()().

template<class key , class val >
void casacore::ConstHashMapIter< key, val >::operator++ ( )
inline

Advance to the next element of the Map.

Definition at line 97 of file HashMapIter.h.

References casacore::ConstHashMapIter< key, val >::step().

template<class key , class val >
void casacore::ConstHashMapIter< key, val >::operator++ ( int  )
inline

Definition at line 98 of file HashMapIter.h.

References casacore::ConstHashMapIter< key, val >::step().

template<class key , class val >
virtual ConstHashMapIter<key,val>& casacore::ConstHashMapIter< key, val >::operator= ( const HashMap< key, val > &  other)
virtual

Assign one map iterator to a map (with reference semantics).

Reimplemented in casacore::HashMapIter< key, val >.

template<class key , class val >
virtual ConstHashMapIter<key,val>& casacore::ConstHashMapIter< key, val >::operator= ( const ConstHashMapIter< key, val > &  other)
virtual

Assign one map iterator to another iterator (with reference semantics).

Reimplemented in casacore::HashMapIter< key, val >.

template<class key , class val >
void casacore::ConstHashMapIter< key, val >::step ( )
protected
template<class key , class val >
void casacore::ConstHashMapIter< key, val >::toStart ( )

Move the iterator to the start of the Map.

Member Data Documentation

template<class key , class val >
Bool casacore::ConstHashMapIter< key, val >::atEnd_
protected

Definition at line 212 of file HashMapIter.h.

Referenced by casacore::ConstHashMapIter< key, val >::atEnd().

template<class key , class val >
HashMap<key,val>* casacore::ConstHashMapIter< key, val >::Container
protected
template<class key , class val >
uInt casacore::ConstHashMapIter< key, val >::curBucket
protected

Definition at line 211 of file HashMapIter.h.

template<class key , class val >
ListIter<OrderedPair<key,val> > casacore::ConstHashMapIter< key, val >::iter
protected

Definition at line 209 of file HashMapIter.h.


The documentation for this class was generated from the following files: