casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Protected Member Functions
casa::MapIter< key, value > Class Template Reference

Associative array iterator. More...

#include <Map.h>

Inheritance diagram for casa::MapIter< key, value >:
casa::ConstMapIter< key, value >

List of all members.

Public Types

enum  { MapIterVersion }

Public Member Functions

virtual valuegetVal ()
 Return the value at the current location of the map iterator.
virtual const valuegetVal () const
valuedefine (const key &ky, const value &val)
 These functions allow for the definition and removal of key/value relations.
void remove (const key &ky)
const valuedefaultVal () const
 This returns the default value for the map that this iterator is tracking.
valuedefaultVal ()
void clear ()
 Clear all of the mappings.
const valueoperator() (const key &ky) const
 Allows mapping functions to be performed with the map on which this iterator operates.
valueoperator() (const key &ky)
const valueisDefined (const key &ky) const
 Allows one to check to see if a given key is defined in the map which this iterator tracks.
valueisDefined (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 > &)
 Assign one map iterator to another iterator (with reference semantics).
ConstMapIter< key, value > & operator= (const ConstMapIter< key, value > *)

Detailed Description

template<class key, class value>
class casa::MapIter< key, value >

Associative array iterator.

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25
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.


Member Enumeration Documentation

template<class key, class value>
anonymous enum
Enumerator:
MapIterVersion 

Definition at line 750 of file Map.h.


Constructor & Destructor Documentation

template<class key, class value>
casa::MapIter< key, value >::MapIter ( Map< key, value > *  other) [inline]

This allows a MapIter to be constructed from a Map.

When created the new MapIter maintains a reference to the original Map. If the Map to which this MapIter points is deleted, then the MapIter is marked as invalid.

Definition at line 689 of file Map.h.

template<class key, class value>
casa::MapIter< key, value >::MapIter ( Map< key, value > &  st) [inline]

Definition at line 691 of file Map.h.

template<class key, class value>
casa::MapIter< key, value >::MapIter ( const MapIter< key, value > &  other) [inline]

This allows a MapIter to be constructed from another MapIter.

When created the new MapIter maintains a reference to the Map which the MapIter parameter tracked. If this Map is deleted, then this MapIter is marked as invalid.

Definition at line 701 of file Map.h.

template<class key, class value>
casa::MapIter< key, value >::MapIter ( const MapIter< key, value > *  other) [inline]

Definition at line 704 of file Map.h.

template<class key, class value>
casa::MapIter< key, value >::MapIter ( ) [inline]

Default constructor creates an invalid Map iterator.

Definition at line 711 of file Map.h.

template<class key, class value>
casa::MapIter< key, value >::~MapIter ( ) [inline]

   

Definition at line 748 of file Map.h.


Member Function Documentation

template<class key, class value>
void casa::MapIter< key, value >::clear ( ) [inline]
template<class key, class value>
Map<key,value>& casa::MapIter< key, value >::container ( ) [inline]

Returns the container on which this iterator is operating.

Definition at line 742 of file Map.h.

References casa::ConstMapIter< key, value >::Rep.

template<class key, class value>
const Map<key,value>& casa::MapIter< key, value >::container ( ) const [inline]

Returns the container on which this iterator is operating.

Reimplemented from casa::ConstMapIter< key, value >.

Definition at line 744 of file Map.h.

template<class key, class value>
const value& casa::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 casa::ConstMapIter< key, value >.

Definition at line 625 of file Map.h.

template<class key, class value>
value& casa::MapIter< key, value >::defaultVal ( ) [inline]
template<class key, class value>
value& casa::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 casa::ConstMapIter< key, value >::isValid(), casa::ConstMapIter< key, value >::Rep, and casa::throw_invalid_mapiter_error().

template<class key, class value>
virtual value& casa::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.

template<class key, class value>
virtual const value& casa::MapIter< key, value >::getVal ( ) const [virtual]

Reimplemented from casa::ConstMapIter< key, value >.

template<class key, class value>
const value* casa::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 casa::ConstMapIter< key, value >.

Definition at line 671 of file Map.h.

template<class key, class value>
value* casa::MapIter< key, value >::isDefined ( const key &  ky) [inline]
template<class key, class value>
const value& casa::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 casa::ConstMapIter< key, value >.

Definition at line 652 of file Map.h.

template<class key, class value>
value& casa::MapIter< key, value >::operator() ( const key &  ky) [inline]
template<class key, class value>
virtual MapIter<key,value>& casa::MapIter< key, value >::operator= ( Map< key, value > &  other) [virtual]

This assignment operator allows the Map which this MapIter tracks to be changed.

After a call to this operator, the MapIter will track the Map parameter.

template<class key, class value>
virtual MapIter<key,value>& casa::MapIter< key, value >::operator= ( Map< key, value > *  other) [virtual]
template<class key, class value>
virtual MapIter<key,value>& casa::MapIter< key, value >::operator= ( const MapIter< key, value > &  other) [virtual]

This assignment operator allows the Map which this MapIter tracks to be changed.

After a call to this operator, this MapIter will track the Map which the MapIter parameter trackes, i.e. it will contain a reference to this new Map.

template<class key, class value>
virtual MapIter<key,value>& casa::MapIter< key, value >::operator= ( const MapIter< key, value > *  other) [virtual]
template<class key, class value>
ConstMapIter<key,value>& casa::MapIter< key, value >::operator= ( const Map< key, value > &  other) [inline, protected, virtual]

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

Reimplemented from casa::ConstMapIter< key, value >.

Definition at line 760 of file Map.h.

References casa::throw_mapiter_init_error().

template<class key, class value>
ConstMapIter<key,value>& casa::MapIter< key, value >::operator= ( const Map< key, value > *  ) [inline, protected, virtual]

Reimplemented from casa::ConstMapIter< key, value >.

Definition at line 763 of file Map.h.

References casa::throw_mapiter_init_error().

template<class key, class value>
ConstMapIter<key,value>& casa::MapIter< key, value >::operator= ( const ConstMapIter< key, value > &  other) [inline, protected, virtual]

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

Reimplemented from casa::ConstMapIter< key, value >.

Definition at line 766 of file Map.h.

References casa::throw_mapiter_init_error().

template<class key, class value>
ConstMapIter<key,value>& casa::MapIter< key, value >::operator= ( const ConstMapIter< key, value > *  ) [inline, protected, virtual]

Reimplemented from casa::ConstMapIter< key, value >.

Definition at line 769 of file Map.h.

References casa::throw_mapiter_init_error().

template<class key, class value>
void casa::MapIter< key, value >::remove ( const key &  ky) [inline]

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