|
| OrderedMap (const value &dflt, uInt size) |
| Creates a map with the specified default value, "value", and the internal block size. More...
|
|
| OrderedMap (const value &dflt) |
| Creates a map with the specified default value, "value". More...
|
|
| OrderedMap (const OrderedMap< key, value > &other) |
| Creates a map from another one; use copy semantics. More...
|
|
| ~OrderedMap () |
| Does nothing, the destruction is taken care of in the base class, i.e. More...
|
|
OrderedMap< key, value > & | operator= (const OrderedMap< key, value > &other) |
| Assigns this OrderedMap to another with copy semantics. More...
|
|
uInt | nused () const |
| Get the number of mappings. More...
|
|
uInt | ntot () const |
|
uInt | incr () const |
| Get or set the Block allocation increment. More...
|
|
uInt | incr (uInt nri) |
|
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 |
|
const value * | isDefined (const key &k) const |
| Returns a non-zero value if a mapping is defined for the key parameter. More...
|
|
value * | isDefined (const key &k) |
|
uInt | ndefined () const |
| Returns the number of user defined mappings. More...
|
|
value & | define (const key &k, const value &v) |
| These functions allow for the definition and removal of key/value relations. More...
|
|
void | remove (const key &k) |
|
void | clear () |
| Clear all of the mappings. More...
|
|
MapIterRep< key, value > * | getRep () const |
| Returns the iterator rep appropriate for this particular Map. More...
|
|
| Map (const Map< key, value > &m) |
| This copy constructor will, for the moment, be the only way to create a map. More...
|
|
| Map (const Map< key, value > *m) |
|
Map< key, value > & | operator= (const Map< key, value > &) |
|
Map< key, value > & | operator= (const Map< key, value > *) |
|
virtual | ~Map () |
|
ConstMapIter< key, value > * | getIter () const |
|
template<class t, class v>
class casacore::OrderedMap< t, v >
Map with keys ordered.
Review Status
- Reviewed By:
- UNKNOWN
- Date Reviewed:
- before2004/08/25
OrderedMap<key,value> is a template class derived from Map. It is similar to ListMap, but the keys are kept in order and they have to be unique.
It uses a Block to store an array of pointers to the keys and the associated values. The keys and values themselves are stored on the heap. The keys are kept in order to allow a binary search through the keys for rapid access.
This is one (simple) implementation of an ordered map. It is not suitable for large arrays of keys, since the overhead of keeping the keys in order would get too big. For large arrays a red-black tree implementation would be better.
Exceptions are raised when new[] is failing, when the next() getKey() or getValue() function is failing or when a duplicate key is defined.
The AipsIO >> and << operators are defined in <aips/OrdMapIO.h>.
Definition at line 46 of file OrderedMap.h.