ne_map Class Reference

[Index] [Hierarchy] [Headers]


Baseclass for node_map and edge_map More...

#include <GTL/ne_map.h>

Template Form: template <class Key, class Value, class Alloc = allocator<Value> > ne_map

Public Members

Protected Members


Detailed Description

ne_map is the common implementation of node_map and edge_map and cannot be used directly.


void init(const graph &, Value def=Value() [public]

Initializes the ne_map to hold information for the elements of graph g. def is the value associated with all elements.

Parameters:
def default value
g associated graph

value_reference operator[](Key key) [public]

Read/write accessor function to the value associated with key. Use this function to change the value of an element in the ne_map. Assume that ne is a ne_map<int>. Then you can assign the value 5 to key with:

ne[key] = 5;

If there is no entry in the ne_map associated with key, one is created.

Parameters:
key Key of the Entry to change
Returns:
a reference to the value associated to key.

const_value_reference operator[](Key key) const [public]

Read-only accessor function to the value associated with key. Use this function to read the value of an element in the ne_map. Assume that ne is a ne_map<int>. Then you can print the value associated with key with:

cout << ne[key];

Parameters:
key Key of the Entry to look up
Returns:
a const reference to the value associated to key.

ne_map() [protected]

Constructs an empty ne_map not associated to any graph.

explicit ne_map(const graph &g, Value def=Value() [protected]

Constructs a ne_map associated to the graph g. The value associated to each key is set to def. You may (but need not) call ne_map::init(const graph &, T) to associate it to a graph.

Parameters:
def default value
g associated graph

Kdoc