lemon/lgf_writer.h
changeset 577 5563527bcc8d
parent 517 2b6d5d22bb23
child 584 33c6b6e755cd
child 598 a3402913cffe
equal deleted inserted replaced
28:eea871309b50 29:be8e24d99bf3
   404   /// writes the node section and the first arc section, then the
   404   /// writes the node section and the first arc section, then the
   405   /// second pass skips the node section and writes just the arc
   405   /// second pass skips the node section and writes just the arc
   406   /// section to the stream. The output stream can be retrieved with
   406   /// section to the stream. The output stream can be retrieved with
   407   /// the \c ostream() function, hence the second pass can append its
   407   /// the \c ostream() function, hence the second pass can append its
   408   /// output to the output of the first pass.
   408   /// output to the output of the first pass.
   409   template <typename _Digraph>
   409   template <typename GR>
   410   class DigraphWriter {
   410   class DigraphWriter {
   411   public:
   411   public:
   412 
   412 
   413     typedef _Digraph Digraph;
   413     typedef GR Digraph;
   414     TEMPLATE_DIGRAPH_TYPEDEFS(Digraph);
   414     TEMPLATE_DIGRAPH_TYPEDEFS(Digraph);
   415 
   415 
   416   private:
   416   private:
   417 
   417 
   418 
   418 
   972   /// The arc maps are written into the file as two columns, the
   972   /// The arc maps are written into the file as two columns, the
   973   /// caption of the columns are the name of the map prefixed with \c
   973   /// caption of the columns are the name of the map prefixed with \c
   974   /// '+' and \c '-'. The arcs are written into the \c \@attributes
   974   /// '+' and \c '-'. The arcs are written into the \c \@attributes
   975   /// section as a \c '+' or a \c '-' prefix (depends on the direction
   975   /// section as a \c '+' or a \c '-' prefix (depends on the direction
   976   /// of the arc) and the label of corresponding edge.
   976   /// of the arc) and the label of corresponding edge.
   977   template <typename _Graph>
   977   template <typename GR>
   978   class GraphWriter {
   978   class GraphWriter {
   979   public:
   979   public:
   980 
   980 
   981     typedef _Graph Graph;
   981     typedef GR Graph;
   982     TEMPLATE_GRAPH_TYPEDEFS(Graph);
   982     TEMPLATE_GRAPH_TYPEDEFS(Graph);
   983 
   983 
   984   private:
   984   private:
   985 
   985 
   986 
   986 
  1071       }
  1071       }
  1072     }
  1072     }
  1073 
  1073 
  1074   private:
  1074   private:
  1075 
  1075 
  1076     template <typename GR>
  1076     template <typename Graph>
  1077     friend GraphWriter<GR> graphWriter(const GR& graph,
  1077     friend GraphWriter<Graph> graphWriter(const Graph& graph,
  1078                                        std::ostream& os);
  1078                                           std::ostream& os);
  1079     template <typename GR>
  1079     template <typename Graph>
  1080     friend GraphWriter<GR> graphWriter(const GR& graph,
  1080     friend GraphWriter<Graph> graphWriter(const Graph& graph,
  1081                                        const std::string& fn);
  1081                                           const std::string& fn);
  1082     template <typename GR>
  1082     template <typename Graph>
  1083     friend GraphWriter<GR> graphWriter(const GR& graph,
  1083     friend GraphWriter<Graph> graphWriter(const Graph& graph,
  1084                                        const char *fn);
  1084                                           const char *fn);
  1085     
  1085     
  1086     GraphWriter(GraphWriter& other)
  1086     GraphWriter(GraphWriter& other)
  1087       : _os(other._os), local_os(other.local_os), _graph(other._graph),
  1087       : _os(other._os), local_os(other.local_os), _graph(other._graph),
  1088         _skip_nodes(other._skip_nodes), _skip_edges(other._skip_edges) {
  1088         _skip_nodes(other._skip_nodes), _skip_edges(other._skip_edges) {
  1089 
  1089