casacore
|
Map representation class. More...
#include <Map.h>
Public Types | |
enum | { MapRepVersion } |
Public Member Functions | |
MapRep (const value &dflt) | |
This is the only MapRep constructor. More... | |
value & | operator() (const key &ky) |
This is the mapping function which maps keys to values. More... | |
const value & | operator() (const key &ky) const |
value & | defaultVal () |
Returns the default value for the Map. More... | |
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. More... | |
virtual value * | isDefined (const key &)=0 |
virtual uInt | ndefined () const =0 |
Returns the number of user defined mappings. More... | |
virtual value & | define (const key &, const value &)=0 |
These functions allow for the definition and removal of key/value relations. More... | |
virtual void | remove (const key &)=0 |
virtual void | clear ()=0 |
Clear all of the mappings. More... | |
virtual MapIterRep< key, value > * | getRep (Map< key, value > *) const =0 |
virtual MapRep< key, value > * | Clone () const =0 |
virtual | ~MapRep () |
Does nothing. More... | |
Protected Attributes | |
value | DefaultVal |
This is the default value which is return when no match is found. More... | |
Map representation class.
anonymous enum |
|
inline |
|
virtual |
Does nothing.
|
pure virtual |
Clear all of the mappings.
Implemented in casacore::OrderedMapRep< t, v >.
|
pure virtual |
Implemented in casacore::OrderedMapRep< t, v >.
|
inline |
Returns the default value for the Map.
Definition at line 92 of file Map.h.
References casacore::MapRep< key, value >::DefaultVal.
|
inline |
Definition at line 93 of file Map.h.
References casacore::MapRep< key, value >::DefaultVal.
|
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< t, v >.
|
pure virtual |
Implemented in casacore::OrderedMapRep< t, v >.
|
pure virtual |
Returns a non-zero value if a mapping is defined for the key parameter.
Implemented in casacore::OrderedMapRep< t, v >.
|
pure virtual |
Implemented in casacore::OrderedMapRep< t, v >.
|
pure virtual |
Returns the number of user defined mappings.
Implemented in casacore::OrderedMapRep< t, v >.
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;
const value& casacore::MapRep< key, value >::operator() | ( | const key & | ky | ) | const |
|
pure virtual |
Implemented in casacore::OrderedMapRep< t, v >.
|
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 141 of file Map.h.
Referenced by casacore::MapRep< key, value >::defaultVal().