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"
35 #include <casacore/casa/aips.h>
36 #include <casacore/casa/Exceptions/Error.h>
37 #include <casacore/casa/Containers/Block.h>
38 #include <casacore/casa/BasicSL/String.h>
39 #include <casacore/casa/Containers/Map.h>
40 #include <casacore/casa/Containers/OrderedPair.h>
41 #include <casacore/casa/Utilities/Register.h>
42 #include <casacore/casa/Utilities/Notice.h>
89 if (
type() != op.type()) {
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>
Abstract base class for associative array iterators.
Abstract base class for associative arrays.
MapRep< key, value > * Rep
void SetRep(MapRep< key, value > *st)
Used the set the representation.
base class for notice originators
abstract base class for notice receptors
OrderedMap iterator "letter".
const key & getKey(uInt inx) const
OrderedMapIterRep(OrderedMap< key, value > &st)
value & getVal()
Return the value at the current location of the map iterator.
const value & getVal(uInt inx) const
Bool atEnd() const
Checks to see if the iterator is at one of the map extremes, "atEnd()" or "atStart()".
void notify(const Notice &)
Hook through which NoticeTargets are notified (by NoticeSources).
OrderedMap< key, value > * container
void throwInvalidIter() const
OrderedMapIterRep(OrderedMap< key, value > *st)
These constructors allow a ListMapIter to be constructed from a ListMap.
value & getVal(uInt inx)
Retrieve the value at the given index in the internal block which stores the representation of the Or...
void toStart()
Move the iterator to the beginning of the Map.
@ OrderedMapIterRepVersion
const value & getVal() const
Retrieve the value at the current iterator position.
const key & getKey() const
Retrieve the key at the current iterator position.
Bool isValid() const
Checks to see if the iterator is in a valid state.
MapIterRep< key, value > * Clone()
Duplicate a map iterator.
void operator++()
Advance the iterator to the next key.
enum casacore::OrderedMapNotice::NoticeType changeType
uInt type() const
This function returns the "Notice" type, retrieved from the "type registry".
int operator==(const Notice &op) const
This operator can be used to compare two "OrderedMapNotice"s.
OrderedMapNotice(uInt pos, NoticeType typ)
Representation class for an Ordered Map.
value & define(const key &, const value &)
Defines a mapping (ie.
uInt nused() const
Get the number of mappings.
uInt incr() const
Get or set the Block allocation increment.
uInt lastRef
The index of the last key used.
MapIterRep< key, value > * getRep(Map< key, value > *) const
const value * isDefined(const key &) const
Returns a non-zero value if a mapping is defined for the key parameter.
value * isDefined(const key &)
These functions check to see if a mapping is defined between the specified key and some value.
void clear()
Clear the entire map (ie.
uInt ndefined() const
Returns the number of user defined mappings.
Int findKey(const key &, Bool &) const
Binary search for the key.
OrderedMapRep(const value &, uInt size)
Creates a map with the specified default value, "value", and the internal block size.
OrderedMapRep(const value &)
Creates a map with the specified default value, "value".
MapRep< key, value > * Clone() const
~OrderedMapRep()
Removes a map.
void remove(const key &)
Undefines a mapping (ie.
PtrBlock< OrderedPair< key, value > * > kvblk
The blocks to hold the keys and values and the total, used and increment size of these blocks.
~OrderedMap()
Does nothing, the destruction is taken care of in the base class, i.e.
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.
uInt incr() const
Get or set the Block allocation increment.
OrderedMap< key, value > & operator=(const OrderedMap< key, value > &other)
Assigns this OrderedMap to another with copy semantics.
OrderedMap(const OrderedMap< key, value > &other)
Creates a map from another one; use copy semantics.
const key & getKey(uInt inx) const
uInt nused() const
Get the number of mappings.
void throwgetKey(uInt) const
OrderedMap(const value &dflt)
Creates a map with the specified default value, "value".
void throwgetValue(uInt) const
A drop-in replacement for Block<T*>.
this file contains all the compiler specific defines
bool Bool
Define the standard types used by Casacore.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.