COIN-OR::LEMON - Graph Library

Changes in / [178:d2bac07f1742:183:0c6556a8e105] in lemon-main


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/lgf_reader.h

    r174 r182  
    20712071  /// \ingroup lemon_io
    20722072  ///
    2073   /// \brief Reader for the content of the \ref lgf-format "LGF" file
     2073  /// \brief Reader for the contents of the \ref lgf-format "LGF" file
    20742074  ///
    20752075  /// This class can be used to read the sections, the map names and
     
    20772077  /// that, which type of graph, which maps and which attributes
    20782078  /// should be read from a file, but in general tools (like glemon)
    2079   /// the content of an LGF file should be guessed somehow. This class
     2079  /// the contents of an LGF file should be guessed somehow. This class
    20802080  /// reads the graph and stores the appropriate information for
    20812081  /// reading the graph.
    20822082  ///
    2083   ///\code LgfContent content("graph.lgf");
    2084   /// content.run();
     2083  ///\code LgfContents contents("graph.lgf");
     2084  /// contents.run();
    20852085  ///
    20862086  /// // does it contain any node section and arc section
    2087   /// if (content.nodeSectionNum() == 0 || content.arcSectionNum()) {
     2087  /// if (contents.nodeSectionNum() == 0 || contents.arcSectionNum()) {
    20882088  ///   std::cerr << "Failure, cannot find graph" << std::endl;
    20892089  ///   return -1;
    20902090  /// }
    20912091  /// std::cout << "The name of the default node section : "
    2092   ///           << content.nodeSection(0) << std::endl;
     2092  ///           << contents.nodeSection(0) << std::endl;
    20932093  /// std::cout << "The number of the arc maps : "
    2094   ///           << content.arcMaps(0).size() << std::endl;
     2094  ///           << contents.arcMaps(0).size() << std::endl;
    20952095  /// std::cout << "The name of second arc map : "
    2096   ///           << content.arcMaps(0)[1] << std::endl;
     2096  ///           << contents.arcMaps(0)[1] << std::endl;
    20972097  ///\endcode
    2098   class LgfContent {   
     2098  class LgfContents {   
    20992099  private:
    21002100
     
    21222122    /// \brief Constructor
    21232123    ///
    2124     /// Construct an \e LGF content reader, which reads from the given
     2124    /// Construct an \e LGF contents reader, which reads from the given
    21252125    /// input stream.
    2126     LgfContent(std::istream& is)
     2126    LgfContents(std::istream& is)
    21272127      : _is(&is), local_is(false) {}
    21282128
    21292129    /// \brief Constructor
    21302130    ///
    2131     /// Construct an \e LGF content reader, which reads from the given
     2131    /// Construct an \e LGF contents reader, which reads from the given
    21322132    /// file.
    2133     LgfContent(const std::string& fn)
     2133    LgfContents(const std::string& fn)
    21342134      : _is(new std::ifstream(fn.c_str())), local_is(true) {}
    21352135
    21362136    /// \brief Constructor
    21372137    ///
    2138     /// Construct an \e LGF content reader, which reads from the given
     2138    /// Construct an \e LGF contents reader, which reads from the given
    21392139    /// file.
    2140     LgfContent(const char* fn)
     2140    LgfContents(const char* fn)
    21412141      : _is(new std::ifstream(fn)), local_is(true) {}
    21422142
     
    21452145    /// The copy constructor transfers all data from the other reader,
    21462146    /// therefore the copied reader will not be usable more.
    2147     LgfContent(LgfContent& other)
     2147    LgfContents(LgfContents& other)
    21482148      : _is(other._is), local_is(other.local_is) {
    21492149     
     
    21642164   
    21652165    /// \brief Destructor
    2166     ~LgfContent() {
     2166    ~LgfContents() {
    21672167      if (local_is) delete _is;
    21682168    }
     
    21892189    ///
    21902190    /// Gives back the node maps for the given section.
    2191     const std::vector<std::string>& nodeMaps(int i) const {
     2191    const std::vector<std::string>& nodeMapNames(int i) const {
    21922192      return _node_maps[i];
    21932193    }
     
    21952195    /// @}
    21962196
    2197     /// \name Arc sections
     2197    /// \name Arc/Edge sections
    21982198    /// @{
    21992199
    2200     /// \brief Gives back the number of arc sections in the file.
    2201     ///
    2202     /// Gives back the number of arc sections in the file.
    2203     /// \note It is synonim of \c edgeSectionNum().
     2200    /// \brief Gives back the number of arc/edge sections in the file.
     2201    ///
     2202    /// Gives back the number of arc/edge sections in the file.
     2203    /// \note It is synonym of \c edgeSectionNum().
    22042204    int arcSectionNum() const {
    22052205      return _edge_sections.size();
     
    22092209    ///
    22102210    /// Returns the section name at the given position.
    2211     /// \note It is synonim of \c edgeSection().
     2211    /// \note It is synonym of \c edgeSection().
    22122212    const std::string& arcSection(int i) const {
    22132213      return _edge_sections[i];
    22142214    }
    22152215
    2216     /// \brief Gives back the arc maps for the given section.
    2217     ///
    2218     /// Gives back the arc maps for the given section.
    2219     /// \note It is synonim of \c edgeMaps().
    2220     const std::vector<std::string>& arcMaps(int i) const {
     2216    /// \brief Gives back the arc/edge maps for the given section.
     2217    ///
     2218    /// Gives back the arc/edge maps for the given section.
     2219    /// \note It is synonym of \c edgeMapNames().
     2220    const std::vector<std::string>& arcMapNames(int i) const {
    22212221      return _edge_maps[i];
    22222222    }
    22232223
    2224     /// \brief Returns true when the section type is \c "@arcs".
    2225     ///
    2226     /// Returns true when the section type is \c "@arcs", and not "@edges".
    2227     bool isArcSection(int i) const {
    2228       return _arc_sections[i];
    2229     }
    2230 
    22312224    /// @}
    22322225
    2233     /// \name Edge sections   
     2226    /// \name Synonyms
    22342227    /// @{
    22352228
    2236     /// \brief Gives back the number of edge sections in the file.
    2237     ///
    2238     /// Gives back the number of edge sections in the file.
     2229    /// \brief Gives back the number of arc/edge sections in the file.
     2230    ///
     2231    /// Gives back the number of arc/edge sections in the file.
     2232    /// \note It is synonym of \c arcSectionNum().
    22392233    int edgeSectionNum() const {
    22402234      return _edge_sections.size();
     
    22442238    ///
    22452239    /// Returns the section name at the given position.
     2240    /// \note It is synonym of \c arcSection().
    22462241    const std::string& edgeSection(int i) const {
    22472242      return _edge_sections[i];
     
    22512246    ///
    22522247    /// Gives back the edge maps for the given section.
    2253     const std::vector<std::string>& edgeMaps(int i) const {
     2248    /// \note It is synonym of \c arcMapNames().
     2249    const std::vector<std::string>& edgeMapNames(int i) const {
    22542250      return _edge_maps[i];
    2255     }
    2256 
    2257     /// \brief Returns true when the section type is \c "@edges".
    2258     ///
    2259     /// Returns true when the section type is \c "@edges", and not "@arcs".
    2260     bool isEdgeSection(int i) const {
    2261       return !_arc_sections[i];
    22622251    }
    22632252
     
    22772266    ///
    22782267    /// Returns the section name at the given position.
    2279     const std::string& attributeSection(int i) const {
     2268    const std::string& attributeSectionNames(int i) const {
    22802269      return _attribute_sections[i];
    22812270    }
     
    23602349  public:
    23612350
    2362     /// \name Execution of the content reader   
     2351    /// \name Execution of the contents reader   
    23632352    /// @{
    23642353
Note: See TracChangeset for help on using the changeset viewer.