lemon/lgf_writer.h
changeset 317 a0ab96ad65fe
parent 295 7c796c1cf1b0
child 319 5e12d7734036
     1.1 --- a/lemon/lgf_writer.h	Thu Oct 09 16:47:01 2008 +0200
     1.2 +++ b/lemon/lgf_writer.h	Thu Oct 09 16:20:37 2008 +0100
     1.3 @@ -351,17 +351,38 @@
     1.4    template <typename Digraph>
     1.5    class DigraphWriter;
     1.6  
     1.7 +  /// \brief Return a \ref DigraphWriter class
     1.8 +  ///
     1.9 +  /// This function just returns a \ref DigraphWriter class.
    1.10 +  /// \relates DigraphWriter
    1.11    template <typename Digraph>
    1.12    DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
    1.13 -                                       std::ostream& os = std::cout);
    1.14 +                                       std::ostream& os = std::cout) {
    1.15 +    DigraphWriter<Digraph> tmp(digraph, os);
    1.16 +    return tmp;
    1.17 +  }
    1.18  
    1.19 +  /// \brief Return a \ref DigraphWriter class
    1.20 +  ///
    1.21 +  /// This function just returns a \ref DigraphWriter class.
    1.22 +  /// \relates DigraphWriter
    1.23    template <typename Digraph>
    1.24    DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
    1.25 -                                       const std::string& fn);
    1.26 +                                       const std::string& fn) {
    1.27 +    DigraphWriter<Digraph> tmp(digraph, fn);
    1.28 +    return tmp;
    1.29 +  }
    1.30  
    1.31 +  /// \brief Return a \ref DigraphWriter class
    1.32 +  ///
    1.33 +  /// This function just returns a \ref DigraphWriter class.
    1.34 +  /// \relates DigraphWriter
    1.35    template <typename Digraph>
    1.36    DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
    1.37 -                                       const char *fn);
    1.38 +                                       const char* fn) {
    1.39 +    DigraphWriter<Digraph> tmp(digraph, fn);
    1.40 +    return tmp;
    1.41 +  }
    1.42  
    1.43    /// \ingroup lemon_io
    1.44    ///
    1.45 @@ -913,52 +934,40 @@
    1.46      /// @}
    1.47    };
    1.48  
    1.49 -  /// \brief Return a \ref DigraphWriter class
    1.50 +  template <typename Graph>
    1.51 +  class GraphWriter;
    1.52 +
    1.53 +  /// \brief Return a \ref GraphWriter class
    1.54    ///
    1.55 -  /// This function just returns a \ref DigraphWriter class.
    1.56 -  /// \relates DigraphWriter
    1.57 -  template <typename Digraph>
    1.58 -  DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
    1.59 -                                       std::ostream& os = std::cout) {
    1.60 -    DigraphWriter<Digraph> tmp(digraph, os);
    1.61 +  /// This function just returns a \ref GraphWriter class.
    1.62 +  /// \relates GraphWriter
    1.63 +  template <typename Graph>
    1.64 +  GraphWriter<Graph> graphWriter(const Graph& graph,
    1.65 +                                 std::ostream& os = std::cout) {
    1.66 +    GraphWriter<Graph> tmp(graph, os);
    1.67      return tmp;
    1.68    }
    1.69  
    1.70 -  /// \brief Return a \ref DigraphWriter class
    1.71 +  /// \brief Return a \ref GraphWriter class
    1.72    ///
    1.73 -  /// This function just returns a \ref DigraphWriter class.
    1.74 -  /// \relates DigraphWriter
    1.75 -  template <typename Digraph>
    1.76 -  DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
    1.77 -                                       const std::string& fn) {
    1.78 -    DigraphWriter<Digraph> tmp(digraph, fn);
    1.79 +  /// This function just returns a \ref GraphWriter class.
    1.80 +  /// \relates GraphWriter
    1.81 +  template <typename Graph>
    1.82 +  GraphWriter<Graph> graphWriter(const Graph& graph, const std::string& fn) {
    1.83 +    GraphWriter<Graph> tmp(graph, fn);
    1.84      return tmp;
    1.85    }
    1.86  
    1.87 -  /// \brief Return a \ref DigraphWriter class
    1.88 +  /// \brief Return a \ref GraphWriter class
    1.89    ///
    1.90 -  /// This function just returns a \ref DigraphWriter class.
    1.91 -  /// \relates DigraphWriter
    1.92 -  template <typename Digraph>
    1.93 -  DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
    1.94 -                                       const char* fn) {
    1.95 -    DigraphWriter<Digraph> tmp(digraph, fn);
    1.96 +  /// This function just returns a \ref GraphWriter class.
    1.97 +  /// \relates GraphWriter
    1.98 +  template <typename Graph>
    1.99 +  GraphWriter<Graph> graphWriter(const Graph& graph, const char* fn) {
   1.100 +    GraphWriter<Graph> tmp(graph, fn);
   1.101      return tmp;
   1.102    }
   1.103  
   1.104 -  template <typename Graph>
   1.105 -  class GraphWriter;
   1.106 -
   1.107 -  template <typename Graph>
   1.108 -  GraphWriter<Graph> graphWriter(const Graph& graph,
   1.109 -                                 std::ostream& os = std::cout);
   1.110 -
   1.111 -  template <typename Graph>
   1.112 -  GraphWriter<Graph> graphWriter(const Graph& graph, const std::string& fn);
   1.113 -
   1.114 -  template <typename Graph>
   1.115 -  GraphWriter<Graph> graphWriter(const Graph& graph, const char *fn);
   1.116 -
   1.117    /// \ingroup lemon_io
   1.118    ///
   1.119    /// \brief \ref lgf-format "LGF" writer for directed graphs
   1.120 @@ -1526,37 +1535,6 @@
   1.121      /// @}
   1.122    };
   1.123  
   1.124 -  /// \brief Return a \ref GraphWriter class
   1.125 -  ///
   1.126 -  /// This function just returns a \ref GraphWriter class.
   1.127 -  /// \relates GraphWriter
   1.128 -  template <typename Graph>
   1.129 -  GraphWriter<Graph> graphWriter(const Graph& graph,
   1.130 -                                 std::ostream& os = std::cout) {
   1.131 -    GraphWriter<Graph> tmp(graph, os);
   1.132 -    return tmp;
   1.133 -  }
   1.134 -
   1.135 -  /// \brief Return a \ref GraphWriter class
   1.136 -  ///
   1.137 -  /// This function just returns a \ref GraphWriter class.
   1.138 -  /// \relates GraphWriter
   1.139 -  template <typename Graph>
   1.140 -  GraphWriter<Graph> graphWriter(const Graph& graph, const std::string& fn) {
   1.141 -    GraphWriter<Graph> tmp(graph, fn);
   1.142 -    return tmp;
   1.143 -  }
   1.144 -
   1.145 -  /// \brief Return a \ref GraphWriter class
   1.146 -  ///
   1.147 -  /// This function just returns a \ref GraphWriter class.
   1.148 -  /// \relates GraphWriter
   1.149 -  template <typename Graph>
   1.150 -  GraphWriter<Graph> graphWriter(const Graph& graph, const char* fn) {
   1.151 -    GraphWriter<Graph> tmp(graph, fn);
   1.152 -    return tmp;
   1.153 -  }
   1.154 -
   1.155    class SectionWriter;
   1.156  
   1.157    SectionWriter sectionWriter(std::istream& is);