ConstMap

Declared in lemon/maps.h, in the group Maps; the same class on the Doxygen site.

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

Constant map.

This readable map assigns a specified value to each key.

In other aspects it is equivalent to NullMap. So it conforms to 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

See also

IdentityMap

Public Types

typedef K Key

typedef V Value

Public Functions

inline ConstMap()

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

inline ConstMap( const Value & v )

Constructor with specified initial value.

Parameters:

v – The initial value of the map.

inline Value operator[]( const Key & ) const

Gives back the specified value.

inline void set( const Key & , const Value & )

Absorbs the value.

inline void setAll( const Value & v )

Sets the value that is assigned to each key.

template< typename V1 >
inline ConstMap( const ConstMap< K , V1 > & , const Value & v )
template< typename K , typename V , V v >
class ConstMap< K , Const< V , v > > : public lemon::MapBase< K , V >, public lemon::MapBase< K , V >

Constant map with inlined constant value.

This readable map assigns a specified value to each key.

In other aspects it is equivalent to NullMap. So it conforms to 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

See also

IdentityMap

Public Types

typedef K Key

typedef V Value

Public Functions

inline ConstMap()

Constructor.

inline Value operator[]( const Key & ) const

Gives back the specified value.

inline void set( const Key & , const Value & )

Absorbs the value.

inline void setAll( const Value & v )

Sets the value that is assigned to each key.

inline ConstMap< K , V > constMap( const V & v )

Returns a ConstMap class.

This function just returns a ConstMap class.

inline ConstMap< K , Const< V , v > > constMap()

Returns a ConstMap class with inlined constant value.

This function just returns a ConstMap class with inlined constant value.