EdgeMapWriter< _Graph, _Traits > Class Template Reference
[Section readers and writers]


Detailed Description

template<typename _Graph, typename _Traits = DefaultWriterTraits>
class lemon::EdgeMapWriter< _Graph, _Traits >

The lemon format can store maps in the edgeset. This class let you make distinict section to store maps. The main purpose of this class is a logical separation of some maps. The other useful application could be to store paths in edge maps.

The first line of the section contains the names of the maps separated with white spaces. Each next line describes an item in the itemset, and contains in the first column the label of the item and then the mapped values for each map. #include <lemon/lemon_writer.h>

Inheritance diagram for EdgeMapWriter< _Graph, _Traits >:

Inheritance graph
[legend]

List of all members.

Public Member Functions

template<typename _LabelWriter >
 EdgeMapWriter (LemonWriter &_writer, const Graph &_graph, const _LabelWriter &_labelWriter, const std::string &_name=std::string(), bool _forceSort=true)
 Constructor.
virtual ~EdgeMapWriter ()
 Destructor.
template<typename Map >
EdgeMapWriterwriteEdgeMap (std::string label, const Map &map)
template<typename ItemWriter , typename Map >
EdgeMapWriterwriteEdgeMap (std::string label, const Map &map, const ItemWriter &iw=ItemWriter())

Protected Member Functions

virtual std::string header ()
 The header of the section.
virtual void write (std::ostream &os)
 Writer function of the section.


Constructor & Destructor Documentation

EdgeMapWriter ( LemonWriter _writer,
const Graph &  _graph,
const _LabelWriter &  _labelWriter,
const std::string &  _name = std::string(),
bool  _forceSort = true 
) [inline]

Constructor for EdgeMapWriter. It creates the EdgeMapWriter and attach it into the given LemonWriter. If the the _forceSort is true then the writer will write the edges sorted by the labels.

virtual ~EdgeMapWriter (  )  [inline, virtual]

Destructor for EdgeMapWriter.


Member Function Documentation

EdgeMapWriter& writeEdgeMap ( std::string  label,
const Map &  map 
) [inline]

Add a new edge map writer command for the writer.

EdgeMapWriter& writeEdgeMap ( std::string  label,
const Map &  map,
const ItemWriter &  iw = ItemWriter() 
) [inline]

Add a new edge map writer command for the writer.

virtual std::string header (  )  [inline, protected, virtual]

It gives back the header of the section.

Implements SectionWriter.

virtual void write ( std::ostream &  os  )  [inline, protected, virtual]

Write the content of the section.

Implements SectionWriter.


Generated on Thu Jun 4 04:05:17 2009 for LEMON by  doxygen 1.5.9