- CLEAR
- DEFINE
- REMOVE
- DELETE
This is the message that flows between the OrderedMap
and the OrderedMap iterators. It allows OrderedMap
iterators to react to changes as they occur to the
OrderedMap.
This is used to construct a list notice. The parameters are:
This function returns the "Notice" type, retrieved
from the "type registry".
This operator can be used to compare two
"OrderedMapNotice"s.
Creates a map with the specified default value, "value", and the
internal block size.
Creates a map with the specified default value, "value".
These functions check to see if a mapping is defined between
the specified key and some value. If one is, a pointer to
the value is returned, otherwise 0 is returned.
+grp
Returns the number of user defined mappings
Defines a mapping (ie. create a key value mapping)
Undefines a mapping (ie. remove a key value mapping).
Clear the entire map (ie. remove all mappings).
Get the number of mappings.
Get or set the Block allocation increment.
+grp
-grp
Removes a map.
Binary search for the key.
OrderedMap
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
Creates a map with the specified default value, "value", and the
internal block size.
Creates a map with the specified default value, "value".
Creates a map from another one; use copy semantics.
Does nothing, the destruction is taken care of in the base class, i.e. the
letter contains the guts.
Assigns this OrderedMap to another with copy semantics.
Get the number of mappings.
Get or set the Block allocation increment.
+grp
-grp
This is the "letter" which when paired (Const)MapIter "envelope"
allows traversal of "OrderedMap"s.
+grp
Checks to see if the iterator is in a valid state.
Checks to see if the iterator is at one of the
map extremes, "atEnd()" or "atStart()".
+grp
Move the iterator to the beginning of the Map.
Advance the iterator to the next key.
+grp
Retrieve the key at the current iterator position.
+grp
-grp
Retrieve the value at the given index in the internal block
which stores the representation of the OrderedMap.
+grp
-grp
Retrieve the value at the current iterator position.
+grp
-grp
This function is the hook through which OrderedMap
iterators are notified of changes to the OrderedMap
which they observe, i.e. changes which may cause
require iterator update.
These constructors allow a ListMapIter to be constructed from a
ListMap.
+grp
-grp
Review Status
Member Description
enum NoticeType
OrderedMapNotice(uInt pos, NoticeType typ) : changeType(typ), modPos(pos)
uInt type() const
int operator==(const Notice &op) const
template<class key, class value> class OrderedMapRep : public NoticeSource, public MapRep<key,value>
Types
enum
Interface
Description
Review Status
Member Description
OrderedMapRep (const value&, uInt size)
OrderedMapRep (const value&)
value *isDefined(const key&)
const value *isDefined(const key&) const
uInt ndefined() const
-grp
value &define (const key&, const value&)
void remove (const key&)
void clear ()
MapIterRep<key,value> *getRep(value<key,value> *) const
MapRep<key,value> *Clone() const
uInt nused() const
uInt ntot() const
uInt incr() const
uInt incr(uInt nri)
~OrderedMapRep ()
enum
Int findKey (const key&, Bool&) const
template<class key, class value> class OrderedMap : public Map<key,value>
Types
enum
Interface
Description
Review Status
Member Description
void throwgetKey(uInt) const
void throwgetValue(uInt) const
value &getVal(uInt inx)
const value &getVal(uInt inx) const
key &getKey (uInt inx)
const key &getKey (uInt inx) const
OrderedMap (const value& dflt, uInt size) : Map<key,value>(new OrderedMapRep<key,value>(dflt,size))
explicit OrderedMap (const value& dflt) : Map<key,value>(new OrderedMapRep<key,value>(dflt))
OrderedMap (const OrderedMap<key,value>& other) : Map<key,value>(other.Rep->Clone())
~OrderedMap()
OrderedMap<key,value>& operator= (const OrderedMap<key,value>& other)
uInt nused() const
uInt ntot() const
uInt incr() const
uInt incr(uInt nri)
enum
template<class key, class value> class OrderedMapIterRep : virtual public MapIterRep<key,value>, public NoticeTarget
Types
enum
Interface
Description
Review Status
Member Description
void thrownext() const
Throw exceptions on behalf of inline functions.
void throwInvalidIter() const
Bool isValid() const
Bool atEnd() const
Bool atStart() const
void toStart()
-grp
void operator++()
void operator++(int)
const key &getKey () const
-grp
const key &getKey (uInt inx) const
value &getVal(uInt inx)
const value &getVal() const
const value &getVal(uInt inx) const
value &getVal()
MapIterRep<key,value> *Clone()
void notify(const Notice &)
OrderedMapIterRep(OrderedMap<key,value> *st) : MapIterRep<key,value>(st), st((MapIterRep *)((OrderedMapRep<key,value> *) st->Rep)), container(st), CurIndex(0)
OrderedMapIterRep(OrderedMap<key,value> &st) : MapIterRep<key,value>(st), st((MapIterRep *)((OrderedMapRep<key,value> *) st.Rep)), container(&st), CurIndex(0)
enum