lemon/lgf_reader.h
changeset 559 c5fd2d996909
parent 517 2b6d5d22bb23
child 584 33c6b6e755cd
child 598 a3402913cffe
equal deleted inserted replaced
37:09a1d939e96d 38:34a24b388d5b
   446   /// useNodes() functions. Another application of multipass reading when
   446   /// useNodes() functions. Another application of multipass reading when
   447   /// paths are given as a node map or an arc map.
   447   /// paths are given as a node map or an arc map.
   448   /// It is impossible to read this in
   448   /// It is impossible to read this in
   449   /// a single pass, because the arcs are not constructed when the node
   449   /// a single pass, because the arcs are not constructed when the node
   450   /// maps are read.
   450   /// maps are read.
   451   template <typename _Digraph>
   451   template <typename GR>
   452   class DigraphReader {
   452   class DigraphReader {
   453   public:
   453   public:
   454 
   454 
   455     typedef _Digraph Digraph;
   455     typedef GR Digraph;
       
   456 
       
   457   private:
       
   458 
   456     TEMPLATE_DIGRAPH_TYPEDEFS(Digraph);
   459     TEMPLATE_DIGRAPH_TYPEDEFS(Digraph);
   457 
       
   458   private:
       
   459 
       
   460 
   460 
   461     std::istream* _is;
   461     std::istream* _is;
   462     bool local_is;
   462     bool local_is;
   463     std::string _filename;
   463     std::string _filename;
   464 
   464 
  1244   /// The columns in the \c \@edges (or \c \@arcs) section are the
  1244   /// The columns in the \c \@edges (or \c \@arcs) section are the
  1245   /// edge maps. However, if there are two maps with the same name
  1245   /// edge maps. However, if there are two maps with the same name
  1246   /// prefixed with \c '+' and \c '-', then these can be read into an
  1246   /// prefixed with \c '+' and \c '-', then these can be read into an
  1247   /// arc map.  Similarly, an attribute can be read into an arc, if
  1247   /// arc map.  Similarly, an attribute can be read into an arc, if
  1248   /// it's value is an edge label prefixed with \c '+' or \c '-'.
  1248   /// it's value is an edge label prefixed with \c '+' or \c '-'.
  1249   template <typename _Graph>
  1249   template <typename GR>
  1250   class GraphReader {
  1250   class GraphReader {
  1251   public:
  1251   public:
  1252 
  1252 
  1253     typedef _Graph Graph;
  1253     typedef GR Graph;
       
  1254 
       
  1255   private:
       
  1256 
  1254     TEMPLATE_GRAPH_TYPEDEFS(Graph);
  1257     TEMPLATE_GRAPH_TYPEDEFS(Graph);
  1255 
       
  1256   private:
       
  1257 
  1258 
  1258     std::istream* _is;
  1259     std::istream* _is;
  1259     bool local_is;
  1260     bool local_is;
  1260     std::string _filename;
  1261     std::string _filename;
  1261 
  1262 
  1354       }
  1355       }
  1355 
  1356 
  1356     }
  1357     }
  1357 
  1358 
  1358   private:
  1359   private:
  1359     template <typename GR>
  1360     template <typename Graph>
  1360     friend GraphReader<GR> graphReader(GR& graph, std::istream& is);
  1361     friend GraphReader<Graph> graphReader(Graph& graph, std::istream& is);
  1361     template <typename GR>
  1362     template <typename Graph>
  1362     friend GraphReader<GR> graphReader(GR& graph, const std::string& fn); 
  1363     friend GraphReader<Graph> graphReader(Graph& graph, const std::string& fn); 
  1363     template <typename GR>
  1364     template <typename Graph>
  1364     friend GraphReader<GR> graphReader(GR& graph, const char *fn);
  1365     friend GraphReader<Graph> graphReader(Graph& graph, const char *fn);
  1365 
  1366 
  1366     GraphReader(GraphReader& other)
  1367     GraphReader(GraphReader& other)
  1367       : _is(other._is), local_is(other.local_is), _graph(other._graph),
  1368       : _is(other._is), local_is(other.local_is), _graph(other._graph),
  1368         _use_nodes(other._use_nodes), _use_edges(other._use_edges),
  1369         _use_nodes(other._use_nodes), _use_edges(other._use_edges),
  1369         _skip_nodes(other._skip_nodes), _skip_edges(other._skip_edges) {
  1370         _skip_nodes(other._skip_nodes), _skip_edges(other._skip_edges) {