Home | Documentation | Download | Platforms | Projects | Mailing Lists | Version History

- Main Page
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# ne_map< Key, Value, Graph, Alloc > Class Template Reference

Baseclass for node_map and edge_map. More...

Inheritance diagram for ne_map< Key, Value, Graph, Alloc >:

[legend]

List of all members.

## Public Member Functions

void | init (const Graph &, Value def=Value())
value_reference | operator[] (Key key)
const_value_reference | operator[] (Key key) const
void | clear ()

## Protected Member Functions

| ne_map ()
| ne_map (const Graph &g, Value def=Value())

## Detailed Description

### template<class Key, class Value, class Graph, class Alloc = allocator<Value>>
class ne_map< Key, Value, Graph, Alloc >

Baseclass for node_map and edge_map.

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

## Constructor & Destructor Documentation

template<class Key, class Value, class Graph, class Alloc>

ne_map< Key, Value, Graph, Alloc >::ne_map | ( |  | ) | `[inline, protected]`

Constructs an empty `ne_map` not associated to any `graph`.

template<class Key, class Value, class Graph, class Alloc>

ne_map< Key, Value, Graph, Alloc >::ne_map | ( | const Graph & | g,
|  | Value | def = `Value()` |
| ) |  |  | `[inline, explicit, 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:

  | <code>g</code> | associated `graph`
  | <code>def</code> | default value

## Member Function Documentation

template<class Key, class Value, class Graph, class Alloc>

void ne_map< Key, Value, Graph, Alloc >::init | ( | const Graph & | g,
|  | Value | def = `Value()` |
| ) |  |  | `[inline]`

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

Parameters:

  | <code>g</code> | associated `graph`
  | <code>def</code> | default value

template<class Key, class Value, class Graph, class Alloc>

ne_map< Key, Value, Graph, Alloc >::value_reference ne_map< Key, Value, Graph, Alloc >::operator[] | ( | Key | key | ) | `[inline]`

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`.

template<class Key, class Value, class Graph, class Alloc>

ne_map< Key, Value, Graph, Alloc >::const_value_reference ne_map< Key, Value, Graph, Alloc >::operator[] | ( | Key | key | ) | const`[inline]`

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`.

template<class Key, class Value, class Graph, class Alloc>

void ne_map< Key, Value, Graph, Alloc >::clear | ( |  | ) | `[inline]`

Erases a elements of this nodemap

University of Passau - FMI - Theoretical Computer Science

Design © 2002, 2003 Marcus Raitner, University of Passau