COIN-OR::LEMON - Graph Library

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/lgf_writer.h

    r487 r319  
    351351  class DigraphWriter;
    352352
     353  /// \brief Return a \ref DigraphWriter class
     354  ///
     355  /// This function just returns a \ref DigraphWriter class.
     356  /// \relates DigraphWriter
    353357  template <typename Digraph>
    354358  DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
    355                                        std::ostream& os = std::cout);
     359                                       std::ostream& os = std::cout) {
     360    DigraphWriter<Digraph> tmp(digraph, os);
     361    return tmp;
     362  }
     363
     364  /// \brief Return a \ref DigraphWriter class
     365  ///
     366  /// This function just returns a \ref DigraphWriter class.
     367  /// \relates DigraphWriter
    356368  template <typename Digraph>
    357369  DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
    358                                        const std::string& fn);
    359 
     370                                       const std::string& fn) {
     371    DigraphWriter<Digraph> tmp(digraph, fn);
     372    return tmp;
     373  }
     374
     375  /// \brief Return a \ref DigraphWriter class
     376  ///
     377  /// This function just returns a \ref DigraphWriter class.
     378  /// \relates DigraphWriter
    360379  template <typename Digraph>
    361380  DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
    362                                        const char* fn);
    363 
     381                                       const char* fn) {
     382    DigraphWriter<Digraph> tmp(digraph, fn);
     383    return tmp;
     384  }
    364385
    365386  /// \ingroup lemon_io
     
    506527  private:
    507528
    508     template <typename DGR>
    509     friend DigraphWriter<DGR> digraphWriter(const DGR& digraph,
    510                                             std::ostream& os);
    511     template <typename DGR>
    512     friend DigraphWriter<DGR> digraphWriter(const DGR& digraph,
    513                                             const std::string& fn);
    514     template <typename DGR>
    515     friend DigraphWriter<DGR> digraphWriter(const DGR& digraph,
    516                                             const char *fn);
     529    friend DigraphWriter<Digraph> digraphWriter<>(const Digraph& digraph,
     530                                                  std::ostream& os);
     531    friend DigraphWriter<Digraph> digraphWriter<>(const Digraph& digraph,
     532                                                  const std::string& fn);
     533    friend DigraphWriter<Digraph> digraphWriter<>(const Digraph& digraph,
     534                                                  const char *fn);
    517535
    518536    DigraphWriter(DigraphWriter& other)
     
    916934  };
    917935
    918   /// \brief Return a \ref DigraphWriter class
    919   ///
    920   /// This function just returns a \ref DigraphWriter class.
    921   /// \relates DigraphWriter
    922   template <typename Digraph>
    923   DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
    924                                        std::ostream& os) {
    925     DigraphWriter<Digraph> tmp(digraph, os);
     936  template <typename Graph>
     937  class GraphWriter;
     938
     939  /// \brief Return a \ref GraphWriter class
     940  ///
     941  /// This function just returns a \ref GraphWriter class.
     942  /// \relates GraphWriter
     943  template <typename Graph>
     944  GraphWriter<Graph> graphWriter(const Graph& graph,
     945                                 std::ostream& os = std::cout) {
     946    GraphWriter<Graph> tmp(graph, os);
    926947    return tmp;
    927948  }
    928949
    929   /// \brief Return a \ref DigraphWriter class
    930   ///
    931   /// This function just returns a \ref DigraphWriter class.
    932   /// \relates DigraphWriter
    933   template <typename Digraph>
    934   DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
    935                                        const std::string& fn) {
    936     DigraphWriter<Digraph> tmp(digraph, fn);
     950  /// \brief Return a \ref GraphWriter class
     951  ///
     952  /// This function just returns a \ref GraphWriter class.
     953  /// \relates GraphWriter
     954  template <typename Graph>
     955  GraphWriter<Graph> graphWriter(const Graph& graph, const std::string& fn) {
     956    GraphWriter<Graph> tmp(graph, fn);
    937957    return tmp;
    938958  }
    939959
    940   /// \brief Return a \ref DigraphWriter class
    941   ///
    942   /// This function just returns a \ref DigraphWriter class.
    943   /// \relates DigraphWriter
    944   template <typename Digraph>
    945   DigraphWriter<Digraph> digraphWriter(const Digraph& digraph,
    946                                        const char* fn) {
    947     DigraphWriter<Digraph> tmp(digraph, fn);
     960  /// \brief Return a \ref GraphWriter class
     961  ///
     962  /// This function just returns a \ref GraphWriter class.
     963  /// \relates GraphWriter
     964  template <typename Graph>
     965  GraphWriter<Graph> graphWriter(const Graph& graph, const char* fn) {
     966    GraphWriter<Graph> tmp(graph, fn);
    948967    return tmp;
    949968  }
    950 
    951   template <typename Graph>
    952   class GraphWriter;
    953 
    954   template <typename Graph>
    955   GraphWriter<Graph> graphWriter(const Graph& graph,
    956                                  std::ostream& os = std::cout);
    957   template <typename Graph>
    958   GraphWriter<Graph> graphWriter(const Graph& graph, const std::string& fn);
    959   template <typename Graph>
    960   GraphWriter<Graph> graphWriter(const Graph& graph, const char* fn);
    961969
    962970  /// \ingroup lemon_io
     
    10741082  private:
    10751083
    1076     template <typename GR>
    1077     friend GraphWriter<GR> graphWriter(const GR& graph,
    1078                                        std::ostream& os);
    1079     template <typename GR>
    1080     friend GraphWriter<GR> graphWriter(const GR& graph,
    1081                                        const std::string& fn);
    1082     template <typename GR>
    1083     friend GraphWriter<GR> graphWriter(const GR& graph,
    1084                                        const char *fn);
    1085    
     1084    friend GraphWriter<Graph> graphWriter<>(const Graph& graph,
     1085                                            std::ostream& os);
     1086    friend GraphWriter<Graph> graphWriter<>(const Graph& graph,
     1087                                            const std::string& fn);
     1088    friend GraphWriter<Graph> graphWriter<>(const Graph& graph,
     1089                                            const char *fn);
     1090
    10861091    GraphWriter(GraphWriter& other)
    10871092      : _os(other._os), local_os(other.local_os), _graph(other._graph),
     
    15291534    /// @}
    15301535  };
    1531 
    1532   /// \brief Return a \ref GraphWriter class
    1533   ///
    1534   /// This function just returns a \ref GraphWriter class.
    1535   /// \relates GraphWriter
    1536   template <typename Graph>
    1537   GraphWriter<Graph> graphWriter(const Graph& graph,
    1538                                  std::ostream& os) {
    1539     GraphWriter<Graph> tmp(graph, os);
    1540     return tmp;
    1541   }
    1542 
    1543   /// \brief Return a \ref GraphWriter class
    1544   ///
    1545   /// This function just returns a \ref GraphWriter class.
    1546   /// \relates GraphWriter
    1547   template <typename Graph>
    1548   GraphWriter<Graph> graphWriter(const Graph& graph, const std::string& fn) {
    1549     GraphWriter<Graph> tmp(graph, fn);
    1550     return tmp;
    1551   }
    1552 
    1553   /// \brief Return a \ref GraphWriter class
    1554   ///
    1555   /// This function just returns a \ref GraphWriter class.
    1556   /// \relates GraphWriter
    1557   template <typename Graph>
    1558   GraphWriter<Graph> graphWriter(const Graph& graph, const char* fn) {
    1559     GraphWriter<Graph> tmp(graph, fn);
    1560     return tmp;
    1561   }
    15621536
    15631537  class SectionWriter;
Note: See TracChangeset for help on using the changeset viewer.