VectorMap Class Template Reference
[Graphmaps]

#include <vector_map.h>

Inheritance diagram for VectorMap:

Inheritance graph
[legend]
Collaboration diagram for VectorMap:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<typename MapRegistry, typename Value>
class lemon::VectorMap< MapRegistry, 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 factory uses the allocators to implement the container functionality. This map factory uses the std::vector to implement the container function.

The template parameter is the MapRegistry that the maps will belong to and the ValueType.

Todo:
It should use a faster initialization using the maxNodeId() or maxEdgeId() function of the graph instead of iterating through each edge/node.

Definition at line 49 of file vector_map.h.

Public Types

typedef MapRegistry::Graph Graph
 The graph type of the maps.
typedef MapRegistry::KeyType KeyType
 The key type of the maps.
typedef MapRegistry::KeyIt KeyIt
 The iterator to iterate on the keys.
typedef VectorMap Map
 The map type.
typedef MapRegistry::MapBase MapBase
 The MapBase of the Map which implements the core regisitry function.
typedef Value ValueType
 The value type of the map.
typedef Container::reference ReferenceType
 The reference type of the map;.
typedef Container::pointer PointerType
 The pointer type of the map;.
typedef const Value ConstValueType
 The const value type of the map.
typedef Container::const_reference ConstReferenceType
 The const reference type of the map;.
typedef Container::const_pointer ConstPointerType
 The pointer type of the map;.
typedef MapIterator< VectorMapIterator
 The stl compatible pair iterator of the map.
typedef MapConstIterator<
VectorMap
ConstIterator
 The stl compatible const pair iterator of the map.
typedef MapConstKeySet< VectorMapConstKeySet
 The KeySet of the Map.
typedef MapConstValueSet<
VectorMap
ConstValueSet
 The ConstValueSet of the Map.
typedef MapValueSet< VectorMapValueSet
 The ValueSet of the Map.

Public Member Functions

 VectorMap (const Graph &g, MapRegistry &r)
 VectorMap (const Graph &g, MapRegistry &r, const Value &v)
template<typename TT>  VectorMap (const VectorMap< MapRegistry, TT > &c)
template<typename TT> VectorMapoperator= (const VectorMap< MapRegistry, TT > &c)
ReferenceType operator[] (const KeyType &key)
ConstReferenceType operator[] (const KeyType &key) const
void set (const KeyType &key, const ValueType &val)
void add (const KeyType &key)
void erase (const KeyType &key)
void clear ()
Iterator begin ()
Iterator end ()
ConstIterator begin () const
ConstIterator end () const
ConstKeySet keySet () const
 KeySet getter function.
ConstValueSet valueSet () const
 ConstValueSet getter function.
ValueSet valueSet ()
 ValueSet getter function.


Constructor & Destructor Documentation

VectorMap const Graph g,
MapRegistry r
[inline]
 

Graph and Registry initialized map constructor. Definition at line 89 of file vector_map.h.

References VectorMap::Graph, VectorMap::KeyIt, and VectorMap::MapBase.

VectorMap const Graph g,
MapRegistry r,
const Value &  v
[inline]
 

Constructor to use default value to initialize the map. Definition at line 94 of file vector_map.h.

References VectorMap::Graph, VectorMap::KeyIt, and VectorMap::MapBase.

VectorMap const VectorMap< MapRegistry, TT > &  c  )  [inline]
 

Assign operator to copy a map of an other map type. Definition at line 100 of file vector_map.h.

References VectorMap::container, lemon::INVALID, VectorMap::KeyIt, and VectorMap::MapBase.


Member Function Documentation

VectorMap& operator= const VectorMap< MapRegistry, TT > &  c  )  [inline]
 

Assign operator to copy a map of an other map type. Definition at line 111 of file vector_map.h.

References VectorMap::container, MapRegistry::MapBase::getGraph(), lemon::INVALID, and VectorMap::KeyIt.

Here is the call graph for this function:

ReferenceType operator[] const KeyType key  )  [inline]
 

The subscript operator. The map can be subscripted by the actual keys of the graph. Definition at line 126 of file vector_map.h.

References VectorMap::KeyType, and VectorMap::ReferenceType.

ConstReferenceType operator[] const KeyType key  )  const [inline]
 

The const subscript operator. The map can be subscripted by the actual keys of the graph. Definition at line 135 of file vector_map.h.

References VectorMap::ConstReferenceType, and VectorMap::KeyType.

void set const KeyType key,
const ValueType val
[inline]
 

Setter function of the map. Equivalent with map[key] = val. This is a compatibility feature with the not dereferable maps. Definition at line 143 of file vector_map.h.

References VectorMap::KeyType, and VectorMap::ValueType.

void add const KeyType key  )  [inline, virtual]
 

Add a new key to the map. It called by the map registry.

Implements MapRegistry::MapBase.

Definition at line 150 of file vector_map.h.

References VectorMap::KeyType.

void erase const KeyType key  )  [inline, virtual]
 

Erase a key from the map. It called by the map registry.

Implements MapRegistry::MapBase.

Definition at line 159 of file vector_map.h.

References VectorMap::KeyType.

void clear  )  [inline, virtual]
 

Clear the data structure.

Implements MapRegistry::MapBase.

Definition at line 163 of file vector_map.h.

Iterator begin  )  [inline]
 

Returns the begin iterator of the map. Definition at line 174 of file vector_map.h.

References VectorMap::Iterator, and VectorMap::KeyIt.

Iterator end  )  [inline]
 

Returns the end iterator of the map. Definition at line 180 of file vector_map.h.

References lemon::INVALID, and VectorMap::Iterator.

ConstIterator begin  )  const [inline]
 

Returns the begin ConstIterator of the map. Definition at line 186 of file vector_map.h.

References VectorMap::ConstIterator, and VectorMap::KeyIt.

ConstIterator end  )  const [inline]
 

Returns the end const_iterator of the map. Definition at line 192 of file vector_map.h.

References VectorMap::ConstIterator, and lemon::INVALID.


The documentation for this class was generated from the following file:
Generated on Thu Sep 30 12:18:40 2004 for LEMON by doxygen 1.3.8