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


Detailed Description

template<typename _Graph, typename _Item>
class lemon::DescriptorMap< _Graph, _Item >

The DescriptorMap class provides a unique and continuous (but mutable) descriptor (id) for each item of the same type (e.g. node) in the graph. This id is This map can be inverted with its member class InverseMap.

Parameters:
_Graph The graph class the DescriptorMap belongs to.
_Item The Item is the Key of the Map. It may be Node, Edge or UEdge.
#include <lemon/graph_utils.h>

Inheritance diagram for DescriptorMap< _Graph, _Item >:

Inheritance graph
[legend]

List of all members.

Classes

class  InverseMap

Public Types

typedef _Graph Graph
 The graph class of DescriptorMap.
typedef Map::Key Key
 The key type of DescriptorMap (Node, Edge, UEdge).
typedef Map::Value Value
 The value type of DescriptorMap.

Public Member Functions

 DescriptorMap (const Graph &_graph)
 Constructor.
unsigned int size () const
 Returns the maximal value plus one.
void swap (const Item &p, const Item &q)
int operator[] (const Item &item) const
 Gives back the descriptor of the item.
Item operator() (int id) const
 Gives back the item by its descriptor.
const InverseMap inverse () const

Protected Member Functions

virtual void add (const Item &item)
 Add a new key to the map.
virtual void add (const std::vector< Item > &items)
 Add more new keys to the map.
virtual void erase (const Item &item)
 Erase the key from the map.
virtual void erase (const std::vector< Item > &items)
 Erase more keys from the map.
virtual void build ()
 Build the unique map.
virtual void clear ()
 Clear the keys from the map.


Constructor & Destructor Documentation

DescriptorMap ( const Graph _graph  )  [inline, explicit]

Constructor for descriptor map.


Member Function Documentation

virtual void add ( const Item &  item  )  [inline, protected, virtual]

Add a new key to the map. It is called by the AlterationNotifier.

Reimplemented from ArrayMap< _Graph, _Item, _Value >.

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

Add more new keys to the map. It is called by the AlterationNotifier.

Reimplemented from ArrayMap< _Graph, _Item, _Value >.

virtual void erase ( const Item &  item  )  [inline, protected, virtual]

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

Reimplemented from ArrayMap< _Graph, _Item, _Value >.

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

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

Reimplemented from ArrayMap< _Graph, _Item, _Value >.

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

Build the unique map. It is called by the AlterationNotifier.

Reimplemented from ArrayMap< _Graph, _Item, _Value >.

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

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

Reimplemented from ArrayMap< _Graph, _Item, _Value >.

unsigned int size (  )  const [inline]

Returns the maximal value plus one in the map.

void swap ( const Item &  p,
const Item &  q 
) [inline]

Swaps the position of the two items in the map.

int operator[] ( const Item &  item  )  const [inline]

Gives back the mutable and unique descriptor of the map.

Reimplemented from ArrayMap< _Graph, _Item, _Value >.

Item operator() ( int  id  )  const [inline]

Gives back th item by its descriptor.

const InverseMap inverse (  )  const [inline]

Gives back the inverse of the map.


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