28 #ifndef CASA_ORDEREDMAP_H 29 #define CASA_ORDEREDMAP_H 31 #include <casacore/casa/aips.h> 32 #include <casacore/casa/Exceptions/Error.h> 33 #include <casacore/casa/Containers/Block.h> 34 #include <casacore/casa/BasicSL/String.h> 35 #include <casacore/casa/Containers/Map.h> 36 #include <casacore/casa/Containers/OrderedPair.h> 37 #include <casacore/casa/Utilities/Register.h> 38 #include <casacore/casa/Utilities/Notice.h> 118 value *isDefined(
const key&);
119 const value *isDefined(
const key&)
const;
125 uInt ndefined()
const;
135 void remove (
const key&);
165 enum {OrderedMapRepVersion = 1};
179 Int findKey (
const key&,
Bool&)
const;
209 template<
class key,
class value>
class OrderedMap :
public Map<key,value> {
213 void throwgetKey(
uInt)
const;
214 void throwgetValue(
uInt)
const;
217 if (!this->Rep || inx >= nused())
223 if (!this->Rep || inx >= nused())
229 if (!this->Rep || inx >= nused())
235 if (!this->Rep || inx >= nused())
267 this->SetRep(other.
Rep->Clone());
285 enum {OrderedMapVersion = 1};
306 void thrownext()
const;
307 void throwInvalidIter()
const;
319 Bool isValid()
const;
327 Bool atStart()
const;
340 void operator++(
int);
347 const key &getKey ()
const;
349 if (!container || !isValid())
351 return ((*container).getKey(inx));
363 if (!container || !isValid())
365 return ((*container).getVal(inx));
373 const value &getVal()
const;
375 if (!container || !isValid())
377 return ((*container).getVal(inx));
396 void notify(
const Notice &);
418 enum {OrderedMapIterRepVersion = 1};
423 #ifndef CASACORE_NO_AUTO_TEMPLATES 424 #include <casacore/casa/Containers/OrderedMap.tcc> 425 #endif //# CASACORE_NO_AUTO_TEMPLATES
abstract base class for notice receptors
uInt type() const
This function returns the "Notice" type, retrieved from the "type registry".
Abstract base class for associative array iterators.
OrderedMap(const OrderedMap< key, value > &other)
Creates a map from another one; use copy semantics.
PtrHolder< T > & operator=(const PtrHolder< T > &other)
MapIterRep< key, value > * Clone()
Duplicate a map iterator.
OrderedMap(const value &dflt, uInt size)
Creates a map with the specified default value, "value", and the internal block size.
uInt nused() const
Get the number of mappings.
OrderedMap< key, value > * container
OrderedMapNotice(uInt pos, NoticeType typ)
virtual uInt type() const =0
Return the identification number of the Notice type.
const value & getVal(uInt inx) const
uInt lastRef
The index of the last key used.
base class for notice originators
const key & getKey(uInt inx) const
OrderedMapIterRep(OrderedMap< key, value > *st)
These constructors allow a ListMapIter to be constructed from a ListMap.
bool Bool
Define the standard types used by Casacore.
abstract base class for notices
Message used for OrderedMap notification.
OrderedMap(const value &dflt)
Creates a map with the specified default value, "value".
A drop-in replacement for Block<T*>.
MapRep< key, value > * Rep
uInt incr() const
Get or set the Block allocation increment.
uInt incr() const
Get or set the Block allocation increment.
Map representation class.
const key & getKey(uInt inx) const
Abstract base class for associative arrays.
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...
enum casacore::OrderedMapNotice::NoticeType changeType
Representation class for an Ordered Map.
uInt nused() const
Get the number of mappings.
value & getVal()
Return the value at the current location of the map iterator.
OrderedMapIterRep(OrderedMap< key, value > &st)
this file contains all the compiler specific defines
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".
PtrBlock< OrderedPair< key, value > * > kvblk
The blocks to hold the keys and values and the total, used and increment size of these blocks...