src/hugo/path.h
changeset 858 acc83957ee4a
parent 837 2d50d1f045c5
child 900 fc7bc2dacee5
equal deleted inserted replaced
4:4b245f3c8b79 5:7836e7be0bb2
   123     /// \brief Initializes edge iterator to point to the edge of a given index.
   123     /// \brief Initializes edge iterator to point to the edge of a given index.
   124     EdgeIt& nth(EdgeIt &i, int n) const {
   124     EdgeIt& nth(EdgeIt &i, int n) const {
   125       return i=EdgeIt(*this, n);
   125       return i=EdgeIt(*this, n);
   126     }
   126     }
   127 
   127 
   128     /// Checks validity of a node or edge iterator.
       
   129     template<typename It>
       
   130     static
       
   131     bool valid(const It &i) { return i.valid(); }
       
   132 
       
   133     /// Steps the given node or edge iterator.
       
   134     template<typename It>
       
   135     static
       
   136     It& next(It &e) {
       
   137       return ++e;
       
   138     }
       
   139 
       
   140     /// \brief Returns node iterator pointing to the head node of the
   128     /// \brief Returns node iterator pointing to the head node of the
   141     /// given edge iterator.
   129     /// given edge iterator.
   142     NodeIt head(const EdgeIt& e) const {
   130     NodeIt head(const EdgeIt& e) const {
   143       return NodeIt(*this, e.idx+1);
   131       return NodeIt(*this, e.idx+1);
   144     }
   132     }
   158      * \ingroup paths
   146      * \ingroup paths
   159      * This class is used to iterate on the edges of the paths
   147      * This class is used to iterate on the edges of the paths
   160      *
   148      *
   161      * Of course it converts to Graph::Edge
   149      * Of course it converts to Graph::Edge
   162      *
   150      *
   163      * \todo Its interface differs from the standard edge iterator.
       
   164      * Yes, it shouldn't.
       
   165      */
   151      */
   166     class EdgeIt {
   152     class EdgeIt {
   167       friend class DirPath;
   153       friend class DirPath;
   168 
   154 
   169       int idx;
   155       int idx;
   207      * \ingroup paths
   193      * \ingroup paths
   208      * This class is used to iterate on the nodes of the paths
   194      * This class is used to iterate on the nodes of the paths
   209      *
   195      *
   210      * Of course it converts to Graph::Node
   196      * Of course it converts to Graph::Node
   211      *
   197      *
   212      * \todo Its interface differs from the standard node iterator.
       
   213      * Yes, it shouldn't.
       
   214      */
   198      */
   215     class NodeIt {
   199     class NodeIt {
   216       friend class DirPath;
   200       friend class DirPath;
   217 
   201 
   218       int idx;
   202       int idx;