#include <lemon/lemon_writer.h>
Inherits LemonWriter::SectionWriter.
Inheritance diagram for EdgeSetWriter:
@edgeset
edgeset_name
, but the edgeset_name
may be empty.The first line of the section contains the names of the maps separated with white spaces. Each next lines describes a edge in the edgeset. The line contains the source and the target nodes' label and the mapped values for each map.
If the edgeset contains an "label"
named map then it will be regarded as label map. This map should contain only unique values and when the writeLabel()
member will be called with an edge it will write it's label. Otherwise if the _forceLabelMap
constructor parameter is true then the label map will be the id in the graph.
The edgeset writer needs a node label writer to identify which nodes have to be connected. If a NodeSetWriter can write the nodes' label, it will be able to use with this class.
Public Member Functions | |
template<typename NodeLabelWriter> | |
EdgeSetWriter (LemonWriter &_writer, const Graph &_graph, const NodeLabelWriter &_nodeLabelWriter, const std::string &_name=std::string(), bool _forceLabelMap=true) | |
Constructor. | |
virtual | ~EdgeSetWriter () |
Destructor. | |
template<typename Map> | |
EdgeSetWriter & | writeEdgeMap (std::string name, const Map &map) |
Add a new edge map writer command for the writer. | |
template<typename Writer, typename Map> | |
EdgeSetWriter & | writeEdgeMap (std::string name, const Map &map, const Writer &writer=Writer()) |
Add a new edge map writer command for the writer. | |
bool | isLabelWriter () const |
Returns true if the edgeset can write the labels of the edges. | |
void | writeLabel (std::ostream &os, const Edge &item) const |
Write the label of the given edge. | |
Protected Member Functions | |
virtual std::string | header () |
The header of the section. | |
virtual void | write (std::ostream &os) |
Writer function of the section. |
|
Constructor for EdgeSetWriter. It creates the EdgeSetWriter and attach it into the given LemonWriter. It will write node labels by the |
|
Destructor for EdgeSetWriter. |
|
Add a new edge map writer command for the writer. |
|
Add a new edge map writer command for the writer. |
|
It gives back the header of the section. Implements LemonWriter::SectionWriter. |
|
Write the content of the section. Implements LemonWriter::SectionWriter. |
|
Returns true if the edgeset can write the labels of the edges. It is possible only if an "label" named map was written or the |
|
It writes the label of the given edge. If there was written an "label" named map then it will write the map value belongs to the edge. Otherwise if the |