casacore
Public Types | Public Member Functions | Protected Attributes | List of all members
casacore::MapIterRep< key, value > Class Template Referenceabstract

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 valuegetVal ()=0
 Return the value at the current location of the map iterator. More...
 
virtual const valuegetVal () const =0
 
const valuedefaultVal () const
 This returns the default value for the map that this iterator is tracking. More...
 
valuedefaultVal ()
 
valuedefine (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 valueoperator() (const key &ky) const
 Allows mapping functions to be performed with the map on which this iterator operates. More...
 
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. More...
 
valueisDefined (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
 

Detailed Description

template<class key, class value>
class casacore::MapIterRep< key, value >

Abstract base class for associative array iterators.

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

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.

Definition at line 277 of file Map.h.

Member Enumeration Documentation

◆ anonymous enum

template<class key , class value >
anonymous enum
Enumerator
MapIterRepVersion 

Definition at line 407 of file Map.h.

Constructor & Destructor Documentation

◆ MapIterRep() [1/2]

template<class key , class value >
casacore::MapIterRep< key, value >::MapIterRep ( Map< key, value > &  st)

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.

◆ MapIterRep() [2/2]

template<class key , class value >
casacore::MapIterRep< key, value >::MapIterRep ( Map< key, value > *  st)

◆ ~MapIterRep()

template<class key , class value >
virtual casacore::MapIterRep< key, value >::~MapIterRep ( )
virtual

Member Function Documentation

◆ atEnd()

template<class key , class value >
virtual Bool casacore::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 casacore::OrderedMapIterRep< key, value >.

◆ atStart()

template<class key , class value >
virtual Bool casacore::MapIterRep< key, value >::atStart ( ) const
pure virtual

◆ clear()

template<class key , class value >
void casacore::MapIterRep< key, value >::clear ( )

Clear all of the mappings.

◆ Clone()

template<class key , class value >
virtual MapIterRep<key,value>* casacore::MapIterRep< key, value >::Clone ( )
pure virtual

Duplicate a map iterator.

Implemented in casacore::OrderedMapIterRep< key, value >.

◆ container() [1/2]

template<class key , class value >
Map<key,value>& casacore::MapIterRep< key, value >::container ( )

Returns the container on which this iterator is operating.

◆ container() [2/2]

template<class key , class value >
const Map<key,value>& casacore::MapIterRep< key, value >::container ( ) const

◆ defaultVal() [1/2]

template<class key , class value >
value& casacore::MapIterRep< key, value >::defaultVal ( )

◆ defaultVal() [2/2]

template<class key , class value >
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.

◆ define()

template<class key , class value >
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.

◆ getKey()

template<class key , class value >
virtual const key& casacore::MapIterRep< key, value >::getKey ( ) const
pure virtual

Get the key for the current position in the Map.

Implemented in casacore::OrderedMapIterRep< key, value >.

◆ getVal() [1/2]

template<class key , class value >
virtual const value& casacore::MapIterRep< key, value >::getVal ( ) const
pure virtual

◆ getVal() [2/2]

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

◆ isDefined() [1/2]

template<class key , class value >
value* casacore::MapIterRep< key, value >::isDefined ( const key &  ky)

◆ isDefined() [2/2]

template<class key , class value >
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.

◆ isValid()

template<class key , class value >
virtual Bool casacore::MapIterRep< key, value >::isValid ( ) const
pure virtual

Check to see if the iterator is in a valid state.

Implemented in casacore::OrderedMapIterRep< key, value >.

◆ ndefined()

template<class key , class value >
uInt casacore::MapIterRep< key, value >::ndefined ( ) const

Returns the number of user defined mappings.

◆ operator()() [1/2]

template<class key , class value >
value& casacore::MapIterRep< key, value >::operator() ( const key &  ky)

◆ operator()() [2/2]

template<class key , class value >
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.

◆ operator++() [1/2]

template<class key , class value >
virtual void casacore::MapIterRep< key, value >::operator++ ( )
pure virtual

Advance to the next element of the Map.

Implemented in casacore::OrderedMapIterRep< key, value >.

◆ operator++() [2/2]

template<class key , class value >
virtual void casacore::MapIterRep< key, value >::operator++ ( int  )
pure virtual

◆ remove()

template<class key , class value >
void casacore::MapIterRep< key, value >::remove ( const key &  ky)

◆ toStart()

template<class key , class value >
virtual void casacore::MapIterRep< key, value >::toStart ( )
pure virtual

Move the iterator to the start of the Map.

Implemented in casacore::OrderedMapIterRep< key, value >.

Member Data Documentation

◆ Container

template<class key , class value >
Map<key,value>* casacore::MapIterRep< key, value >::Container
protected

Definition at line 411 of file Map.h.


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