InvertableMap< _Graph, _Item, _Value > Class Template Reference
[Graph Maps]


Detailed Description

template<typename _Graph, typename _Item, typename _Value>
class lemon::InvertableMap< _Graph, _Item, _Value >

This type provides simple invertable graph-maps. The InvertableMap wraps an arbitrary ReadWriteMap and if a key is set to a new value then store it in the inverse map.

The values of the map can be accessed with stl compatible forward iterator.

Parameters:
_Graph The graph type.
_Item The item type of the graph.
_Value The value type of the map.
See also:
IterableValueMap
#include <lemon/graph_utils.h>

Inheritance diagram for InvertableMap< _Graph, _Item, _Value >:

Inheritance graph
[legend]

List of all members.

Classes

class  InverseMap
 The inverse map type. More...
class  ValueIterator
 Forward iterator for values. More...

Public Types

typedef Map::Key Key
 The key type of InvertableMap (Node, Edge, UEdge).
typedef Map::Value Value
 The value type of the InvertableMap.

Public Member Functions

 InvertableMap (const Graph &graph)
 Constructor.
ValueIterator beginValue () const
 Returns an iterator to the first value.
ValueIterator endValue () const
 Returns an iterator after the last value.
void set (const Key &key, const Value &val)
 The setter function of the map.
MapTraits< Map >::ConstReturnValue operator[] (const Key &key) const
 The getter function of the map.
Key operator() (const Value &key) const
InverseMap inverse () const

Protected Member Functions

virtual void erase (const Key &key)
 Erase the key from the map.
virtual void erase (const std::vector< Key > &keys)
 Erase more keys from the map.
virtual void clear ()
 Clear the keys from the map and inverse map.


Constructor & Destructor Documentation

InvertableMap ( const Graph &  graph  )  [inline, explicit]

Construct a new InvertableMap for the graph.


Member Function Documentation

ValueIterator beginValue (  )  const [inline]

Returns an stl compatible iterator to the first value of the map. The values of the map can be accessed in the [beginValue, endValue) range.

ValueIterator endValue (  )  const [inline]

Returns an stl compatible iterator after the last value of the map. The values of the map can be accessed in the [beginValue, endValue) range.

void set ( const Key key,
const Value val 
) [inline]

Sets the mapped value.

MapTraits<Map>::ConstReturnValue operator[] ( const Key key  )  const [inline]

It gives back the value associated with the key.

Key operator() ( const Value key  )  const [inline]

Gives back the item by its value.

virtual void erase ( const Key key  )  [inline, protected, virtual]

Erase the key to the map. It is called by the AlterationNotifier.

virtual void erase ( const std::vector< Key > &  keys  )  [inline, protected, virtual]

Erase more keys from the map. It is called by the AlterationNotifier.

virtual void clear (  )  [inline, protected, virtual]

Clear the keys from the map and inverse map. It is called by the AlterationNotifier.

Reimplemented from ArrayMap< _Graph, _Item, _Value >.

InverseMap inverse (  )  const [inline]

It gives back the just readable inverse map.


Generated on Thu Jun 4 04:04:36 2009 for LEMON by  doxygen 1.5.9