concepts::PathDumper

Declared in lemon/concepts/path.h, in the group Concepts; the same class on the Doxygen site.

template< typename GR >
class PathDumper

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:

GR – The digraph type in which the path is.

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.

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.

Public Functions

inline int length() const

Length of the path, i.e. the number of arcs on the path.

inline bool empty() const

Returns whether the path is empty.

inline LemonRangeWrapper1< ArcIt , PathDumper > arcs() const

Gets the collection of the arcs of the path.

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 );

inline LemonRangeWrapper1< RevArcIt , PathDumper > revArcs() const

Gets the collection of the arcs of the path in reverse direction.

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 );

class ArcIt

LEMON style iterator for enumerating the arcs of a path.

LEMON style iterator class for enumerating the arcs of a path.

Public Functions

inline ArcIt()

Default constructor.

inline ArcIt(Invalid)

Invalid constructor.

inline ArcIt( const PathDumper & )

Sets the iterator to the first arc of the given path.

inline operator Arc() const

Conversion to Arc.

inline ArcIt & operator++()

Next arc.

inline bool operator==( const ArcIt & ) const

Comparison operator.

inline bool operator!=( const ArcIt & ) const

Comparison operator.

inline bool operator<( const ArcIt & ) const

Comparison operator.

class RevArcIt

LEMON style iterator for enumerating the arcs of a path in reverse direction.

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

Public Functions

inline RevArcIt()

Default constructor.

inline RevArcIt(Invalid)

Invalid constructor.

inline RevArcIt( const PathDumper & )

Sets the iterator to the last arc of the given path.

inline operator Arc() const

Conversion to Arc.

inline RevArcIt & operator++()

Next arc.

inline bool operator==( const RevArcIt & ) const

Comparison operator.

inline bool operator!=( const RevArcIt & ) const

Comparison operator.

inline bool operator<( const RevArcIt & ) const

Comparison operator.

template< typename _Path >
struct Constraints

Public Functions

inline void constraints()