Loading...
Searching...
No Matches
Graph::NodeIt Class Reference

## Detailed Description

This iterator goes through each node of the graph. Its usage is quite simple, for example, you can count the number of nodes in a graph `g` of type `Graph` like this:

int count=0;
for (Graph::NodeIt n(g); n!=INVALID; ++n) ++count;
lemon::INVALID
const Invalid INVALID
Invalid iterators.
Definition base.cc:32

`#include <lemon/concepts/graph.h>`

## Public Member Functions

| NodeIt ()
| Default constructor.
| NodeIt (const NodeIt &n)
| Copy constructor.
| NodeIt (Invalid)
| Invalid constructor & conversion.
| NodeIt (const Graph &)
| Sets the iterator to the first node.
| NodeIt (const Graph &, const Node &)
| Sets the iterator to the given node.
NodeIt & | operator++ ()
| Next node.

## Constructor & Destructor Documentation

## NodeIt() [1/5]

NodeIt | ( |  | ) |

inline

Default constructor.

Warning
  It sets the iterator to an undefined value.

## NodeIt() [2/5]

NodeIt | ( | const NodeIt & | n | ) |

inline

Copy constructor.

## NodeIt() [3/5]

NodeIt | ( | Invalid |  | ) |

inline

Initializes the iterator to be invalid.

See also
  Invalid for more details.

## NodeIt() [4/5]

NodeIt | ( | const Graph & |  | ) |

inline explicit

Sets the iterator to the first node of the given digraph.

## NodeIt() [5/5]

NodeIt | ( | const Graph & | ,
|  | const Node & | )

inline

Sets the iterator to the given node of the given digraph.

## Member Function Documentation

## operator++()

NodeIt & operator++ | ( |  | ) |

inline

Assign the iterator to the next node.