COIN-OR::LEMON - Graph Library

Changeset 1901:723b2b81d900 in lemon-0.x for lemon/graph_reader.h


Ignore:
Timestamp:
01/24/06 17:07:38 (14 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2476
Message:

Lemon Graph Format uses label instead of id named map.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/graph_reader.h

    r1875 r1901  
    6868  /// reader.readNodeMap("coords", coords);
    6969  ///
    70   /// reader.readNodeMap<QuotedStringReader>("label", labelMap);
    71   /// reader.skipNodeMap<QuotedStringReader>("description");
     70  /// reader.skipNodeMap("description", desc);
    7271  ///
    7372  /// reader.readNodeMap("color", colorMap);
     
    307306    }
    308307
    309     /// \brief Gives back the node by its id.
    310     ///
    311     /// It reads an id from the stream and gives back which node belongs to
    312     /// it. It is possible only if there was read an "id" named node map.
    313     Node readId(std::istream& is, Node) const {
    314       return nodeset_reader.readId(is, Node());
     308
     309    /// \brief Returns true if the reader can give back the items by its label.
     310    ///
     311    /// \brief Returns true if the reader can give back the items by its label.
     312    bool isLabelReader() const {
     313      return nodeset_reader.isLabelReader() && edgeset_reader.isLabelReader();
     314    }
     315
     316    /// \brief Gives back the node by its label.
     317    ///
     318    /// It reads an label from the stream and gives back which node belongs to
     319    /// it. It is possible only if there was read an "label" named node map.
     320    void readLabel(std::istream& is, Node& node) const {
     321      nodeset_reader.readLabel(is, node);
    315322    }
    316323
    317     /// \brief Gives back the edge by its id.
    318     ///
    319     /// It reads an id from the stream and gives back which edge belongs to
    320     /// it. It is possible only if there was read an "id" named edge map.
    321     Edge readId(std::istream& is, Edge) const {
    322       return edgeset_reader.readId(is, Edge());
     324    /// \brief Gives back the edge by its label.
     325    ///
     326    /// It reads an label from the stream and gives back which edge belongs to
     327    /// it. It is possible only if there was read an "label" named edge map.
     328    void readLabel(std::istream& is, Edge& edge) const {
     329      return edgeset_reader.readLabel(is, edge);
    323330    }
    324331
     
    405412  /// reader.readNodeMap("coords", coords);
    406413  ///
    407   /// reader.readNodeMap<QuotedStringReader>("label", labelMap);
    408   /// reader.skipNodeMap<QuotedStringReader>("description");
     414  /// reader.skipNodeMap("description", desc);
    409415  ///
    410416  /// reader.readNodeMap("color", colorMap);
     
    705711    }
    706712
    707     /// \brief Gives back the node by its id.
    708     ///
    709     /// It reads an id from the stream and gives back which node belongs to
    710     /// it. It is possible only if there was read an "id" named node map.
    711     Node readId(std::istream& is, Node) const {
    712       return nodeset_reader.readId(is, Node());
     713
     714    /// \brief Returns true if the reader can give back the items by its label.
     715    ///
     716    /// \brief Returns true if the reader can give back the items by its label.
     717    bool isLabelReader() const {
     718      return nodeset_reader.isLabelReader() &&
     719        undir_edgeset_reader.isLabelReader();
     720    }
     721
     722    /// \brief Gives back the node by its label.
     723    ///
     724    /// It reads an label from the stream and gives back which node belongs to
     725    /// it. It is possible only if there was read an "label" named node map.
     726    void readLabel(std::istream& is, Node& node) const {
     727      return nodeset_reader.readLabel(is, node);
    713728    }
    714729
    715     /// \brief Gives back the edge by its id.
    716     ///
    717     /// It reads an id from the stream and gives back which edge belongs to
    718     /// it. It is possible only if there was read an "id" named edge map.
    719     Edge readId(std::istream& is, Edge) const {
    720       return undir_edgeset_reader.readId(is, Edge());
     730    /// \brief Gives back the edge by its label.
     731    ///
     732    /// It reads an label from the stream and gives back which edge belongs to
     733    /// it. It is possible only if there was read an "label" named edge map.
     734    void readLabel(std::istream& is, Edge& edge) const {
     735      return undir_edgeset_reader.readLabel(is, edge);
    721736    }
    722737
    723     /// \brief Gives back the undirected edge by its id.
    724     ///
    725     /// It reads an id from the stream and gives back which undirected edge
    726     /// belongs to it. It is possible only if there was read an "id" named
     738    /// \brief Gives back the undirected edge by its label.
     739    ///
     740    /// It reads an label from the stream and gives back which undirected edge
     741    /// belongs to it. It is possible only if there was read an "label" named
    727742    /// edge map.
    728     UndirEdge readId(std::istream& is, UndirEdge) const {
    729       return undir_edgeset_reader.readId(is, UndirEdge());
     743    void readLabel(std::istream& is, UndirEdge& uedge) const {
     744      return undir_edgeset_reader.readLabel(is, uedge);
    730745    }
    731746   
Note: See TracChangeset for help on using the changeset viewer.