COIN-OR::LEMON - Graph Library

Changeset 2200:2f2ac1b1ca1e in lemon-0.x


Ignore:
Timestamp:
09/06/06 12:01:15 (13 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2925
Message:

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).

Location:
lemon
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lemon/graph_reader.h

    r2100 r2200  
    345345
    346346
    347   /// \brief Read a graph from the input.
    348   ///
    349   /// It is a helper function to read a graph from the given input
    350   /// stream. It gives back an GraphReader object and this object
    351   /// can read more maps, labeled nodes, edges and attributes.
    352   ///
    353   /// \warning Do not forget to call the \c run() function.
    354   ///
    355   /// \param is The input stream.
    356   /// \param g The graph.
    357   template<typename Graph>
    358   GraphReader<Graph> graphReader(std::istream& is, Graph &g) {
    359     return GraphReader<Graph>(is, g);
    360   }
    361 
    362   /// \brief Read a graph from the input.
    363   ///
    364   /// It is a helper function to read a graph from the given input
    365   /// file. It gives back an GraphReader object and this object
    366   /// can read more maps, labeled nodes, edges and attributes.
    367   ///
    368   /// \warning Do not forget to call the \c run() function.
    369   ///
    370   /// \param fn The input filename.
    371   /// \param g The graph.
    372   template<typename Graph>
    373   GraphReader<Graph> graphReader(const std::string& fn, Graph &g) {
    374     return GraphReader<Graph>(fn, g);
    375   }
    376 
    377347  /// \brief The undirected graph reader class.
    378348  ///
     
    756726  };
    757727
    758   /// \brief Read an undirected graph from the input.
    759   ///
    760   /// It is a helper function to read an undirected graph from the given input
    761   /// stream. It gives back an UGraphReader object and this object
    762   /// can read more maps, labeled nodes, edges, undirected edges and
    763   /// attributes.
    764   ///
    765   /// \warning Do not forget to call the \c run() function.
    766   ///
    767   /// \param is The input stream.
    768   /// \param g The graph.
    769   template<typename Graph>
    770   UGraphReader<Graph> uGraphReader(std::istream& is, Graph &g) {
    771     return GraphReader<Graph>(is, g);
    772   }
    773 
    774   /// \brief Read an undirected graph from the input.
    775   ///
    776   /// It is a helper function to read an undirected graph from the given input
    777   /// file. It gives back an UGraphReader object and this object
    778   /// can read more maps, labeled nodes, edges, undirected edges and
    779   /// attributes.
    780   ///
    781   /// \warning Do not forget to call the \c run() function.
    782   ///
    783   /// \param fn The input filename.
    784   /// \param g The graph.
    785   template<typename Graph>
    786   UGraphReader<Graph> uGraphReader(const std::string& fn, Graph &g) {
    787     return GraphReader<Graph>(fn, g);
    788   }
    789728
    790729  /// @}
  • lemon/graph_writer.h

    r2083 r2200  
    3737  /// \brief The graph writer class.
    3838  ///
    39   /// The \c GraphWriter class provides the graph output.
    40   /// Before you read this documentation it might be useful to read the general
    41   /// description of  \ref graph-io-page "Graph Input-Output".
    42   ///
    43   /// To write a graph
    44   /// you should first give writing commands to the writer. You can declare
    45   /// write commands as \c NodeMap or \c EdgeMap writing and labeled Node and
    46   /// Edge writing.
     39  /// The \c GraphWriter class provides the graph output.  Before you
     40  /// read this documentation it might be useful to read the general
     41  /// description of \ref graph-io-page "Graph Input-Output".
     42  ///
     43  /// To write a graph you should first give writing commands to the
     44  /// writer. You can declare write commands as \c NodeMap or \c
     45  /// EdgeMap writing and labeled Node and Edge writing.
    4746  ///
    4847  ///\code
     
    5049  ///\endcode
    5150  ///
    52   /// The \c writeNodeMap() function declares a \c NodeMap writing
    53   /// command in the \c GraphWriter. You should give as parameter
    54   /// the name of the map and the map object. The NodeMap writing
    55   /// command with name "label" should write a unique map because it
    56   /// is regarded as label map (such a map is essential if the graph has edges).
     51  /// The \c writeNodeMap() function declares a \c NodeMap writing
     52  /// command in the \c GraphWriter. You should give as parameter the
     53  /// name of the map and the map object. The NodeMap writing command
     54  /// with name "label" should write a unique map because it is
     55  /// regarded as label map (such a map is essential if the graph has
     56  /// edges).
    5757  ///
    5858  ///\code
     
    282282  };
    283283
    284 
    285 
    286   /// \brief Write a graph to the output.
    287   ///
    288   /// It is a helper function to write a graph to the given output
    289   /// stream. It gives back a GraphWriter object and this object
    290   /// can write more maps, labeled nodes and edges and attributes.
    291   /// \warning Do not forget to call the \c run() function.
    292   ///
    293   /// \param os The output stream.
    294   /// \param g The graph.
    295   template <typename Graph>
    296   GraphWriter<Graph> graphWriter(std::ostream& os, const Graph &g) {
    297     return GraphWriter<Graph>(os, g);
    298   }
    299 
    300   /// \brief Write a graph to the output.
    301   ///
    302   /// It is a helper function to write a graph to the given output
    303   /// file. It gives back a GraphWriter object and this object
    304   /// can write more maps, labeled nodes and edges and attributes.
    305   /// \warning Do not forget to call the \c run() function.
    306   ///
    307   /// \param fn The filename.
    308   /// \param g The graph.
    309   template <typename Graph>
    310   GraphWriter<Graph> graphWriter(const std::string& fn, const Graph &g) {
    311     return GraphWriter<Graph>(fn, g);
    312   }
    313284
    314285  /// \brief The undirected graph writer class.
     
    439410    /// \brief Issue a new node map writing command to the writer.
    440411    ///
    441    /// This function issues a new <i> node map writing command</i> to the writer.
     412    /// This function issues a new <i> node map writing command</i> to
     413    /// the writer.
    442414    template <typename Map>
    443415    UGraphWriter& writeNodeMap(std::string name, const Map& map) {
     
    448420    /// \brief Issue a new node map writing command to the writer.
    449421    ///
    450    /// This function issues a new <i> node map writing command</i> to the writer.
     422    /// This function issues a new <i> node map writing command</i> to
     423    /// the writer.
    451424    template <typename Writer, typename Map>
    452425    UGraphWriter& writeNodeMap(std::string name, const Map& map,
     
    458431    /// \brief Issue a new edge map writing command to the writer.
    459432    ///
    460    /// This function issues a new <i> edge map writing command</i> to the writer.
     433    /// This function issues a new <i> edge map writing command</i> to
     434    /// the writer.
    461435    template <typename Map>
    462436    UGraphWriter& writeEdgeMap(std::string name, const Map& map) {
     
    467441    /// \brief Issue a new edge map writing command to the writer.
    468442    ///
    469    /// This function issues a new <i> edge map writing command</i> to the writer.
     443    /// This function issues a new <i> edge map writing command</i> to
     444    /// the writer.
    470445    template <typename Writer, typename Map>
    471446    UGraphWriter& writeEdgeMap(std::string name, const Map& map,
     
    578553    /// \brief Write the label of the given undirected edge.
    579554    ///
    580     /// It writes the label of the given undirected edge. If there was written
    581     /// an "label" named edge map then it will write the map value belonging to
    582     /// the edge.
     555    /// It writes the label of the given undirected edge. If there was
     556    /// written an "label" named edge map then it will write the map
     557    /// value belonging to the edge.
    583558    void writeLabel(std::ostream& os, const UEdge& item) const {
    584559      u_edgeset_writer.writeLabel(os, item);
     
    600575  };
    601576
    602   /// \brief Write an undirected graph to the output.
    603   ///
    604   /// It is a helper function to write an undirected graph to the given output
    605   /// stream. It gives back an UGraphWriter object and this object
    606   /// can write more maps, labeled nodes and edges and attributes.
    607   /// \warning Do not forget to call the \c run() function.
    608   ///
    609   /// \param os The output stream.
    610   /// \param g The graph.
    611   template <typename Graph>
    612   UGraphWriter<Graph> uGraphWriter(std::ostream& os, const Graph &g) {
    613     return UGraphWriter<Graph>(os, g);
    614   }
    615 
    616   /// \brief Write an undirected graph to the output.
    617   ///
    618   /// It is a helper function to write an undirected graph to the given output
    619   /// file. It gives back an UGraphWriter object and this object
    620   /// can write more maps, labeled nodes, edges, undirected edges and
    621   /// attributes.
    622   ///
    623   /// \warning Do not forget to call the \c run() function.
    624   ///
    625   /// \param fn The output file.
    626   /// \param g The graph.
    627   template <typename Graph>
    628   UGraphWriter<Graph> uGraphWriter(const std::string& fn,
    629                                            const Graph &g) {
    630     return UGraphWriter<Graph>(fn, g);
    631   }
    632 
    633577  /// @}
    634578
Note: See TracChangeset for help on using the changeset viewer.