diff --git a/lemon/lgf_writer.h b/lemon/lgf_writer.h --- a/lemon/lgf_writer.h +++ b/lemon/lgf_writer.h @@ -350,38 +350,17 @@ template class DigraphWriter; - /// \brief Return a \ref DigraphWriter class - /// - /// This function just returns a \ref DigraphWriter class. - /// \relates DigraphWriter template DigraphWriter digraphWriter(const Digraph& digraph, - std::ostream& os = std::cout) { - DigraphWriter tmp(digraph, os); - return tmp; - } - - /// \brief Return a \ref DigraphWriter class - /// - /// This function just returns a \ref DigraphWriter class. - /// \relates DigraphWriter + std::ostream& os = std::cout); template DigraphWriter digraphWriter(const Digraph& digraph, - const std::string& fn) { - DigraphWriter tmp(digraph, fn); - return tmp; - } + const std::string& fn); - /// \brief Return a \ref DigraphWriter class - /// - /// This function just returns a \ref DigraphWriter class. - /// \relates DigraphWriter template DigraphWriter digraphWriter(const Digraph& digraph, - const char* fn) { - DigraphWriter tmp(digraph, fn); - return tmp; - } + const char* fn); + /// \ingroup lemon_io /// @@ -526,12 +505,15 @@ private: - friend DigraphWriter digraphWriter<>(const Digraph& digraph, - std::ostream& os); - friend DigraphWriter digraphWriter<>(const Digraph& digraph, - const std::string& fn); - friend DigraphWriter digraphWriter<>(const Digraph& digraph, - const char *fn); + template + friend DigraphWriter digraphWriter(const DGR& digraph, + std::ostream& os); + template + friend DigraphWriter digraphWriter(const DGR& digraph, + const std::string& fn); + template + friend DigraphWriter digraphWriter(const DGR& digraph, + const char *fn); DigraphWriter(DigraphWriter& other) : _os(other._os), local_os(other.local_os), _digraph(other._digraph), @@ -933,39 +915,49 @@ /// @} }; + /// \brief Return a \ref DigraphWriter class + /// + /// This function just returns a \ref DigraphWriter class. + /// \relates DigraphWriter + template + DigraphWriter digraphWriter(const Digraph& digraph, + std::ostream& os) { + DigraphWriter tmp(digraph, os); + return tmp; + } + + /// \brief Return a \ref DigraphWriter class + /// + /// This function just returns a \ref DigraphWriter class. + /// \relates DigraphWriter + template + DigraphWriter digraphWriter(const Digraph& digraph, + const std::string& fn) { + DigraphWriter tmp(digraph, fn); + return tmp; + } + + /// \brief Return a \ref DigraphWriter class + /// + /// This function just returns a \ref DigraphWriter class. + /// \relates DigraphWriter + template + DigraphWriter digraphWriter(const Digraph& digraph, + const char* fn) { + DigraphWriter tmp(digraph, fn); + return tmp; + } + template class GraphWriter; - /// \brief Return a \ref GraphWriter class - /// - /// This function just returns a \ref GraphWriter class. - /// \relates GraphWriter template GraphWriter graphWriter(const Graph& graph, - std::ostream& os = std::cout) { - GraphWriter tmp(graph, os); - return tmp; - } - - /// \brief Return a \ref GraphWriter class - /// - /// This function just returns a \ref GraphWriter class. - /// \relates GraphWriter + std::ostream& os = std::cout); template - GraphWriter graphWriter(const Graph& graph, const std::string& fn) { - GraphWriter tmp(graph, fn); - return tmp; - } - - /// \brief Return a \ref GraphWriter class - /// - /// This function just returns a \ref GraphWriter class. - /// \relates GraphWriter + GraphWriter graphWriter(const Graph& graph, const std::string& fn); template - GraphWriter graphWriter(const Graph& graph, const char* fn) { - GraphWriter tmp(graph, fn); - return tmp; - } + GraphWriter graphWriter(const Graph& graph, const char* fn); /// \ingroup lemon_io /// @@ -1081,13 +1073,16 @@ private: - friend GraphWriter graphWriter<>(const Graph& graph, - std::ostream& os); - friend GraphWriter graphWriter<>(const Graph& graph, - const std::string& fn); - friend GraphWriter graphWriter<>(const Graph& graph, - const char *fn); - + template + friend GraphWriter graphWriter(const GR& graph, + std::ostream& os); + template + friend GraphWriter graphWriter(const GR& graph, + const std::string& fn); + template + friend GraphWriter graphWriter(const GR& graph, + const char *fn); + GraphWriter(GraphWriter& other) : _os(other._os), local_os(other.local_os), _graph(other._graph), _skip_nodes(other._skip_nodes), _skip_edges(other._skip_edges) { @@ -1534,6 +1529,37 @@ /// @} }; + /// \brief Return a \ref GraphWriter class + /// + /// This function just returns a \ref GraphWriter class. + /// \relates GraphWriter + template + GraphWriter graphWriter(const Graph& graph, + std::ostream& os) { + GraphWriter tmp(graph, os); + return tmp; + } + + /// \brief Return a \ref GraphWriter class + /// + /// This function just returns a \ref GraphWriter class. + /// \relates GraphWriter + template + GraphWriter graphWriter(const Graph& graph, const std::string& fn) { + GraphWriter tmp(graph, fn); + return tmp; + } + + /// \brief Return a \ref GraphWriter class + /// + /// This function just returns a \ref GraphWriter class. + /// \relates GraphWriter + template + GraphWriter graphWriter(const Graph& graph, const char* fn) { + GraphWriter tmp(graph, fn); + return tmp; + } + class SectionWriter; SectionWriter sectionWriter(std::istream& is);