Map representation class. More...
#include <Map.h>
Public Types | |
| enum | { MapRepVersion } |
Public Member Functions | |
| MapRep (const value &dflt) | |
| This is the only MapRep constructor. | |
| value & | operator() (const key &ky) |
| This is the mapping function which maps keys to values. | |
| const value & | operator() (const key &ky) const |
| value & | defaultVal () |
| Returns the default value for the Map. | |
| const value & | defaultVal () const |
| virtual const value * | isDefined (const key &) const =0 |
| Returns a non-zero value if a mapping is defined for the key parameter. | |
| virtual value * | isDefined (const key &)=0 |
| virtual uInt | ndefined () const =0 |
| Returns the number of user defined mappings. | |
| virtual value & | define (const key &, const value &)=0 |
| These functions allow for the definition and removal of key/value relations. | |
| virtual void | remove (const key &)=0 |
| virtual void | clear ()=0 |
| Clear all of the mappings. | |
| virtual MapIterRep< key, value > * | getRep (Map< key, value > *) const =0 |
| virtual MapRep< key, value > * | Clone () const =0 |
| virtual | ~MapRep () |
| Does nothing. | |
Protected Attributes | |
| value | DefaultVal |
| This is the default value which is return when no match is found. | |
Map representation class.
Definition at line 59 of file Map.h.
| anonymous enum |
| casacore::MapRep< key, value >::MapRep | ( | const value & | dflt | ) | [inline] |
| virtual casacore::MapRep< key, value >::~MapRep | ( | ) | [virtual] |
Does nothing.
| virtual void casacore::MapRep< key, value >::clear | ( | ) | [pure virtual] |
Clear all of the mappings.
Implemented in casacore::OrderedMapRep< key, value >.
| virtual MapRep<key,value>* casacore::MapRep< key, value >::Clone | ( | ) | const [pure virtual] |
Implemented in casacore::OrderedMapRep< key, value >.
| const value& casacore::MapRep< key, value >::defaultVal | ( | ) | const [inline] |
| value& casacore::MapRep< key, value >::defaultVal | ( | ) | [inline] |
| virtual value& casacore::MapRep< key, value >::define | ( | const key & | , | |
| const value & | ||||
| ) | [pure virtual] |
These functions allow for the definition and removal of key/value relations.
The "define(key &, value &)" call defines a key/value relation, and "remove(key &)" removes a relation if it has been previously defined.
Implemented in casacore::OrderedMapRep< key, value >.
| virtual MapIterRep<key,value>* casacore::MapRep< key, value >::getRep | ( | Map< key, value > * | ) | const [pure virtual] |
Implemented in casacore::OrderedMapRep< key, value >.
| virtual value* casacore::MapRep< key, value >::isDefined | ( | const key & | ) | [pure virtual] |
Implemented in casacore::OrderedMapRep< key, value >.
| virtual const value* casacore::MapRep< key, value >::isDefined | ( | const key & | ) | const [pure virtual] |
Returns a non-zero value if a mapping is defined for the key parameter.
Implemented in casacore::OrderedMapRep< key, value >.
| virtual uInt casacore::MapRep< key, value >::ndefined | ( | ) | const [pure virtual] |
Returns the number of user defined mappings.
Implemented in casacore::OrderedMapRep< key, value >.
| const value& casacore::MapRep< key, value >::operator() | ( | const key & | ky | ) | const |
| value& casacore::MapRep< key, value >::operator() | ( | const key & | ky | ) |
This is the mapping function which maps keys to values.
If the map from the key to a value is not defined, a mapping will be defined from the key to the default value (which is set from the constructor. The "isDefined()" member function can be used to check to see if a mapping is defined before using the "operator()()".
Note: With a constant map in the case where the key is not defined, the mapping between key and default value is not created, but rather an exception is thrown;
| virtual void casacore::MapRep< key, value >::remove | ( | const key & | ) | [pure virtual] |
Implemented in casacore::OrderedMapRep< key, value >.
value casacore::MapRep< key, value >::DefaultVal [protected] |
This is the default value which is return when no match is found.
This prevents this class from being a PartialMap.
Definition at line 138 of file Map.h.
Referenced by casacore::MapRep< String, OrderedPair< FunctionFactory< T > *, Bool > >::defaultVal().
1.6.1