diff --git a/lemon/lgf_reader.h b/lemon/lgf_reader.h --- a/lemon/lgf_reader.h +++ b/lemon/lgf_reader.h @@ -390,37 +390,13 @@ template class DigraphReader; - /// \brief Return a \ref DigraphReader class - /// - /// This function just returns a \ref DigraphReader class. - /// \relates DigraphReader template - DigraphReader digraphReader(Digraph& digraph, - std::istream& is = std::cin) { - DigraphReader tmp(digraph, is); - return tmp; - } - - /// \brief Return a \ref DigraphReader class - /// - /// This function just returns a \ref DigraphReader class. - /// \relates DigraphReader + DigraphReader digraphReader(Digraph& digraph, + std::istream& is = std::cin); template - DigraphReader digraphReader(Digraph& digraph, - const std::string& fn) { - DigraphReader tmp(digraph, fn); - return tmp; - } - - /// \brief Return a \ref DigraphReader class - /// - /// This function just returns a \ref DigraphReader class. - /// \relates DigraphReader + DigraphReader digraphReader(Digraph& digraph, const std::string& fn); template - DigraphReader digraphReader(Digraph& digraph, const char* fn) { - DigraphReader tmp(digraph, fn); - return tmp; - } + DigraphReader digraphReader(Digraph& digraph, const char *fn); /// \ingroup lemon_io /// @@ -584,12 +560,13 @@ private: - friend DigraphReader digraphReader<>(Digraph& digraph, - std::istream& is); - friend DigraphReader digraphReader<>(Digraph& digraph, - const std::string& fn); - friend DigraphReader digraphReader<>(Digraph& digraph, - const char *fn); + template + friend DigraphReader digraphReader(DGR& digraph, std::istream& is); + template + friend DigraphReader digraphReader(DGR& digraph, + const std::string& fn); + template + friend DigraphReader digraphReader(DGR& digraph, const char *fn); DigraphReader(DigraphReader& other) : _is(other._is), local_is(other.local_is), _digraph(other._digraph), @@ -1210,38 +1187,47 @@ }; + /// \brief Return a \ref DigraphReader class + /// + /// This function just returns a \ref DigraphReader class. + /// \relates DigraphReader + template + DigraphReader digraphReader(Digraph& digraph, std::istream& is) { + DigraphReader tmp(digraph, is); + return tmp; + } + + /// \brief Return a \ref DigraphReader class + /// + /// This function just returns a \ref DigraphReader class. + /// \relates DigraphReader + template + DigraphReader digraphReader(Digraph& digraph, + const std::string& fn) { + DigraphReader tmp(digraph, fn); + return tmp; + } + + /// \brief Return a \ref DigraphReader class + /// + /// This function just returns a \ref DigraphReader class. + /// \relates DigraphReader + template + DigraphReader digraphReader(Digraph& digraph, const char* fn) { + DigraphReader tmp(digraph, fn); + return tmp; + } + template class GraphReader; - - /// \brief Return a \ref GraphReader class - /// - /// This function just returns a \ref GraphReader class. - /// \relates GraphReader + template - GraphReader graphReader(Graph& graph, std::istream& is = std::cin) { - GraphReader tmp(graph, is); - return tmp; - } - - /// \brief Return a \ref GraphReader class - /// - /// This function just returns a \ref GraphReader class. - /// \relates GraphReader + GraphReader graphReader(Graph& graph, + std::istream& is = std::cin); template - GraphReader graphReader(Graph& graph, const std::string& fn) { - GraphReader tmp(graph, fn); - return tmp; - } - - /// \brief Return a \ref GraphReader class - /// - /// This function just returns a \ref GraphReader class. - /// \relates GraphReader + GraphReader graphReader(Graph& graph, const std::string& fn); template - GraphReader graphReader(Graph& graph, const char* fn) { - GraphReader tmp(graph, fn); - return tmp; - } + GraphReader graphReader(Graph& graph, const char *fn); /// \ingroup lemon_io /// @@ -1368,10 +1354,12 @@ } private: - friend GraphReader graphReader<>(Graph& graph, std::istream& is); - friend GraphReader graphReader<>(Graph& graph, - const std::string& fn); - friend GraphReader graphReader<>(Graph& graph, const char *fn); + template + friend GraphReader graphReader(GR& graph, std::istream& is); + template + friend GraphReader graphReader(GR& graph, const std::string& fn); + template + friend GraphReader graphReader(GR& graph, const char *fn); GraphReader(GraphReader& other) : _is(other._is), local_is(other.local_is), _graph(other._graph), @@ -2040,6 +2028,36 @@ }; + /// \brief Return a \ref GraphReader class + /// + /// This function just returns a \ref GraphReader class. + /// \relates GraphReader + template + GraphReader graphReader(Graph& graph, std::istream& is) { + GraphReader tmp(graph, is); + return tmp; + } + + /// \brief Return a \ref GraphReader class + /// + /// This function just returns a \ref GraphReader class. + /// \relates GraphReader + template + GraphReader graphReader(Graph& graph, const std::string& fn) { + GraphReader tmp(graph, fn); + return tmp; + } + + /// \brief Return a \ref GraphReader class + /// + /// This function just returns a \ref GraphReader class. + /// \relates GraphReader + template + GraphReader graphReader(Graph& graph, const char* fn) { + GraphReader tmp(graph, fn); + return tmp; + } + class SectionReader; SectionReader sectionReader(std::istream& is);