latest version v1.9 - last update 10 Apr 2010 |
The graph iterator iterates on all nodes. More...
#include <ltiAdjacencyGraph.h>
Public Member Functions | |
iterator () | |
iterator (const iterator &other) | |
iterator & | operator++ () |
iterator | operator++ (int) |
iterator & | operator-- () |
iterator | operator-- (int) |
bool | operator== (const iterator &other) const |
bool | operator!= (const iterator &other) const |
node_type & | operator* () |
id_type | id () const |
iterator & | operator= (const iterator &other) |
Protected Member Functions | |
iterator (const int startPos, nodes_type *vct) | |
const int & | getPos () const |
const nodes_type * | getVector () const |
The graph iterator iterates on all nodes.
This class is similar to the usual iterators of the STL. The iterator allows you to access the data the nodes, but you can also get the node's id for other kind of processing.
For example:
adjacencyGraph::iterator it; // ... do something with a graph an let the iterator point somewhere // therein. adjacencyGraphNode node = (*it); // get the pointed data. adjacencyGraph::id_type = it.id(); // get the id of the pointed node.
lti::adjacencyGraph< N, W, D, F, E >::iterator::iterator | ( | ) | [inline] |
Default constructor.
lti::adjacencyGraph< N, W, D, F, E >::iterator::iterator | ( | const iterator & | other | ) | [inline] |
copy constructor
lti::adjacencyGraph< N, W, D, F, E >::iterator::iterator | ( | const int | startPos, | |
nodes_type * | vct | |||
) | [inline, explicit, protected] |
protected constructor (for internal use only)
const int& lti::adjacencyGraph< N, W, D, F, E >::iterator::getPos | ( | ) | const [inline, protected] |
for internal use only!!!
Referenced by lti::adjacencyGraph< N, W, D, F, E >::const_iterator::operator=().
const nodes_type* lti::adjacencyGraph< N, W, D, F, E >::iterator::getVector | ( | ) | const [inline, protected] |
for internal use only!!!
Referenced by lti::adjacencyGraph< N, W, D, F, E >::const_iterator::operator=().
id_type lti::adjacencyGraph< N, W, D, F, E >::iterator::id | ( | ) | const [inline] |
get pointed node's id.
Please note that the id can become invalid if the pointed node is removed.
bool lti::adjacencyGraph< N, W, D, F, E >::iterator::operator!= | ( | const iterator & | other | ) | const [inline] |
compare if both pointed positions are different
node_type& lti::adjacencyGraph< N, W, D, F, E >::iterator::operator* | ( | ) | [inline] |
get pointed data
iterator lti::adjacencyGraph< N, W, D, F, E >::iterator::operator++ | ( | int | ) | [inline] |
advance to next item
iterator& lti::adjacencyGraph< N, W, D, F, E >::iterator::operator++ | ( | ) | [inline] |
advance to next item
iterator lti::adjacencyGraph< N, W, D, F, E >::iterator::operator-- | ( | int | ) | [inline] |
recede to previous item
iterator& lti::adjacencyGraph< N, W, D, F, E >::iterator::operator-- | ( | ) | [inline] |
recede to previous item // prefix
iterator& lti::adjacencyGraph< N, W, D, F, E >::iterator::operator= | ( | const iterator & | other | ) | [inline] |
copy member
bool lti::adjacencyGraph< N, W, D, F, E >::iterator::operator== | ( | const iterator & | other | ) | const [inline] |
compare if both pointed positions are the same