Aim: Transforms a graph visitor into a single pass input range.
More...
#include <DGtal/graph/GraphVisitorRange.h>
template<typename TGraphVisitor>
class DGtal::GraphVisitorRange< TGraphVisitor >
Aim: Transforms a graph visitor into a single pass input range.
Description of template class 'GraphVisitorRange'
VisitorRange range(
new DFSVisitor( g,
Point( -2, -1 ) ) );
for ( VisitorRange::ConstIterator it = range.begin(), itEnd = range.end();
it != itEnd; ++it )
{
...
}
Aim: This class is useful to perform a depth-first exploration of a graph given a starting point or s...
Aim: Transforms a graph visitor into a single pass input range.
- Todo
- Complete boost::range_iterator<> accordingly.
- Examples
- graph/graphTraversal.cpp, and tutorial-examples/AreaSurfaceEstimation-final.cpp.
Definition at line 71 of file GraphVisitorRange.h.
◆ const_iterator
template<typename TGraphVisitor >
◆ ConstIterator
template<typename TGraphVisitor >
◆ Data
template<typename TGraphVisitor >
◆ Graph
template<typename TGraphVisitor >
◆ GraphVisitor
template<typename TGraphVisitor >
◆ Node
template<typename TGraphVisitor >
◆ NodeConstIterator
template<typename TGraphVisitor >
const iterator on pair (Vertex,distance) for visiting a graph by following a breadth first traversal.
Definition at line 208 of file GraphVisitorRange.h.
◆ Size
template<typename TGraphVisitor >
◆ Vertex
template<typename TGraphVisitor >
◆ VertexConstIterator
template<typename TGraphVisitor >
const iterator on Vertex for visiting a graph by following a breadth first traversal.
Definition at line 205 of file GraphVisitorRange.h.
◆ ~GraphVisitorRange()
template<typename TGraphVisitor >
◆ GraphVisitorRange() [1/3]
template<typename TGraphVisitor >
Constructor from dynamically allocated visitor. The visitor is acquired by this object.
- Parameters
-
visitorPtr | a pointer to a dynamically allocated visitor, which is acquired by this object. This visitor defines the starting point for the traversal. It must be valid (!= 0). |
◆ GraphVisitorRange() [2/3]
template<typename TGraphVisitor >
Constructor. Forbidden by default (protected to avoid g++ warnings).
◆ GraphVisitorRange() [3/3]
template<typename TGraphVisitor >
Copy constructor.
- Parameters
-
other | the object to clone. Forbidden by default. |
◆ begin()
template<typename TGraphVisitor >
◆ beginNode()
template<typename TGraphVisitor >
The value of the iterator has type Node, i.e. std::pair<Vertex,Data>.
- Returns
- a single pass input iterator pointing on the first element of the graph traversal induced by the given visitor.
NB: if you have already called begin() or beginNode(), it will raise an assertion.
◆ end()
template<typename TGraphVisitor >
◆ endNode()
template<typename TGraphVisitor >
The value of the iterator has type Node, i.e. std::pair<Vertex,Data>.
- Returns
- a single pass input iterator pointing after the last element of the graph traversal induced by the given visitor.
◆ isValid()
template<typename TGraphVisitor >
Checks the validity/consistency of the object.
- Returns
- 'true' if the object is valid, 'false' otherwise.
◆ operator=()
template<typename TGraphVisitor >
Assignment.
- Parameters
-
- Returns
- a reference on 'this'. Forbidden by default.
◆ selfDisplay()
template<typename TGraphVisitor >
Writes/Displays the object on an output stream.
- Parameters
-
out | the output stream where the object is written. |
◆ myVisitor
template<typename TGraphVisitor >
The documentation for this class was generated from the following file: