ArrayMap< _Graph, _Item, _Value > Class Template Reference
[Tools for Graph Implementation]


Detailed Description

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

The ArrayMap template class is graph map structure what automatically updates the map when a key is added to or erased from the map. This map uses the allocators to implement the container functionality.

The template parameters are the Graph the current Item type and the Value type of the map. #include <lemon/bits/array_map.h>

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

Inheritance graph
[legend]

List of all members.

Public Types

typedef _Graph Graph
 The graph type of the maps.
typedef _Item Item
 The item type of the map.
typedef True ReferenceMapTag
 The reference map tag.
typedef _Item Key
 The key type of the maps.
typedef _Value Value
 The value type of the map.
typedef const _Value & ConstReference
 The const reference type of the map.
typedef _Value & Reference
 The reference type of the map.
typedef ItemSetTraits< _Graph,
_Item >::ItemNotifier 
Notifier
 The notifier type.
typedef Notifier::ObserverBase Parent
 The MapBase of the Map which imlements the core regisitry function.

Public Member Functions

 ArrayMap (const Graph &graph)
 ArrayMap (const Graph &graph, const Value &value)
 Constructor to use default value to initialize the map.
 ArrayMap (const ArrayMap &copy)
ArrayMapoperator= (const ArrayMap &cmap)
 Assign operator.
template<typename CMap >
ArrayMapoperator= (const CMap &cmap)
 Template assign operator.
virtual ~ArrayMap ()
Valueoperator[] (const Key &key)
 The subscript operator.
const Valueoperator[] (const Key &key) const
 The const subscript operator.
void set (const Key &key, const Value &val)
 Setter function of the map.

Protected Member Functions

virtual void add (const Key &key)
 Adds a new key to the map.
virtual void add (const std::vector< Key > &keys)
 Adds more new keys to the map.
virtual void erase (const Key &key)
 Erase a key from the map.
virtual void erase (const std::vector< Key > &keys)
 Erase more keys from the map.
virtual void build ()
 Buildes the map.
virtual void clear ()
 Clear the map.


Constructor & Destructor Documentation

ArrayMap ( const Graph graph  )  [inline, explicit]

Graph initialized map constructor.

ArrayMap ( const Graph graph,
const Value value 
) [inline]

It constructs a map and initialize all of the the map.

ArrayMap ( const ArrayMap< _Graph, _Item, _Value > &  copy  )  [inline]

Constructor to copy a map of the same map type.

virtual ~ArrayMap (  )  [inline, virtual]

The destructor of the map.


Member Function Documentation

ArrayMap& operator= ( const ArrayMap< _Graph, _Item, _Value > &  cmap  )  [inline]

This operator assigns for each item in the map the value mapped to the same item in the copied map. The parameter map should be indiced with the same itemset because this assign operator does not change the container of the map.

ArrayMap& operator= ( const CMap &  cmap  )  [inline]

The given parameter should be conform to the ReadMap concecpt and could be indiced by the current item set of the NodeMap. In this case the value for each item is assigned by the value of the given ReadMap.

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

The subscript operator. The map can be subscripted by the actual keys of the graph.

Reimplemented in IterableBoolMap< _Graph, _Item >, and IterableIntMap< _Graph, _Item >.

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

The const subscript operator. The map can be subscripted by the actual keys of the graph.

Reimplemented in DescriptorMap< _Graph, _Item >, IterableBoolMap< _Graph, _Item >, IterableIntMap< _Graph, _Item >, IterableValueMap< _Graph, _Item, _Value >, and DescriptorMap< Graph, typename Graph::Node >.

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

Setter function of the map. Equivalent with map[key] = val. This is a compatibility feature with the not dereferable maps.

Reimplemented in IterableValueMap< _Graph, _Item, _Value >.

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

It adds a new key to the map. It called by the observer notifier and it overrides the add() member function of the observer base.

Reimplemented in DescriptorMap< _Graph, _Item >, and DescriptorMap< Graph, typename Graph::Node >.

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

It adds more new keys to the map. It called by the observer notifier and it overrides the add() member function of the observer base.

Reimplemented in DescriptorMap< _Graph, _Item >, and DescriptorMap< Graph, typename Graph::Node >.

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

Erase a key from the map. It called by the observer notifier and it overrides the erase() member function of the observer base.

Reimplemented in DescriptorMap< _Graph, _Item >, and DescriptorMap< Graph, typename Graph::Node >.

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

Erase more keys from the map. It called by the observer notifier and it overrides the erase() member function of the observer base.

Reimplemented in DescriptorMap< _Graph, _Item >, and DescriptorMap< Graph, typename Graph::Node >.

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

It buildes the map. It called by the observer notifier and it overrides the build() member function of the observer base.

Reimplemented in DescriptorMap< _Graph, _Item >, and DescriptorMap< Graph, typename Graph::Node >.

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

It erase all items from the map. It called by the observer notifier and it overrides the clear() member function of the observer base.

Reimplemented in InvertableMap< _Graph, _Item, _Value >, DescriptorMap< _Graph, _Item >, and DescriptorMap< Graph, typename Graph::Node >.


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