# HG changeset patch # User deba # Date 1157536875 0 # Node ID 2f2ac1b1ca1ec74f29954bb73c39a5df13cc2c3f # Parent 1229af45cc69981dad5f42ccd79bf7263e3f1d3a An easy avoiding of a bug The functional interfaces are removed. Better solution could be a reference counted core of the io interfaces Now it is huge work so just write that: GraphReader(std::cin, graph). Instead of: graphReader(std::cin, graph). diff -r 1229af45cc69 -r 2f2ac1b1ca1e lemon/graph_reader.h --- a/lemon/graph_reader.h Wed Sep 06 09:55:37 2006 +0000 +++ b/lemon/graph_reader.h Wed Sep 06 10:01:15 2006 +0000 @@ -344,36 +344,6 @@ }; - /// \brief Read a graph from the input. - /// - /// It is a helper function to read a graph from the given input - /// stream. It gives back an GraphReader object and this object - /// can read more maps, labeled nodes, edges and attributes. - /// - /// \warning Do not forget to call the \c run() function. - /// - /// \param is The input stream. - /// \param g The graph. - template - GraphReader graphReader(std::istream& is, Graph &g) { - return GraphReader(is, g); - } - - /// \brief Read a graph from the input. - /// - /// It is a helper function to read a graph from the given input - /// file. It gives back an GraphReader object and this object - /// can read more maps, labeled nodes, edges and attributes. - /// - /// \warning Do not forget to call the \c run() function. - /// - /// \param fn The input filename. - /// \param g The graph. - template - GraphReader graphReader(const std::string& fn, Graph &g) { - return GraphReader(fn, g); - } - /// \brief The undirected graph reader class. /// /// The \c UGraphReader class provides the graph input. @@ -755,37 +725,6 @@ AttributeReader attribute_reader; }; - /// \brief Read an undirected graph from the input. - /// - /// It is a helper function to read an undirected graph from the given input - /// stream. It gives back an UGraphReader object and this object - /// can read more maps, labeled nodes, edges, undirected edges and - /// attributes. - /// - /// \warning Do not forget to call the \c run() function. - /// - /// \param is The input stream. - /// \param g The graph. - template - UGraphReader uGraphReader(std::istream& is, Graph &g) { - return GraphReader(is, g); - } - - /// \brief Read an undirected graph from the input. - /// - /// It is a helper function to read an undirected graph from the given input - /// file. It gives back an UGraphReader object and this object - /// can read more maps, labeled nodes, edges, undirected edges and - /// attributes. - /// - /// \warning Do not forget to call the \c run() function. - /// - /// \param fn The input filename. - /// \param g The graph. - template - UGraphReader uGraphReader(const std::string& fn, Graph &g) { - return GraphReader(fn, g); - } /// @} } diff -r 1229af45cc69 -r 2f2ac1b1ca1e lemon/graph_writer.h --- a/lemon/graph_writer.h Wed Sep 06 09:55:37 2006 +0000 +++ b/lemon/graph_writer.h Wed Sep 06 10:01:15 2006 +0000 @@ -36,24 +36,24 @@ /// \brief The graph writer class. /// - /// The \c GraphWriter class provides the graph output. - /// Before you read this documentation it might be useful to read the general - /// description of \ref graph-io-page "Graph Input-Output". + /// The \c GraphWriter class provides the graph output. Before you + /// read this documentation it might be useful to read the general + /// description of \ref graph-io-page "Graph Input-Output". /// - /// To write a graph - /// you should first give writing commands to the writer. You can declare - /// write commands as \c NodeMap or \c EdgeMap writing and labeled Node and - /// Edge writing. + /// To write a graph you should first give writing commands to the + /// writer. You can declare write commands as \c NodeMap or \c + /// EdgeMap writing and labeled Node and Edge writing. /// ///\code /// GraphWriter writer(std::cout, graph); ///\endcode /// - /// 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 "label" should write a unique map because it - /// is regarded as label map (such a map is essential if the graph has edges). + /// 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 "label" should write a unique map because it is + /// regarded as label map (such a map is essential if the graph has + /// edges). /// ///\code /// IdMap nodeLabelMap; @@ -282,35 +282,6 @@ }; - - /// \brief Write a graph to the output. - /// - /// It is a helper function to write a graph to the given output - /// stream. It gives back a GraphWriter object and this object - /// can write more maps, labeled nodes and edges and attributes. - /// \warning Do not forget to call the \c run() function. - /// - /// \param os The output stream. - /// \param g The graph. - template - GraphWriter graphWriter(std::ostream& os, const Graph &g) { - return GraphWriter(os, g); - } - - /// \brief Write a graph to the output. - /// - /// It is a helper function to write a graph to the given output - /// file. It gives back a GraphWriter object and this object - /// can write more maps, labeled nodes and edges and attributes. - /// \warning Do not forget to call the \c run() function. - /// - /// \param fn The filename. - /// \param g The graph. - template - GraphWriter graphWriter(const std::string& fn, const Graph &g) { - return GraphWriter(fn, g); - } - /// \brief The undirected graph writer class. /// /// The \c UGraphWriter class provides the ugraph output. To write @@ -438,7 +409,8 @@ /// \brief Issue a new node map writing command to the writer. /// - /// This function issues a new node map writing command to the writer. + /// This function issues a new node map writing command to + /// the writer. template UGraphWriter& writeNodeMap(std::string name, const Map& map) { nodeset_writer.writeNodeMap(name, map); @@ -447,7 +419,8 @@ /// \brief Issue a new node map writing command to the writer. /// - /// This function issues a new node map writing command to the writer. + /// This function issues a new node map writing command to + /// the writer. template UGraphWriter& writeNodeMap(std::string name, const Map& map, const Writer& writer = Writer()) { @@ -457,7 +430,8 @@ /// \brief Issue a new edge map writing command to the writer. /// - /// This function issues a new edge map writing command to the writer. + /// This function issues a new edge map writing command to + /// the writer. template UGraphWriter& writeEdgeMap(std::string name, const Map& map) { u_edgeset_writer.writeEdgeMap(name, map); @@ -466,7 +440,8 @@ /// \brief Issue a new edge map writing command to the writer. /// - /// This function issues a new edge map writing command to the writer. + /// This function issues a new edge map writing command to + /// the writer. template UGraphWriter& writeEdgeMap(std::string name, const Map& map, const Writer& writer = Writer()) { @@ -577,9 +552,9 @@ /// \brief Write the label of the given undirected edge. /// - /// It writes the label of the given undirected edge. If there was written - /// an "label" named edge map then it will write the map value belonging to - /// the edge. + /// It writes the label of the given undirected edge. If there was + /// written an "label" named edge map then it will write the map + /// value belonging to the edge. void writeLabel(std::ostream& os, const UEdge& item) const { u_edgeset_writer.writeLabel(os, item); } @@ -599,37 +574,6 @@ AttributeWriter attribute_writer; }; - /// \brief Write an undirected graph to the output. - /// - /// It is a helper function to write an undirected graph to the given output - /// stream. It gives back an UGraphWriter object and this object - /// can write more maps, labeled nodes and edges and attributes. - /// \warning Do not forget to call the \c run() function. - /// - /// \param os The output stream. - /// \param g The graph. - template - UGraphWriter uGraphWriter(std::ostream& os, const Graph &g) { - return UGraphWriter(os, g); - } - - /// \brief Write an undirected graph to the output. - /// - /// It is a helper function to write an undirected graph to the given output - /// file. It gives back an UGraphWriter object and this object - /// can write more maps, labeled nodes, edges, undirected edges and - /// attributes. - /// - /// \warning Do not forget to call the \c run() function. - /// - /// \param fn The output file. - /// \param g The graph. - template - UGraphWriter uGraphWriter(const std::string& fn, - const Graph &g) { - return UGraphWriter(fn, g); - } - /// @} }