[Lemon-commits] [lemon_svn] deba: r2925 - hugo/trunk/lemon

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 21:51:17 CET 2006


Author: deba
Date: Wed Sep  6 12:01:15 2006
New Revision: 2925

Modified:
   hugo/trunk/lemon/graph_reader.h
   hugo/trunk/lemon/graph_writer.h

Log:
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<ListGraph>(std::cin, graph).

Instead of:

graphReader(std::cin, graph).




Modified: hugo/trunk/lemon/graph_reader.h
==============================================================================
--- hugo/trunk/lemon/graph_reader.h	(original)
+++ hugo/trunk/lemon/graph_reader.h	Wed Sep  6 12:01:15 2006
@@ -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<typename Graph>
-  GraphReader<Graph> graphReader(std::istream& is, Graph &g) {
-    return GraphReader<Graph>(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<typename Graph>
-  GraphReader<Graph> graphReader(const std::string& fn, Graph &g) {
-    return GraphReader<Graph>(fn, g);
-  }
-
   /// \brief The undirected graph reader class.
   ///
   /// The \c UGraphReader class provides the graph input. 
@@ -755,37 +725,6 @@
     AttributeReader<ReaderTraits> 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<typename Graph>
-  UGraphReader<Graph> uGraphReader(std::istream& is, Graph &g) {
-    return GraphReader<Graph>(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<typename Graph>
-  UGraphReader<Graph> uGraphReader(const std::string& fn, Graph &g) {
-    return GraphReader<Graph>(fn, g);
-  }
 
   /// @}
 }

Modified: hugo/trunk/lemon/graph_writer.h
==============================================================================
--- hugo/trunk/lemon/graph_writer.h	(original)
+++ hugo/trunk/lemon/graph_writer.h	Wed Sep  6 12:01:15 2006
@@ -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".
-  ///
-  /// 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.
+  /// 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.
   ///
   ///\code
   /// GraphWriter<ListGraph> 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<ListGraph, Node> 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 <typename Graph>
-  GraphWriter<Graph> graphWriter(std::ostream& os, const Graph &g) {
-    return GraphWriter<Graph>(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 <typename Graph>
-  GraphWriter<Graph> graphWriter(const std::string& fn, const Graph &g) {
-    return GraphWriter<Graph>(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 <i> node map writing command</i> to the writer.
+    /// This function issues a new <i> node map writing command</i> to
+    /// the writer.
     template <typename Map>
     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 <i> node map writing command</i> to the writer.
+    /// This function issues a new <i> node map writing command</i> to
+    /// the writer.
     template <typename Writer, typename Map>
     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 <i> edge map writing command</i> to the writer.
+    /// This function issues a new <i> edge map writing command</i> to
+    /// the writer.
     template <typename Map>
     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 <i> edge map writing command</i> to the writer.
+    /// This function issues a new <i> edge map writing command</i> to
+    /// the writer.
     template <typename Writer, typename Map>
     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<WriterTraits> 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 <typename Graph>
-  UGraphWriter<Graph> uGraphWriter(std::ostream& os, const Graph &g) {
-    return UGraphWriter<Graph>(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 <typename Graph>
-  UGraphWriter<Graph> uGraphWriter(const std::string& fn, 
-					   const Graph &g) {
-    return UGraphWriter<Graph>(fn, g);
-  }
-
   /// @}
 
 }



More information about the Lemon-commits mailing list