diff -r 2edd8cd06eaf -r f0c48d7fa73d src/lemon/graph_writer.h --- a/src/lemon/graph_writer.h Wed Apr 27 10:42:58 2005 +0000 +++ b/src/lemon/graph_writer.h Wed Apr 27 10:44:58 2005 +0000 @@ -168,41 +168,42 @@ /// GraphWriter writer(std::cout, graph); /// \endcode /// - /// The \c addNodeMap() function declares a \c NodeMap writing command in the - /// \c GraphWriter. You should give as parameter the name of the map and the - /// map object. The NodeMap writing command with name "id" should write a - /// unique map because it is regarded as ID map. + /// The \c writeNodeMap() function declares a \c NodeMap writing + /// command in the \c GraphWriter. You should give as parameter + /// the name of the map and the map object. The NodeMap writing + /// command with name "id" should write a unique map because it + /// is regarded as ID map. /// /// \code /// IdMap nodeIdMap; - /// writer.addNodeMap("id", nodeIdMap); + /// writer.writeNodeMap("id", nodeIdMap); /// - /// writer.addNodeMap("x-coord", xCoordMap); - /// writer.addNodeMap("y-coord", yCoordMap); - /// writer.addNodeMap("color", colorMap); + /// writer.writeNodeMap("x-coord", xCoordMap); + /// writer.writeNodeMap("y-coord", yCoordMap); + /// writer.writeNodeMap("color", colorMap); /// \endcode /// - /// With the \c addEdgeMap() member function you can give an edge map + /// With the \c writeEdgeMap() member function you can give an edge map /// writing command similar to the NodeMaps. /// /// \code /// DescriptorMap > /// edgeDescMap(graph); - /// writer.addEdgeMap("descriptor", edgeDescMap); + /// writer.writeEdgeMap("descriptor", edgeDescMap); /// - /// writer.addEdgeMap("weight", weightMap); - /// writer.addEdgeMap("label", labelMap); + /// writer.writeEdgeMap("weight", weightMap); + /// writer.writeEdgeMap("label", labelMap); /// \endcode /// - /// With \c addNode() and \c addEdge() functions you can point out Nodes and - /// Edges in the graph. By example, you can write out the source and target - /// of the graph. + /// With \c writeNode() and \c writeEdge() functions you can + /// point out Nodes and Edges in the graph. By example, you can + /// write out the source and target of the graph. /// /// \code - /// writer.addNode("source", sourceNode); - /// writer.addNode("target", targetNode); + /// writer.writeNode("source", sourceNode); + /// writer.writeNode("target", targetNode); /// - /// writer.addEdge("observed", edge); + /// writer.writeEdge("observed", edge); /// \endcode /// /// After you give all write commands you must call the \c run() member @@ -216,7 +217,7 @@ /// \see QuotedStringWriter /// \see IdMap /// \see DescriptorMap - /// \see \ref GraphReader + /// \see \ref GraphWriter /// \see \ref graph-io-page /// \author Balazs Dezso template @@ -262,8 +263,8 @@ /// /// Add a new node map writer command for the writer. template - GraphWriter& addNodeMap(std::string name, const Map& map) { - return addNodeMap, Map>(name, map); } @@ -271,7 +272,7 @@ /// /// Add a new node map writer command for the writer. template - GraphWriter& addNodeMap(std::string name, const Map& map, + GraphWriter& writeNodeMap(std::string name, const Map& map, const Writer& writer = Writer()) { node_map_writers.push_back( make_pair(name, new MapWriter(map, writer))); @@ -284,8 +285,8 @@ /// /// Add a new edge map writer command for the writer. template - GraphWriter& addEdgeMap(std::string name, const Map& map) { - return addEdgeMap, Map>(name, map); } @@ -294,7 +295,7 @@ /// /// Add a new edge map writer command for the writer. template - GraphWriter& addEdgeMap(std::string name, + GraphWriter& writeEdgeMap(std::string name, const Map& map, const Writer& writer = Writer()) { edge_map_writers.push_back(make_pair(name, new MapWriter(map, writer))); @@ -304,7 +305,7 @@ /// \brief Add a new labeled node writer for the writer. /// /// Add a new labeled node writer for the writer. - GraphWriter& addNode(std::string name, const Node& node) { + GraphWriter& writeNode(std::string name, const Node& node) { node_writers.push_back(make_pair(name, node)); return *this; } @@ -312,7 +313,7 @@ /// \brief Add a new labeled edge writer for the writer. /// /// Add a new labeled edge writer for the writer. - GraphWriter& addEdge(std::string name, const Edge& edge) { + GraphWriter& writeEdge(std::string name, const Edge& edge) { edge_writers.push_back(make_pair(name, edge)); return *this; } @@ -467,16 +468,16 @@ void writeGraph(std::ostream& os, const Graph &g, const CapacityMap& capacity, const typename Graph::Node &s, const typename Graph::Node &t, const CostMap& cost) { - GraphWriter reader(os, g); + GraphWriter writer(os, g); IdMap nodeIdMap(g); - reader.addNodeMap("id", nodeIdMap); + writer.writeNodeMap("id", nodeIdMap); IdMap edgeIdMap(g); - reader.addEdgeMap("id", edgeIdMap); - reader.addEdgeMap("capacity", capacity); - reader.addEdgeMap("cost", cost); - reader.addNode("source", s); - reader.addNode("target", t); - reader.run(); + writer.writeEdgeMap("id", edgeIdMap); + writer.writeEdgeMap("capacity", capacity); + writer.writeEdgeMap("cost", cost); + writer.writeNode("source", s); + writer.writeNode("target", t); + writer.run(); } /// \brief Write a graph to the output. @@ -491,15 +492,15 @@ void writeGraph(std::ostream& os, const Graph &g, const CapacityMap& capacity, const typename Graph::Node &s, const typename Graph::Node &t) { - GraphWriter reader(os, g); + GraphWriter writer(os, g); IdMap nodeIdMap(g); - reader.addNodeMap("id", nodeIdMap); + writer.writeNodeMap("id", nodeIdMap); IdMap edgeIdMap(g); - reader.addEdgeMap("id", edgeIdMap); - reader.addEdgeMap("capacity", capacity); - reader.addNode("source", s); - reader.addNode("target", t); - reader.run(); + writer.writeEdgeMap("id", edgeIdMap); + writer.writeEdgeMap("capacity", capacity); + writer.writeNode("source", s); + writer.writeNode("target", t); + writer.run(); } /// \brief Write a graph to the output. @@ -512,14 +513,14 @@ template void writeGraph(std::ostream& os, const Graph &g, const CapacityMap& capacity, const typename Graph::Node &s) { - GraphWriter reader(os, g); + GraphWriter writer(os, g); IdMap nodeIdMap(g); - reader.addNodeMap("id", nodeIdMap); + writer.writeNodeMap("id", nodeIdMap); IdMap edgeIdMap(g); - reader.addEdgeMap("id", edgeIdMap); - reader.addEdgeMap("capacity", capacity); - reader.addNode("source", s); - reader.run(); + writer.writeEdgeMap("id", edgeIdMap); + writer.writeEdgeMap("capacity", capacity); + writer.writeNode("source", s); + writer.run(); } /// \brief Write a graph to the output. @@ -531,13 +532,13 @@ template void writeGraph(std::ostream& os, const Graph &g, const CapacityMap& capacity) { - GraphWriter reader(os, g); + GraphWriter writer(os, g); IdMap nodeIdMap(g); - reader.addNodeMap("id", nodeIdMap); + writer.writeNodeMap("id", nodeIdMap); IdMap edgeIdMap(g); - reader.addEdgeMap("id", edgeIdMap); - reader.addEdgeMap("capacity", capacity); - reader.run(); + writer.writeEdgeMap("id", edgeIdMap); + writer.writeEdgeMap("capacity", capacity); + writer.run(); } /// \brief Write a graph to the output. @@ -547,12 +548,12 @@ /// \param g The graph. template void writeGraph(std::ostream& os, const Graph &g) { - GraphWriter reader(os, g); + GraphWriter writer(os, g); IdMap nodeIdMap(g); - reader.addNodeMap("id", nodeIdMap); + writer.writeNodeMap("id", nodeIdMap); IdMap edgeIdMap(g); - reader.addEdgeMap("id", edgeIdMap); - reader.run(); + writer.writeEdgeMap("id", edgeIdMap); + writer.run(); } /// @}