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> 122 value *isDefined(
const key&);
123 const value *isDefined(
const key&)
const;
129 uInt ndefined()
const;
139 void remove (
const key&);
169 enum {OrderedMapRepVersion = 1};
183 Int findKey (
const key&,
Bool&)
const;
213 template<
class key,
class value>
class OrderedMap :
public Map<key,value> {
217 void throwgetKey(
uInt)
const;
218 void throwgetValue(
uInt)
const;
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());
289 enum {OrderedMapVersion = 1};
310 void thrownext()
const;
311 void throwInvalidIter()
const;
323 Bool isValid()
const;
331 Bool atStart()
const;
344 void operator++(
int);
351 const key &getKey ()
const;
353 if (!container || !isValid())
355 return ((*container).getKey(inx));
367 if (!container || !isValid())
369 return ((*container).getVal(inx));
377 const value &getVal()
const;
379 if (!container || !isValid())
381 return ((*container).getVal(inx));
400 void notify(
const Notice &);
422 enum {OrderedMapIterRepVersion = 1};
427 #ifndef CASACORE_NO_AUTO_TEMPLATES 428 #include <casacore/casa/Containers/OrderedMap.tcc> 429 #endif //# CASACORE_NO_AUTO_TEMPLATES
uInt incr() const
Get or set the Block allocation increment.
abstract base class for notice receptors
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)
uInt nused() const
Get the number of mappings.
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.
OrderedMap< key, value > * container
OrderedMapNotice(uInt pos, NoticeType typ)
virtual uInt type() const =0
Return the identification number of the Notice type.
uInt lastRef
The index of the last key used.
base class for notice originators
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.
const key & getKey(uInt inx) const
const key & getKey(uInt inx) const
OrderedMapIterRep(OrderedMap< key, value > *st)
These constructors allow a ListMapIter to be constructed from a ListMap.
uInt incr() const
Get or set the Block allocation increment.
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".
const value & getVal(uInt inx) const
A drop-in replacement for Block<T*>.
MapRep< key, value > * Rep
const value & getVal(uInt inx) const
Map representation class.
Abstract base class for associative arrays.
uInt nused() const
Get the number of mappings.
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.
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
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...