CrossRefMap< GR, K, V > Class Template Reference
[Graph Maps]


Detailed Description

template<typename GR, typename K, typename V>
class lemon::CrossRefMap< GR, K, V >

This class provides simple invertable graph maps. It 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.

Template Parameters:
GR The graph type.
K The key type of the map (GR::Node, GR::Arc or GR::Edge).
V The value type of the map.
See also:
IterableValueMap
#include <lemon/maps.h>

List of all members.

Classes

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

Public Types

typedef GR Graph
 The graph type of CrossRefMap.
typedef K Item
 The key type of CrossRefMap (Node, Arc or Edge).
typedef K Key
 The key type of CrossRefMap (Node, Arc or Edge).
typedef V Value
 The value type of CrossRefMap.

Public Member Functions

 CrossRefMap (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)
MapTraits< Map >::ConstReturnValue operator[] (const Key &key) const
Key operator() (const Value &key) const
InverseMap inverse () const

Protected Member Functions

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


Constructor & Destructor Documentation

CrossRefMap ( const Graph graph  )  [inline, explicit]

Construct a new CrossRefMap for the given 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 value associated with the given key.

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

Returns the value associated with the given 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 from the map and the inverse map. It is called by the AlterationNotifier.

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

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

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

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

InverseMap inverse (  )  const [inline]

It gives back the read-only inverse map.


Generated on Wed May 13 09:53:08 2009 for LEMON by  doxygen 1.5.9