COIN-OR::LEMON - Graph Library

Changeset 1394:f0c48d7fa73d in lemon-0.x for src/lemon/graph_reader.h


Ignore:
Timestamp:
04/27/05 12:44:58 (16 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1851
Message:

Modifying the interface.
add -> read, write

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/lemon/graph_reader.h

    r1359 r1394  
    201201  /// \endcode
    202202  ///
    203   /// The \c addNodeMap() function reads a map from the \c \@nodeset section.
     203  /// The \c readNodeMap() function reads a map from the \c \@nodeset section.
    204204  /// If there is a map that you do not want to read from the file and there is
    205205  /// whitespace in the string represenation of the values then you should
     
    208208  ///
    209209  /// \code
    210   /// reader.addNodeMap("x-coord", xCoordMap);
    211   /// reader.addNodeMap("y-coord", yCoordMap);
    212   ///
    213   /// reader.addNodeMap<QuotedStringReader>("label", labelMap);
     210  /// reader.readNodeMap("x-coord", xCoordMap);
     211  /// reader.readNodeMap("y-coord", yCoordMap);
     212  ///
     213  /// reader.readNodeMap<QuotedStringReader>("label", labelMap);
    214214  /// reader.skipNodeMap<QuotedStringReader>("description");
    215215  ///
    216   /// reader.addNodeMap("color", colorMap);
     216  /// reader.readNodeMap("color", colorMap);
    217217  /// \endcode
    218218  ///
    219   /// With the \c addEdgeMap() member function you can give an edge map
     219  /// With the \c readEdgeMap() member function you can give an edge map
    220220  /// reading command similar to the NodeMaps.
    221221  ///
    222222  /// \code
    223   /// reader.addEdgeMap("weight", weightMap);
    224   /// reader.addEdgeMap("label", labelMap);
     223  /// reader.readEdgeMap("weight", weightMap);
     224  /// reader.readEdgeMap("label", labelMap);
    225225  /// \endcode
    226226  ///
    227   /// With \c addNode() and \c addEdge() functions you can read labeled Nodes
     227  /// With \c readNode() and \c readEdge() functions you can read labeled Nodes
    228228  /// and Edges.
    229229  ///
    230230  /// \code
    231   /// reader.addNode("source", sourceNode);
    232   /// reader.addNode("target", targetNode);
    233   ///
    234   /// reader.addEdge("observed", edge);
     231  /// reader.readNode("source", sourceNode);
     232  /// reader.readNode("target", targetNode);
     233  ///
     234  /// reader.readEdge("observed", edge);
    235235  /// \endcode
    236236  ///
     
    286286    /// Add a new node map reader command for the reader.
    287287    template <typename Map>
    288     GraphReader& addNodeMap(std::string name, Map& map) {
    289       return addNodeMap<typename ReaderTraits::template
     288    GraphReader& readNodeMap(std::string name, Map& map) {
     289      return readNodeMap<typename ReaderTraits::template
    290290        Reader<typename Map::Value>, Map>(name, map);
    291291    }
     
    295295    /// Add a new node map reader command for the reader.
    296296    template <typename Reader, typename Map>
    297     GraphReader& addNodeMap(std::string name, Map& map,
     297    GraphReader& readNodeMap(std::string name, Map& map,
    298298                             const Reader& reader = Reader()) {
    299299      if (node_map_readers.find(name) != node_map_readers.end()) {
     
    327327    /// Add a new edge map reader command for the reader.
    328328    template <typename Map>
    329     GraphReader& addEdgeMap(std::string name, Map& map) {
    330       return addEdgeMap<typename ReaderTraits::template
     329    GraphReader& readEdgeMap(std::string name, Map& map) {
     330      return readEdgeMap<typename ReaderTraits::template
    331331        Reader<typename Map::Value>, Map>(name, map);
    332332    }
     
    337337    /// Add a new edge map reader command for the reader.
    338338    template <typename Reader, typename Map>
    339     GraphReader& addEdgeMap(std::string name, Map& map,
     339    GraphReader& readEdgeMap(std::string name, Map& map,
    340340                             const Reader& reader = Reader()) {
    341341      if (edge_map_readers.find(name) != edge_map_readers.end()) {
     
    368368    ///
    369369    /// Add a new labeled node reader for the reader.
    370     GraphReader& addNode(std::string name, Node& node) {
     370    GraphReader& readNode(std::string name, Node& node) {
    371371      if (node_readers.find(name) != node_readers.end()) {
    372372        ErrorMessage msg;
     
    381381    ///
    382382    /// Add a new labeled edge reader for the reader.
    383     GraphReader& addEdge(std::string name, Edge& edge) {
     383    GraphReader& readEdge(std::string name, Edge& edge) {
    384384      if (edge_readers.find(name) != edge_readers.end()) {
    385385        ErrorMessage msg;
     
    755755                  CostMap& cost) {
    756756    GraphReader<Graph> reader(is, g);
    757     reader.addEdgeMap("capacity", capacity);
    758     reader.addEdgeMap("cost", cost);
    759     reader.addNode("source", s);
    760     reader.addNode("target", t);
     757    reader.readEdgeMap("capacity", capacity);
     758    reader.readEdgeMap("cost", cost);
     759    reader.readNode("source", s);
     760    reader.readNode("target", t);
    761761    reader.run();
    762762  }
     
    774774                  typename Graph::Node &s, typename Graph::Node &t) {
    775775    GraphReader<Graph> reader(is, g);
    776     reader.addEdgeMap("capacity", capacity);
    777     reader.addNode("source", s);
    778     reader.addNode("target", t);
     776    reader.readEdgeMap("capacity", capacity);
     777    reader.readNode("source", s);
     778    reader.readNode("target", t);
    779779    reader.run();
    780780  }
     
    791791                  typename Graph::Node &s) {
    792792    GraphReader<Graph> reader(is, g);
    793     reader.addEdgeMap("capacity", capacity);
    794     reader.addNode("source", s);
     793    reader.readEdgeMap("capacity", capacity);
     794    reader.readNode("source", s);
    795795    reader.run();
    796796  }
     
    805805  void readGraph(std::istream& is, Graph &g, CapacityMap& capacity) {
    806806    GraphReader<Graph> reader(is, g);
    807     reader.addEdgeMap("capacity", capacity);
     807    reader.readEdgeMap("capacity", capacity);
    808808    reader.run();
    809809  }
Note: See TracChangeset for help on using the changeset viewer.