lemon/graph_reader.h
changeset 2388 c6d537888fe5
parent 2334 c1e936e6a46b
child 2391 14a343be7a5a
equal deleted inserted replaced
16:de4fe8e36d6d 17:7ff67bfae5a4
   182     }
   182     }
   183 
   183 
   184     /// \brief Give a new node map reading command to the reader.
   184     /// \brief Give a new node map reading command to the reader.
   185     ///
   185     ///
   186     /// Give a new node map reading command to the reader.
   186     /// Give a new node map reading command to the reader.
   187     template <typename Reader, typename Map>
   187     template <typename ItemReader, typename Map>
   188     GraphReader& readNodeMap(std::string name, Map& map, 
   188     GraphReader& readNodeMap(std::string name, Map& map, 
   189 			     const Reader& reader = Reader()) {
   189 			     const ItemReader& ir = ItemReader()) {
   190       nodeset_reader.readNodeMap(name, map, reader);
   190       nodeset_reader.readNodeMap(name, map, ir);
   191       return *this;
   191       return *this;
   192     }
   192     }
   193 
   193 
   194     template <typename Reader, typename Map>
   194     template <typename ItemReader, typename Map>
   195     GraphReader& readNodeMap(std::string name, const Map& map, 
   195     GraphReader& readNodeMap(std::string name, const Map& map, 
   196 			     const Reader& reader = Reader()) {
   196 			     const ItemReader& ir = ItemReader()) {
   197       nodeset_reader.readNodeMap(name, map, reader);
   197       nodeset_reader.readNodeMap(name, map, ir);
   198       return *this;
   198       return *this;
   199     }
   199     }
   200 
   200 
   201     /// \brief Give a new node map skipping command to the reader.
   201     /// \brief Give a new node map skipping command to the reader.
   202     ///
   202     ///
   203     /// Give a new node map skipping command to the reader.
   203     /// Give a new node map skipping command to the reader.
   204     template <typename Reader>
   204     template <typename ItemReader>
   205     GraphReader& skipNodeMap(std::string name, 
   205     GraphReader& skipNodeMap(std::string name, 
   206 			     const Reader& reader = Reader()) {
   206 			     const ItemReader& ir = ItemReader()) {
   207       nodeset_reader.skipNodeMap(name, reader);
   207       nodeset_reader.skipNodeMap(name, ir);
   208       return *this;
   208       return *this;
   209     }
   209     }
   210 
   210 
   211     /// \brief Give a new edge map reading command to the reader.
   211     /// \brief Give a new edge map reading command to the reader.
   212     ///
   212     ///
   225 
   225 
   226 
   226 
   227     /// \brief Give a new edge map reading command to the reader.
   227     /// \brief Give a new edge map reading command to the reader.
   228     ///
   228     ///
   229     /// Give a new edge map reading command to the reader.
   229     /// Give a new edge map reading command to the reader.
   230     template <typename Reader, typename Map>
   230     template <typename ItemReader, typename Map>
   231     GraphReader& readEdgeMap(std::string name, Map& map,
   231     GraphReader& readEdgeMap(std::string name, Map& map,
   232 			     const Reader& reader = Reader()) {
   232 			     const ItemReader& ir = ItemReader()) {
   233       edgeset_reader.readEdgeMap(name, map, reader);
   233       edgeset_reader.readEdgeMap(name, map, ir);
   234       return *this;
   234       return *this;
   235     }
   235     }
   236 
   236 
   237     template <typename Reader, typename Map>
   237     template <typename ItemReader, typename Map>
   238     GraphReader& readEdgeMap(std::string name, const Map& map,
   238     GraphReader& readEdgeMap(std::string name, const Map& map,
   239 			     const Reader& reader = Reader()) {
   239 			     const ItemReader& ir = ItemReader()) {
   240       edgeset_reader.readEdgeMap(name, map, reader);
   240       edgeset_reader.readEdgeMap(name, map, ir);
   241       return *this;
   241       return *this;
   242     }
   242     }
   243 
   243 
   244     /// \brief Give a new edge map skipping command to the reader.
   244     /// \brief Give a new edge map skipping command to the reader.
   245     ///
   245     ///
   246     /// Give a new edge map skipping command to the reader.
   246     /// Give a new edge map skipping command to the reader.
   247     template <typename Reader>
   247     template <typename ItemReader>
   248     GraphReader& skipEdgeMap(std::string name, 
   248     GraphReader& skipEdgeMap(std::string name, 
   249 			     const Reader& reader = Reader()) {
   249 			     const ItemReader& ir = ItemReader()) {
   250       edgeset_reader.skipEdgeMap(name, reader);
   250       edgeset_reader.skipEdgeMap(name, ir);
   251       return *this;
   251       return *this;
   252     }
   252     }
   253 
   253 
   254     /// \brief Give a new labeled node reading command to the reader.
   254     /// \brief Give a new labeled node reading command to the reader.
   255     ///
   255     ///
   277     }
   277     }
   278     
   278     
   279     /// \brief Give a new attribute reading command.
   279     /// \brief Give a new attribute reading command.
   280     ///
   280     ///
   281     ///  Give a new attribute reading command.
   281     ///  Give a new attribute reading command.
   282     template <typename Reader, typename Value>
   282     template <typename ItemReader, typename Value>
   283     GraphReader& readAttribute(std::string name, Value& value, 
   283     GraphReader& readAttribute(std::string name, Value& value, 
   284 			       const Reader& reader) {
   284 			       const ItemReader& ir = ItemReader()) {
   285       attribute_reader.readAttribute<Reader>(name, value, reader);
   285       attribute_reader.readAttribute(name, value, ir);
   286       return *this;
   286       return *this;
   287     }
   287     }
   288 
   288 
   289     /// \brief Conversion operator to LemonReader.
   289     /// \brief Conversion operator to LemonReader.
   290     ///
   290     ///
   502     }
   502     }
   503 
   503 
   504     /// \brief Give a new node map reading command to the reader.
   504     /// \brief Give a new node map reading command to the reader.
   505     ///
   505     ///
   506     /// Give a new node map reading command to the reader.
   506     /// Give a new node map reading command to the reader.
   507     template <typename Reader, typename Map>
   507     template <typename ItemReader, typename Map>
   508     UGraphReader& readNodeMap(std::string name, Map& map, 
   508     UGraphReader& readNodeMap(std::string name, Map& map, 
   509 				  const Reader& reader = Reader()) {
   509                               const ItemReader& ir = ItemReader()) {
   510       nodeset_reader.readNodeMap(name, map, reader);
   510       nodeset_reader.readNodeMap(name, map, ir);
   511       return *this;
   511       return *this;
   512     }
   512     }
   513 
   513 
   514     template <typename Reader, typename Map>
   514     template <typename ItemReader, typename Map>
   515     UGraphReader& readNodeMap(std::string name, const Map& map, 
   515     UGraphReader& readNodeMap(std::string name, const Map& map, 
   516 				  const Reader& reader = Reader()) {
   516                               const ItemReader& ir = ItemReader()) {
   517       nodeset_reader.readNodeMap(name, map, reader);
   517       nodeset_reader.readNodeMap(name, map, ir);
   518       return *this;
   518       return *this;
   519     }
   519     }
   520 
   520 
   521     /// \brief Give a new node map skipping command to the reader.
   521     /// \brief Give a new node map skipping command to the reader.
   522     ///
   522     ///
   523     /// Give a new node map skipping command to the reader.
   523     /// Give a new node map skipping command to the reader.
   524     template <typename Reader>
   524     template <typename ItemReader>
   525     UGraphReader& skipNodeMap(std::string name, 
   525     UGraphReader& skipNodeMap(std::string name, 
   526 			     const Reader& reader = Reader()) {
   526                               const ItemReader& ir = ItemReader()) {
   527       nodeset_reader.skipNodeMap(name, reader);
   527       nodeset_reader.skipNodeMap(name, ir);
   528       return *this;
   528       return *this;
   529     }
   529     }
   530 
   530 
   531     /// \brief Give a new undirected edge map reading command to the reader.
   531     /// \brief Give a new undirected edge map reading command to the reader.
   532     ///
   532     ///
   545 
   545 
   546 
   546 
   547     /// \brief Give a new undirected edge map reading command to the reader.
   547     /// \brief Give a new undirected edge map reading command to the reader.
   548     ///
   548     ///
   549     /// Give a new undirected edge map reading command to the reader.
   549     /// Give a new undirected edge map reading command to the reader.
   550     template <typename Reader, typename Map>
   550     template <typename ItemReader, typename Map>
   551     UGraphReader& readUEdgeMap(std::string name, Map& map,
   551     UGraphReader& readUEdgeMap(std::string name, Map& map,
   552 				       const Reader& reader = Reader()) {
   552                                const ItemReader& ir = ItemReader()) {
   553       u_edgeset_reader.readUEdgeMap(name, map, reader);
   553       u_edgeset_reader.readUEdgeMap(name, map, ir);
   554       return *this;
   554       return *this;
   555     }
   555     }
   556 
   556 
   557     template <typename Reader, typename Map>
   557     template <typename ItemReader, typename Map>
   558     UGraphReader& readUEdgeMap(std::string name, const Map& map,
   558     UGraphReader& readUEdgeMap(std::string name, const Map& map,
   559 				       const Reader& reader = Reader()) {
   559                                const ItemReader& ir = ItemReader()) {
   560       u_edgeset_reader.readUEdgeMap(name, map, reader);
   560       u_edgeset_reader.readUEdgeMap(name, map, ir);
   561       return *this;
   561       return *this;
   562     }
   562     }
   563 
   563 
   564     /// \brief Give a new undirected edge map skipping command to the reader.
   564     /// \brief Give a new undirected edge map skipping command to the reader.
   565     ///
   565     ///
   566     /// Give a new undirected edge map skipping command to the reader.
   566     /// Give a new undirected edge map skipping command to the reader.
   567     template <typename Reader>
   567     template <typename ItemReader>
   568     UGraphReader& skipUEdgeMap(std::string name,
   568     UGraphReader& skipUEdgeMap(std::string name,
   569 				       const Reader& reader = Reader()) {
   569 				       const ItemReader& ir = ItemReader()) {
   570       u_edgeset_reader.skipUMap(name, reader);
   570       u_edgeset_reader.skipUMap(name, ir);
   571       return *this;
   571       return *this;
   572     }
   572     }
   573 
   573 
   574 
   574 
   575     /// \brief Give a new edge map reading command to the reader.
   575     /// \brief Give a new edge map reading command to the reader.
   589 
   589 
   590 
   590 
   591     /// \brief Give a new edge map reading command to the reader.
   591     /// \brief Give a new edge map reading command to the reader.
   592     ///
   592     ///
   593     /// Give a new edge map reading command to the reader.
   593     /// Give a new edge map reading command to the reader.
   594     template <typename Reader, typename Map>
   594     template <typename ItemReader, typename Map>
   595     UGraphReader& readEdgeMap(std::string name, Map& map,
   595     UGraphReader& readEdgeMap(std::string name, Map& map,
   596 				       const Reader& reader = Reader()) {
   596                               const ItemReader& ir = ItemReader()) {
   597       u_edgeset_reader.readEdgeMap(name, map, reader);
   597       u_edgeset_reader.readEdgeMap(name, map, ir);
   598       return *this;
   598       return *this;
   599     }
   599     }
   600 
   600 
   601     template <typename Reader, typename Map>
   601     template <typename ItemReader, typename Map>
   602     UGraphReader& readEdgeMap(std::string name, const Map& map,
   602     UGraphReader& readEdgeMap(std::string name, const Map& map,
   603 				       const Reader& reader = Reader()) {
   603                               const ItemReader& ir = ItemReader()) {
   604       u_edgeset_reader.readEdgeMap(name, map, reader);
   604       u_edgeset_reader.readEdgeMap(name, map, ir);
   605       return *this;
   605       return *this;
   606     }
   606     }
   607 
   607 
   608     /// \brief Give a new edge map skipping command to the reader.
   608     /// \brief Give a new edge map skipping command to the reader.
   609     ///
   609     ///
   610     /// Give a new edge map skipping command to the reader.
   610     /// Give a new edge map skipping command to the reader.
   611     template <typename Reader>
   611     template <typename ItemReader>
   612     UGraphReader& skipEdgeMap(std::string name,
   612     UGraphReader& skipEdgeMap(std::string name,
   613 				       const Reader& reader = Reader()) {
   613                               const ItemReader& ir = ItemReader()) {
   614       u_edgeset_reader.skipEdgeMap(name, reader);
   614       u_edgeset_reader.skipEdgeMap(name, ir);
   615       return *this;
   615       return *this;
   616     }
   616     }
   617 
   617 
   618     /// \brief Give a new labeled node reading command to the reader.
   618     /// \brief Give a new labeled node reading command to the reader.
   619     ///
   619     ///
   648     }
   648     }
   649     
   649     
   650     /// \brief Give a new attribute reading command.
   650     /// \brief Give a new attribute reading command.
   651     ///
   651     ///
   652     ///  Give a new attribute reading command.
   652     ///  Give a new attribute reading command.
   653     template <typename Reader, typename Value>
   653     template <typename ItemReader, typename Value>
   654     UGraphReader& readAttribute(std::string name, Value& value, 
   654     UGraphReader& readAttribute(std::string name, Value& value, 
   655 			       const Reader& reader) {
   655 			       const ItemReader& ir = ItemReader()) {
   656       attribute_reader.readAttribute<Reader>(name, value, reader);
   656       attribute_reader.readAttribute(name, value, ir);
   657       return *this;
   657       return *this;
   658     }
   658     }
   659 
   659 
   660     /// \brief Conversion operator to LemonReader.
   660     /// \brief Conversion operator to LemonReader.
   661     ///
   661     ///