PathWriter Class Template Reference

#include <lemon/path_utils.h>

List of all members.


Detailed Description

template<typename Path>
class lemon::PathWriter< Path >

This class can write paths into files. You can store paths in distinict mapset or in attributes section.

      GraphWriter<SmartGraph> gw(std::cout, g);
      NodeMapWriter<SmartGraph> nmw(gw, g, gw);
     
      SmartGraph::NodeMap<Path<SmartGraph> > pnm(g);
      for (SmartGraph::NodeIt n(g); n != INVALID; ++n) {
        pnm[n] = bfs.path(n);
      }
      nmw.writeNodeMap("pnm", pnm, PathWriter<Path<SmartGraph> >(gw));
     
      gw.run();

Warning:
Do not use this class to write node or edge map values into usual nodesets or edgesets. You will not be able to read back your paths. Rather use NodeMapWriter, EdgeSetWriter or UEdgeSetWriter to dump paths from maps to lemon file.

Public Member Functions

template<typename EdgeLabelWriter>
 PathWriter (const EdgeLabelWriter &_edgeLabelWriter)
 Constructor.
void write (std::ostream &os, const Value &value) const
 Writer function.

Constructor & Destructor Documentation

PathWriter ( const EdgeLabelWriter &  _edgeLabelWriter  )  [inline, explicit]

The paramter shold be an edge label writer which could be a GraphWriter or an EdgeSetWriter.


Member Function Documentation

void write ( std::ostream &  os,
const Value value 
) const [inline]

Writes the path to the current stream. The representation is the edge labels beetween parentheses.


The documentation for this class was generated from the following file:

Generated on Sat Apr 19 14:21:14 2008 for LEMON by  doxygen 1.5.5