ConstMap Class Template Reference
[Maps]


Detailed Description

template<typename K, typename V>
class lemon::ConstMap< K, V >

This readable map assigns a specified value to each key.

In other aspects it is equivalent to NullMap. So it conforms the ReadWriteMap concept, but it absorbs the data written to it.

The simplest way of using this map is through the constMap() function.

See also:
NullMap

IdentityMap

#include <lemon/maps.h>

Inheritance diagram for ConstMap:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 ConstMap ()
 Default constructor.
 ConstMap (const Value &v)
 Constructor with specified initial value.
Value operator[] (const Key &) const
 Gives back the specified value.
void set (const Key &, const Value &)
 Absorbs the value.
void setAll (const Value &v)
 Sets the value that is assigned to each key.

Related Functions

(Note that these are not member functions.)

template<typename K , typename V >
ConstMap< K, V > constMap (const V &v)
 Returns a ConstMap class.
template<typename K , typename V , V v>
ConstMap< K, Const< V, v > > constMap ()
 Returns a ConstMap class with inlined constant value.


Constructor & Destructor Documentation

ConstMap (  )  [inline]

Default constructor. The value of the map will be default constructed.

ConstMap ( const Value &  v  )  [inline]

Constructor with specified initial value.

Parameters:
v The initial value of the map.


The documentation for this class was generated from the following file:

Generated on Sun Dec 7 10:49:45 2008 for LEMON by  doxygen 1.5.7.1