lemon/concepts/path.h
changeset 1130 0759d974de81
parent 1092 dceba191c00d
child 1198 2236d00ca778
     1.1 --- a/lemon/concepts/path.h	Thu Apr 02 22:34:03 2015 +0200
     1.2 +++ b/lemon/concepts/path.h	Sun Jan 05 22:24:56 2014 +0100
     1.3 @@ -26,6 +26,7 @@
     1.4  
     1.5  #include <lemon/core.h>
     1.6  #include <lemon/concept_check.h>
     1.7 +#include <lemon/bits/stl_iterators.h>
     1.8  
     1.9  namespace lemon {
    1.10    namespace concepts {
    1.11 @@ -115,6 +116,23 @@
    1.12  
    1.13        };
    1.14  
    1.15 +      /// \brief Gets the collection of the arcs of the path.
    1.16 +      ///
    1.17 +      /// This function can be used for iterating on the
    1.18 +      /// arcs of the path. It returns a wrapped
    1.19 +      /// ArcIt, which looks like an STL container
    1.20 +      /// (by having begin() and end()) which you can use in range-based
    1.21 +      /// for loops, STL algorithms, etc.
    1.22 +      /// For example you can write:
    1.23 +      ///\code
    1.24 +      /// for(auto a: p.arcs())
    1.25 +      ///   doSomething(a);
    1.26 +      ///\endcode
    1.27 +      LemonRangeWrapper1<ArcIt, Path> arcs() const {
    1.28 +        return LemonRangeWrapper1<ArcIt, Path>(*this);
    1.29 +      }
    1.30 +
    1.31 +
    1.32        template <typename _Path>
    1.33        struct Constraints {
    1.34          void constraints() {
    1.35 @@ -264,6 +282,23 @@
    1.36  
    1.37        };
    1.38  
    1.39 +      /// \brief Gets the collection of the arcs of the path.
    1.40 +      ///
    1.41 +      /// This function can be used for iterating on the
    1.42 +      /// arcs of the path. It returns a wrapped
    1.43 +      /// ArcIt, which looks like an STL container
    1.44 +      /// (by having begin() and end()) which you can use in range-based
    1.45 +      /// for loops, STL algorithms, etc.
    1.46 +      /// For example you can write:
    1.47 +      ///\code
    1.48 +      /// for(auto a: p.arcs())
    1.49 +      ///   doSomething(a);
    1.50 +      ///\endcode
    1.51 +      LemonRangeWrapper1<ArcIt, PathDumper> arcs() const {
    1.52 +        return LemonRangeWrapper1<ArcIt, PathDumper>(*this);
    1.53 +      }
    1.54 +
    1.55 +
    1.56        /// \brief LEMON style iterator for enumerating the arcs of a path
    1.57        /// in reverse direction.
    1.58        ///
    1.59 @@ -293,6 +328,24 @@
    1.60  
    1.61        };
    1.62  
    1.63 +      /// \brief Gets the collection of the arcs of the path
    1.64 +      /// in reverse direction.
    1.65 +      ///
    1.66 +      /// This function can be used for iterating on the
    1.67 +      /// arcs of the path in reverse direction. It returns a wrapped
    1.68 +      /// RevArcIt, which looks like an STL container
    1.69 +      /// (by having begin() and end()) which you can use in range-based
    1.70 +      /// for loops, STL algorithms, etc.
    1.71 +      /// For example you can write:
    1.72 +      ///\code
    1.73 +      /// for(auto a: p.revArcs())
    1.74 +      ///   doSomething(a);
    1.75 +      ///\endcode
    1.76 +      LemonRangeWrapper1<RevArcIt, PathDumper> revArcs() const {
    1.77 +        return LemonRangeWrapper1<RevArcIt, PathDumper>(*this);
    1.78 +      }
    1.79 +
    1.80 +
    1.81        template <typename _Path>
    1.82        struct Constraints {
    1.83          void constraints() {