Go to the documentation of this file.
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>
102 template<
class key,
class value>
class OrderedMapRep :
public NoticeSource,
public MapRep<key,value> {
213 template<
class key,
class value>
class OrderedMap :
public Map<key,value> {
221 if (!this->Rep || inx >=
nused())
227 if (!this->Rep || inx >=
nused())
233 if (!this->Rep || inx >=
nused())
239 if (!this->Rep || inx >=
nused())
271 this->SetRep(other.Rep->Clone());
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.
const key & getKey() const
Retrieve the key at the current iterator position.
Message used for OrderedMap notification.
abstract base class for notices
OrderedMap iterator "letter".
const value & getVal() const
Retrieve the value at the current iterator position.
A drop-in replacement for Block<T*>.
const key & getKey(uInt inx) const
uInt lastRef
The index of the last key used.
PtrBlock< OrderedPair< key, value > * > kvblk
The blocks to hold the keys and values and the total, used and increment size of these blocks.
void throwgetKey(uInt) const
MapIterRep< key, value > * getRep(Map< key, value > *) const
~OrderedMap()
Does nothing, the destruction is taken care of in the base class, i.e.
uInt incr() const
Get or set the Block allocation increment.
const value & getVal(uInt inx) const
enum casacore::OrderedMapNotice::NoticeType changeType
abstract base class for notice receptors
OrderedMap< key, value > * container
value * isDefined(const key &)
These functions check to see if a mapping is defined between the specified key and some value.
value & define(const key &, const value &)
Defines a mapping (ie.
void throwInvalidIter() const
OrderedMap(const value &dflt)
Creates a map with the specified default value, "value".
const key & getKey(uInt inx) const
OrderedMapIterRep(OrderedMap< key, value > *st)
These constructors allow a ListMapIter to be constructed from a ListMap.
MapIterRep< key, value > * Clone()
Representation class for an Ordered Map.
uInt ndefined() const
Returns the number of user defined mappings.
OrderedMap< key, value > & operator=(const OrderedMap< key, value > &other)
Assigns this OrderedMap to another with copy semantics.
void remove(const key &)
Undefines a mapping (ie.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
Map representation class.
Int findKey(const key &, Bool &) const
Binary search for the key.
void clear()
Clear the entire map (ie.
uInt nused() const
Get the number of mappings.
OrderedMap(const value &dflt, uInt size)
Creates a map with the specified default value, "value", and the internal block size.
Abstract base class for associative array iterators.
base class for notice originators
Bool isValid() const
Checks to see if the iterator is in a valid state.
this file contains all the compiler specific defines
Bool atEnd() const
Checks to see if the iterator is at one of the map extremes, "atEnd()" or "atStart()".
const value & getVal(uInt inx) const
value & getVal(uInt inx)
Retrieve the value at the given index in the internal block which stores the representation of the Or...
~OrderedMapRep()
Removes a map.
OrderedMapRep(const value &, uInt size)
Creates a map with the specified default value, "value", and the internal block size.
OrderedMapNotice(uInt pos, NoticeType typ)
OrderedMapIterRep(OrderedMap< key, value > &st)
MapRep< key, value > * Clone() const
void notify(const Notice &)
bool Bool
Define the standard types used by Casacore.
virtual uInt type() const =0
Return the identification number of the Notice type.
uInt type() const
This function returns the "Notice" type, retrieved from the "type registry".
Abstract base class for associative arrays.
@ OrderedMapIterRepVersion
void throwgetValue(uInt) const
OrderedMap(const OrderedMap< key, value > &other)
Creates a map from another one; use copy semantics.
uInt incr() const
Get or set the Block allocation increment.
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.
void operator++()
Advance the iterator to the next key.