IdMap<UndirListGraph, Node> nodeIdMap;
writer.writeNodeMap("id", nodeIdMap);
writer.writeNodeMap("coords", coords);
writer.writeNodeMap("color", colorMap);
DescriptorMap<ListGraph, Edge, ListGraph::EdgeMap<int> >
edgeDescMap(graph);
writer.writeUndirEdgeMap("descriptor", edgeDescMap);
writer.writeUndirEdgeMap("weight", weightMap);
writer.writeUndirEdgeMap("label", labelMap);
The EdgeMap handling is just a syntactical sugar. It writes two undirected edge map with '+' and '-' prefix in the name.
writer.writeNode("source", sourceNode);
writer.writeNode("target", targetNode);
writer.writeUndirEdge("observed", undirEdge);
|
Public Member Functions |
| UndirGraphWriter (std::ostream &_os, const Graph &_graph) |
| Construct a new UndirGraphWriter.
|
| UndirGraphWriter (const std::string &_filename, const Graph &_graph) |
| Construct a new UndirGraphWriter.
|
| UndirGraphWriter (LemonWriter &_writer, const Graph &_graph) |
| Construct a new UndirGraphWriter.
|
| ~UndirGraphWriter () |
| Destruct the graph writer.
|
template<typename Map> |
UndirGraphWriter & | writeNodeMap (std::string name, const Map &map) |
| This function issues a new node map writing command to the writer.
|
template<typename Writer, typename Map> |
UndirGraphWriter & | writeNodeMap (std::string name, const Map &map, const Writer &writer=Writer()) |
| This function issues a new node map writing command to the writer.
|
template<typename Map> |
UndirGraphWriter & | writeEdgeMap (std::string name, const Map &map) |
| This function issues a new edge map writing command to the writer.
|
template<typename Writer, typename Map> |
UndirGraphWriter & | writeEdgeMap (std::string name, const Map &map, const Writer &writer=Writer()) |
| This function issues a new edge map writing command to the writer.
|
template<typename Map> |
UndirGraphWriter & | writeUndirEdgeMap (std::string name, const Map &map) |
| Issue a new undirected edge map writing command to the writer.
|
template<typename Writer, typename Map> |
UndirGraphWriter & | writeUndirEdgeMap (std::string name, const Map &map, const Writer &writer=Writer()) |
| Issue a new undirected edge map writing command to the writer.
|
UndirGraphWriter & | writeNode (std::string name, const Node &node) |
| Issue a new labeled node writer to the writer.
|
UndirGraphWriter & | writeEdge (std::string name, const Edge &edge) |
| Issue a new labeled edge writer to the writer.
|
UndirGraphWriter & | writeUndirEdge (std::string name, const UndirEdge &edge) |
| Issue a new labeled undirected edge writing command to the writer.
|
template<typename Value> |
UndirGraphWriter & | writeAttribute (std::string name, const Value &value) |
| Issue a new attribute writing command.
|
template<typename Writer, typename Value> |
UndirGraphWriter & | writeAttribute (std::string name, const Value &value, const Writer &writer) |
| Issue a new attribute writing command.
|
| operator LemonWriter & () |
| Conversion operator to LemonWriter.
|
void | run () |
| Executes the writing commands.
|
void | writeId (std::ostream &os, const Node &item) const |
| Write the id of the given node.
|
void | writeId (std::ostream &os, const Edge &item) const |
| Write the id of the given edge.
|
void | writeId (std::ostream &os, const UndirEdge &item) const |
| Write the id of the given undirected edge.
|