src/lemon/graph_reader.h
changeset 1394 f0c48d7fa73d
parent 1359 1581f961cfaa
child 1396 56f9a4ba9149
     1.1 --- a/src/lemon/graph_reader.h	Wed Apr 27 10:42:58 2005 +0000
     1.2 +++ b/src/lemon/graph_reader.h	Wed Apr 27 10:44:58 2005 +0000
     1.3 @@ -200,38 +200,38 @@
     1.4    /// GraphReader<ListGraph> reader(std::cin, graph);
     1.5    /// \endcode
     1.6    ///
     1.7 -  /// The \c addNodeMap() function reads a map from the \c \@nodeset section.
     1.8 +  /// The \c readNodeMap() function reads a map from the \c \@nodeset section.
     1.9    /// If there is a map that you do not want to read from the file and there is
    1.10    /// whitespace in the string represenation of the values then you should
    1.11    /// call the \c skipNodeMap() template member function with proper 
    1.12    /// parameters.
    1.13    ///
    1.14    /// \code
    1.15 -  /// reader.addNodeMap("x-coord", xCoordMap);
    1.16 -  /// reader.addNodeMap("y-coord", yCoordMap);
    1.17 +  /// reader.readNodeMap("x-coord", xCoordMap);
    1.18 +  /// reader.readNodeMap("y-coord", yCoordMap);
    1.19    ///
    1.20 -  /// reader.addNodeMap<QuotedStringReader>("label", labelMap);
    1.21 +  /// reader.readNodeMap<QuotedStringReader>("label", labelMap);
    1.22    /// reader.skipNodeMap<QuotedStringReader>("description");
    1.23    ///
    1.24 -  /// reader.addNodeMap("color", colorMap);
    1.25 +  /// reader.readNodeMap("color", colorMap);
    1.26    /// \endcode
    1.27    ///
    1.28 -  /// With the \c addEdgeMap() member function you can give an edge map
    1.29 +  /// With the \c readEdgeMap() member function you can give an edge map
    1.30    /// reading command similar to the NodeMaps. 
    1.31    ///
    1.32    /// \code
    1.33 -  /// reader.addEdgeMap("weight", weightMap);
    1.34 -  /// reader.addEdgeMap("label", labelMap);
    1.35 +  /// reader.readEdgeMap("weight", weightMap);
    1.36 +  /// reader.readEdgeMap("label", labelMap);
    1.37    /// \endcode
    1.38    ///
    1.39 -  /// With \c addNode() and \c addEdge() functions you can read labeled Nodes 
    1.40 +  /// With \c readNode() and \c readEdge() functions you can read labeled Nodes 
    1.41    /// and Edges.
    1.42    ///
    1.43    /// \code
    1.44 -  /// reader.addNode("source", sourceNode);
    1.45 -  /// reader.addNode("target", targetNode);
    1.46 +  /// reader.readNode("source", sourceNode);
    1.47 +  /// reader.readNode("target", targetNode);
    1.48    ///
    1.49 -  /// reader.addEdge("observed", edge);
    1.50 +  /// reader.readEdge("observed", edge);
    1.51    /// \endcode
    1.52    ///
    1.53    /// After you give all read commands you must call the \c run() member
    1.54 @@ -285,8 +285,8 @@
    1.55      ///
    1.56      /// Add a new node map reader command for the reader.
    1.57      template <typename Map>
    1.58 -    GraphReader& addNodeMap(std::string name, Map& map) {
    1.59 -      return addNodeMap<typename ReaderTraits::template 
    1.60 +    GraphReader& readNodeMap(std::string name, Map& map) {
    1.61 +      return readNodeMap<typename ReaderTraits::template 
    1.62  	Reader<typename Map::Value>, Map>(name, map);
    1.63      }
    1.64  
    1.65 @@ -294,7 +294,7 @@
    1.66      ///
    1.67      /// Add a new node map reader command for the reader.
    1.68      template <typename Reader, typename Map>
    1.69 -    GraphReader& addNodeMap(std::string name, Map& map, 
    1.70 +    GraphReader& readNodeMap(std::string name, Map& map, 
    1.71  			     const Reader& reader = Reader()) {
    1.72        if (node_map_readers.find(name) != node_map_readers.end()) {
    1.73  	ErrorMessage msg;
    1.74 @@ -326,8 +326,8 @@
    1.75      ///
    1.76      /// Add a new edge map reader command for the reader.
    1.77      template <typename Map>
    1.78 -    GraphReader& addEdgeMap(std::string name, Map& map) { 
    1.79 -      return addEdgeMap<typename ReaderTraits::template
    1.80 +    GraphReader& readEdgeMap(std::string name, Map& map) { 
    1.81 +      return readEdgeMap<typename ReaderTraits::template
    1.82  	Reader<typename Map::Value>, Map>(name, map);
    1.83      }
    1.84  
    1.85 @@ -336,7 +336,7 @@
    1.86      ///
    1.87      /// Add a new edge map reader command for the reader.
    1.88      template <typename Reader, typename Map>
    1.89 -    GraphReader& addEdgeMap(std::string name, Map& map,
    1.90 +    GraphReader& readEdgeMap(std::string name, Map& map,
    1.91  			     const Reader& reader = Reader()) {
    1.92        if (edge_map_readers.find(name) != edge_map_readers.end()) {
    1.93  	ErrorMessage msg;
    1.94 @@ -367,7 +367,7 @@
    1.95      /// \brief Add a new labeled node reader for the reader.
    1.96      ///
    1.97      /// Add a new labeled node reader for the reader.
    1.98 -    GraphReader& addNode(std::string name, Node& node) {
    1.99 +    GraphReader& readNode(std::string name, Node& node) {
   1.100        if (node_readers.find(name) != node_readers.end()) {
   1.101  	ErrorMessage msg;
   1.102  	msg << "Multiple read rule for node: " << name;
   1.103 @@ -380,7 +380,7 @@
   1.104      /// \brief Add a new labeled edge reader for the reader.
   1.105      ///
   1.106      /// Add a new labeled edge reader for the reader.
   1.107 -    GraphReader& addEdge(std::string name, Edge& edge) {
   1.108 +    GraphReader& readEdge(std::string name, Edge& edge) {
   1.109        if (edge_readers.find(name) != edge_readers.end()) {
   1.110  	ErrorMessage msg;
   1.111  	msg << "Multiple read rule for edge: " << name;
   1.112 @@ -754,10 +754,10 @@
   1.113  		  typename Graph::Node &s, typename Graph::Node &t, 
   1.114  		  CostMap& cost) {
   1.115      GraphReader<Graph> reader(is, g);
   1.116 -    reader.addEdgeMap("capacity", capacity);
   1.117 -    reader.addEdgeMap("cost", cost);
   1.118 -    reader.addNode("source", s);
   1.119 -    reader.addNode("target", t);
   1.120 +    reader.readEdgeMap("capacity", capacity);
   1.121 +    reader.readEdgeMap("cost", cost);
   1.122 +    reader.readNode("source", s);
   1.123 +    reader.readNode("target", t);
   1.124      reader.run();
   1.125    }
   1.126  
   1.127 @@ -773,9 +773,9 @@
   1.128    void readGraph(std::istream& is, Graph &g, CapacityMap& capacity, 
   1.129  		  typename Graph::Node &s, typename Graph::Node &t) {
   1.130      GraphReader<Graph> reader(is, g);
   1.131 -    reader.addEdgeMap("capacity", capacity);
   1.132 -    reader.addNode("source", s);
   1.133 -    reader.addNode("target", t);
   1.134 +    reader.readEdgeMap("capacity", capacity);
   1.135 +    reader.readNode("source", s);
   1.136 +    reader.readNode("target", t);
   1.137      reader.run();
   1.138    }
   1.139  
   1.140 @@ -790,8 +790,8 @@
   1.141    void readGraph(std::istream& is, Graph &g, CapacityMap& capacity, 
   1.142  		  typename Graph::Node &s) {
   1.143      GraphReader<Graph> reader(is, g);
   1.144 -    reader.addEdgeMap("capacity", capacity);
   1.145 -    reader.addNode("source", s);
   1.146 +    reader.readEdgeMap("capacity", capacity);
   1.147 +    reader.readNode("source", s);
   1.148      reader.run();
   1.149    }
   1.150  
   1.151 @@ -804,7 +804,7 @@
   1.152    template<typename Graph, typename CapacityMap>
   1.153    void readGraph(std::istream& is, Graph &g, CapacityMap& capacity) {
   1.154      GraphReader<Graph> reader(is, g);
   1.155 -    reader.addEdgeMap("capacity", capacity);
   1.156 +    reader.readEdgeMap("capacity", capacity);
   1.157      reader.run();
   1.158    }
   1.159