28 #ifndef CASA_ORDEREDMAP_H
29 #define CASA_ORDEREDMAP_H
31 #ifndef AIPS_USE_DEPRECATED
32 #error "OrderedMap.h is deprecated; use -DBUILD_DEPRECATED=ON to use it"
41 #include <casacore/casa/Utilities/Register.h>
89 if (
type() != op.type()) {
102 template<
class key,
class value>
class OrderedMapRep :
public NoticeSource,
public MapRep<key,value> {
139 void remove (
const key&);
213 template<
class key,
class value>
class OrderedMap :
public Map<key,value> {
302 template<
class key,
class value>
class OrderedMapIterRep :
virtual public MapIterRep<key,value>,
public NoticeTarget {
351 const key &
getKey ()
const;
355 return ((*container).getKey(inx));
369 return ((*container).getVal(inx));
381 return ((*container).getVal(inx));
427 #ifndef CASACORE_NO_AUTO_TEMPLATES
428 #include <casacore/casa/Containers/OrderedMap.tcc>
429 #endif //# CASACORE_NO_AUTO_TEMPLATES
uInt nused() const
Get the number of mappings.
value * isDefined(const key &)
These functions check to see if a mapping is defined between the specified key and some value...
uInt incr() const
Get or set the Block allocation increment.
const value & getVal(uInt inx) const
void clear()
Clear the entire map (ie.
OrderedMap(const OrderedMap< key, value > &other)
Creates a map from another one; use copy semantics.
abstract base class for notice receptors
~OrderedMapRep()
Removes a map.
Map< key, value > & container()
Returns the container on which this iterator is operating.
PtrBlock< OrderedPair< key, value > * > kvblk
The blocks to hold the keys and values and the total, used and increment size of these blocks...
uInt type() const
This function returns the "Notice" type, retrieved from the "type registry".
Abstract base class for associative array iterators.
OrderedMap(const value &dflt)
Creates a map with the specified default value, "value".
void notify(const Notice &)
Hook through which NoticeTargets are notified (by NoticeSources).
const key & getKey(uInt inx) const
MapRep< key, value > * Clone() const
OrderedMapIterRep(OrderedMap< key, value > &st)
uInt ndefined() const
Returns the number of user defined mappings.
OrderedMapNotice(uInt pos, NoticeType typ)
Bool atEnd() const
Checks to see if the iterator is at one of the map extremes, "atEnd()" or "atStart()".
void SetRep(MapRep< key, value > *st)
Used the set the representation.
OrderedMap< key, value > * container
Int findKey(const key &, Bool &) const
Binary search for the key.
base class for notice originators
void operator++()
Advance the iterator to the next key.
uInt lastRef
The index of the last key used.
uInt nused() const
Get the number of mappings.
value & define(const key &, const value &)
Defines a mapping (ie.
void throwgetValue(uInt) const
~OrderedMap()
Does nothing, the destruction is taken care of in the base class, i.e.
value & getVal(uInt inx)
Retrieve the value at the given index in the internal block which stores the representation of the Or...
const key & getKey(uInt inx) const
Bool isValid() const
Checks to see if the iterator is in a valid state.
void throwgetKey(uInt) const
MapIterRep< key, value > * Clone()
Duplicate a map iterator.
bool Bool
Define the standard types used by Casacore.
abstract base class for notices
Message used for OrderedMap notification.
const value & getVal() const
Retrieve the value at the current iterator position.
A drop-in replacement for Block<T*>.
MapRep< key, value > * Rep
value & getVal()
Return the value at the current location of the map iterator.
Map representation class.
void throwInvalidIter() const
Abstract base class for associative arrays.
OrderedMapIterRep(OrderedMap< key, value > *st)
These constructors allow a ListMapIter to be constructed from a ListMap.
OrderedMapRep(const value &, uInt size)
Creates a map with the specified default value, "value", and the internal block size.
uInt incr() const
Get or set the Block allocation increment.
enum casacore::OrderedMapNotice::NoticeType changeType
Representation class for an Ordered Map.
MapIterRep< key, value > * getRep(Map< key, value > *) const
OrderedMap< key, value > & operator=(const OrderedMap< key, value > &other)
Assigns this OrderedMap to another with copy semantics.
const value & getVal(uInt inx) const
OrderedMap(const value &dflt, uInt size)
Creates a map with the specified default value, "value", and the internal block size.
const key & getKey() const
Retrieve the key at the current iterator position.
void toStart()
Move the iterator to the beginning of the Map.
int operator==(const Notice &op) const
This operator can be used to compare two "OrderedMapNotice"s.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
OrderedMap iterator "letter".