abLEMON 1.9.0-101-gccb8629
A maintained fork of LEMON
Loading...
Searching...
No Matches
PathDumper< GR > Class Template Reference

A skeleton structure for path dumpers. More...

#include <lemon/concepts/path.h>

Classes

class  ArcIt
 LEMON style iterator for enumerating the arcs of a path. More...
class  RevArcIt
 LEMON style iterator for enumerating the arcs of a path in reverse direction. More...

Public Types

typedef GR Digraph
 Type of the underlying digraph.
typedef Digraph::Arc Arc
 Arc type of the underlying digraph.
typedef False RevPathTag
 Forward or reverse dumping.

Public Member Functions

int length () const
 Length of the path, i.e. the number of arcs on the path.
bool empty () const
 Returns whether the path is empty.
LemonRangeWrapper1< ArcIt , PathDumper > arcs () const
 Gets the collection of the arcs of the path.
LemonRangeWrapper1< RevArcIt , PathDumper > revArcs () const
 Gets the collection of the arcs of the path in reverse direction.

Detailed Description

template< typename GR >
class lemon::concepts::PathDumper< GR >

A skeleton structure for path dumpers. The path dumpers are the generalization of the paths, they can enumerate the arcs of the path either in forward or in backward order. These classes are typically not used directly, they are rather used to be assigned to a real path type.

The main purpose of this concept is that the shortest path algorithms can enumerate the arcs easily in reverse order. In LEMON, such algorithms give back a (reverse) path dumper that can be assigned to a real path. The dumpers can be implemented as an adaptor class to the predecessor map.

Template Parameters
GRThe digraph type in which the path is.

Member Typedef Documentation

◆ RevPathTag

template< typename GR >
typedef False RevPathTag

If this tag is defined to be True, then reverse dumping is provided in the path dumper. In this case, RevArcIt iterator should be implemented instead of ArcIt iterator.

Member Function Documentation

◆ arcs()

template< typename GR >
LemonRangeWrapper1< ArcIt , PathDumper > arcs ( ) const
inline

This function can be used for iterating on the arcs of the path. It returns a wrapped ArcIt, which looks like an STL container (by having begin() and end()) which you can use in range-based for loops, STL algorithms, etc. For example you can write:

for( auto a : p.arcs() )
doSomething( a );

◆ revArcs()

template< typename GR >
LemonRangeWrapper1< RevArcIt , PathDumper > revArcs ( ) const
inline

This function can be used for iterating on the arcs of the path in reverse direction. It returns a wrapped RevArcIt, which looks like an STL container (by having begin() and end()) which you can use in range-based for loops, STL algorithms, etc. For example you can write:

for( auto a : p.revArcs() )
doSomething( a );