- MapRepVersion = 1
This is the only MapRep constructor. It takes as a parameter the default value for the map.
This is the mapping function which maps keys to values. If the map from the key to a value is not defined, a mapping will be defined from the key to the default value (which is set from the constructor. The "isDefined()" member function can be used to check to see if a mapping is defined before using the "operator()()".
Returns the default value for the Map.
+grp
-grp
Returns a non-zero value if a mapping is defined for
the key parameter.
+grp
Returns the number of user defined mappings
These functions allow for the definition and removal of key/value
relations. The "define(key &, value &)" call defines a key/value
relation, and "remove(key &)" removes a relation if it has
been previously defined.
+grp
Clear all of the mappings.
Does nothing.
This is the abstract class for all "Map" classes which implement the
equivalent of an associative array.
This is the mapping function which maps keys to values. If the
map from the key to a value is not defined, a mapping will be
defined from the key to the default value (which is set from
the constructor. The "isDefined()" member function can be used
to check to see if a mapping is defined before using the
"operator()()".
Returns the default value for the Map.
+grp
Returns a non-zero value if a mapping is defined for
the key parameter.
+grp
Returns the number of user defined mappings
These functions allow for the definition and removal of key/value
relations. The "define(key &, value &)" call defines a key/value
relation, and "remove(key &)" removes a relation if it has
been previously defined.
+grp
Clear all of the mappings.
Returns the iterator rep appropriate for this particular Map
This copy constructor will, for the moment, be the only
way to create a map.
+grp
Does nothing.
Used by derived classes
Used the set the representation.
Always DELETES Rep if necessary.
This is the abstract base class for all (Const)MapIter
"letters". That is all Map specializations must provide
a "IterRep" for the particular specialization which
will allow the (Const)MapIter envelope to traverse the
new type of map.
Check to see if the iterator is in a valid state.
Check to see if the iterator position is at the
end or beginning of the Map.
+grp
Move the iterator to the start of the Map.
Advance to the next element of the Map.
+grp
Get the key for the current position in
the Map.
Return the value at the current location of the map iterator.
Should throw an exception if the iterator is "past the end of
the Map" or if the iterator is invalid.
+grp
This returns the default value for the map that this iterator
is tracking. With a non-const iterator the default value can
be changed.
+grp
These functions allow for the definition and removal of key/value
relations. The "define(key &, value &)" function defines a key/value
relation, and "remove(key &)" function removes a relation if it has
been previously defined.
+grp
Clear all of the mappings.
Allows mapping functions to be performed with the
map on which this iterator operates. If this iterator
is invalid, then an exception will be thrown. With
a non-const operator, the value can be changed.
+grp
Allows one to check to see if a given key is defined
in the map which this iterator tracks. If this iterator
is invalid, then an exception will be thrown. With
a non-const iterator the returned pointer can be used
to change the value in the map.
+grp
Returns the number of user defined mappings
Returns the container on which this iterator is
operating.
+grp
Duplicate a map iterator
+grp
This allows a MapIter to be constructed from a Map. When
created the new MapIter maintains a reference to the original
Map. If the Map to which this MapIter points is deleted, then
the MapIter is marked as invalid.
+grp
This class implements the mechanism for traversing constant
associative arrays, i.e. "Map"s. This allows one to move
the cursor to the beginning of the map and serially traverse
the map. The key and value elements can be extracted at
each position in the Map. For example:
Move the iterator to the start of the Map.
Advance to the next element of the Map.
+grp
Get the key or value for the current position in
the Map.
+grp
Check to see if the iterator position is at the
end or beginning of the Map.
+grp
Check to see if the iterator is in a valid state.
Constructs a Map iterator from a Map (with reference semantics).
+grp
Assign one map iterator to a map (with reference semantics).
+grp
Constructs a Map iterator from another iterator (with reference semantics).
+grp
-grp
Assign one map iterator to another iterator (with reference semantics).
+grp
Default constructor creates an invalid Map iterator.
Returns the default value for the Map on which this
iterator is operating if it is a valid iterator, otherwise
it throws an exception.
Allows mapping functions to be performed with the
map on which this iterator operates. If this iterator
is invalid, then an exception will be thrown.
Allows one to check to see if a given key is defined
in the map which this iterator tracks. If this iterator
is invalid, then an exception will be thrown.
Returns the number of user defined mappings
Returns the container on which this iterator is
operating.
Dummy used to initialization by derived classes.
Always DELETES Rep if necessary
This class implements the mechanism for traversing associative
arrays, i.e. "Map"s. It provides the traversal mechanisms of the
ConstMapIter, but adds the mechansims to modify the values, and
perform other modification functions which the Maps provide, e.g.
define().
Return the value at the current location of the map iterator.
Should throw an exception if the iterator is "past the end of
the Map" or if the iterator is invalid.
+grp
These functions allow for the definition and removal of key/value
relations. The "define(key &, value &)" function defines a key/value
relation, and "remove(key &)" function removes a relation if it has
been previously defined.
+grp
-grp
This returns the default value for the map that this iterator
is tracking. With a non-const iterator the default value can
be changed.
+grp
-grp
Clear all of the mappings.
Allows mapping functions to be performed with the
map on which this iterator operates. If this iterator
is invalid, then an exception will be thrown. With
a non-const operator, the value can be changed.
+grp
-grp
Allows one to check to see if a given key is defined
in the map which this iterator tracks. If this iterator
is invalid, then an exception will be thrown. With
a non-const iterator the returned pointer can be used
to change the value in the map.
+grp
-grp
This allows a MapIter to be constructed from a Map. When
created the new MapIter maintains a reference to the original
Map. If the Map to which this MapIter points is deleted, then
the MapIter is marked as invalid.
+grp
-grp
This allows a MapIter to be constructed from another MapIter.
When created the new MapIter maintains a reference to the Map
which the MapIter parameter tracked. If this Map is deleted, then
this MapIter is marked as invalid.
+grp
-grp
Default constructor creates an invalid Map iterator.
This assignment operator allows the Map which this MapIter tracks
to be changed. After a call to this operator, the MapIter will track
the Map parameter.
+grp
This assignment operator allows the Map which this MapIter tracks
to be changed. After a call to this operator, this MapIter will track
the Map which the MapIter parameter trackes, i.e. it will contain a
reference to this new Map.
+grp
Returns the container on which this iterator is
operating.
+grp
-grp
+grp
const value &operator()(const key &ky) const
value &defaultVal()
-grp
const value &defaultVal() const
virtual const value *isDefined(const key &) const = 0
virtual value *isDefined(const key &) = 0
virtual uInt ndefined() const = 0
-grp
virtual value &define(const key &, const value &) = 0
virtual void remove(const key &) = 0
virtual void clear() = 0
-grp
virtual MapIterRep<key,value> *getRep(value<key,value>*) const = 0
virtual MapRep<key,value> *Clone() const = 0
virtual ~MapRep()
enum
template<class key, class value> class Map
Types
enum
Interface
Description
Review Status
Member Description
value &operator()(const key &ky)
const value &operator()(const key &ky) const
value &defaultVal()
-grp
const value &defaultVal() const
const value *isDefined(const key &k) const
-grp
value *isDefined(const key &k)
uInt ndefined() const
-grp
value &define(const key &k, const value &v)
void remove(const key &k)
void clear()
-grp
MapIterRep<key,value> *getRep() const
Map(const Map<key,value> &m)
Map(const Map<key,value> *m)
Map<key,value> &operator=(const Map<key,value> &)
-grp
Map<key,value> &operator=(const Map<key,value> *)
virtual ~Map()
enum
ConstMapIter<key,value> *getIter() const
Map(MapRep<key,value> *nRep)
void SetRep(MapRep<key,value> *st)
template<class key, class value> class MapIterRep
Types
enum
Interface
Description
Review Status
Member Description
virtual Bool isValid() const = 0
virtual Bool atEnd() const = 0
virtual Bool atStart() const = 0
virtual void toStart() = 0
-grp
virtual void operator++() = 0
virtual void operator++(int) = 0
virtual const key &getKey() const = 0
-grp
virtual value &getVal() = 0
virtual const value &getVal() const = 0
const value &defaultVal() const
-grp
value &defaultVal()
value &define(const key &ky, const value &val)
-grp
void remove(const key &ky)
void clear()
-grp
const value &operator()(const key &ky) const
value &operator()(const key &ky)
const value *isDefined(const key &ky) const
-grp
value *isDefined(const key &ky)
uInt ndefined() const
-grp
Map<key,value> &container()
const Map<key,value> &container() const
virtual MapIterRep<key,value> *Clone() = 0
-grp
MapIterRep(Map<key,value> &st)
-grp
MapIterRep(Map<key,value> *st)
virtual ~MapIterRep()
-grp
enum
template<class key, class value> class ConstMapIter
Types
enum
Interface
Description
Review Status
template
This example declares a templated function which accepts a const
Map as a parameter, and iterates through the map displaying the
key/value pairs at each positon.
Member Description
virtual void toStart()
virtual void operator++()
virtual void operator++(int)
virtual const key &getKey() const
-grp
virtual const value &getVal() const
virtual Bool atEnd() const
-grp
virtual Bool atStart() const
virtual Bool isValid() const
-grp
ConstMapIter(const Map<key,value> *st)
ConstMapIter(const Map<key,value> &st)
virtual ConstMapIter<key,value> &operator=(const value<key,value> &other)
-grp
virtual ConstMapIter<key,value> &operator=(const value<key,value> *other)
ConstMapIter(const ConstMapIter<key,value> *st)
-grp
ConstMapIter(const ConstMapIter<key,value> &st)
virtual ConstMapIter<key,value> &operator=(const ConstMapIter<key,value> &other)
virtual ConstMapIter<key,value> &operator=(const ConstMapIter<key,value> *other)
ConstMapIter() : Rep(0)
-grp
const value &defaultVal() const
const value &operator()(const key &ky) const
const value *isDefined(const key &ky) const
uInt ndefined() const
const Map<key,value> &container() const
virtual ~ConstMapIter()
enum
ConstMapIter(MapIterRep<key,value> *st) : Rep(st)
void SetRep(MapIterRep<key,value> *st)
template<class key, class value> class MapIter : virtual public ConstMapIter<key,value>
Types
enum
Interface
Description
Review Status
Member Description
virtual value &getVal()
virtual const value &getVal() const
value &define(const key &ky, const value &val)
-grp
void remove(const key &ky)
const value &defaultVal() const
value &defaultVal()
void clear()
const value &operator()(const key &ky) const
value &operator()(const key &ky)
const value *isDefined(const key &ky) const
value *isDefined(const key &ky)
MapIter(Map<key,value> *other) : ConstMapIter<key,value>(other ? other->getRep() : 0)
MapIter(Map<key,value> &st) : ConstMapIter<key,value>(st.getRep())
MapIter(const MapIter<key,value> &other) : ConstMapIter<key,value>(other.isValid() ? other.Rep->Clone() : 0)
MapIter(const MapIter<key,value> *other) : ConstMapIter<key,value>(other && (*other).isValid() ? other->Rep->Clone() : 0)
MapIter() : ConstMapIter<key,value>()
virtual MapIter<key,value> &operator=(value<key,value> &other)
virtual MapIter<key,value> &operator=(value<key,value> *other)
virtual MapIter<key,value> &operator=(const MapIter<key,value> &other)
-grp
virtual MapIter<key,value> &operator=(const MapIter<key,value> *other)
Map<key,value> &container()
-grp
const Map<key,value> &container() const
~MapIter()
enum
ConstMapIter<key,value> &operator=(const value<key,value> &)
These assignment operators are private and ONLY throw an
exception to prevent incorrect assignments to a non-const
iterator.
ConstMapIter<key,value> &operator=(const value<key,value> *)
ConstMapIter<key,value> &operator=(const ConstMapIter<key,value> &)
ConstMapIter<key,value> &operator=(const ConstMapIter<key,value> *)