lemon/bits/graph_extender.h
changeset 509 a76f55d7d397
parent 263 be8a861d3bb7
child 361 f58410582b9b
equal deleted inserted replaced
7:0d355d265e30 8:0072e3ddf93c
    25 #include <lemon/bits/default_map.h>
    25 #include <lemon/bits/default_map.h>
    26 
    26 
    27 #include <lemon/concept_check.h>
    27 #include <lemon/concept_check.h>
    28 #include <lemon/concepts/maps.h>
    28 #include <lemon/concepts/maps.h>
    29 
    29 
    30 ///\ingroup graphbits
    30 //\ingroup graphbits
    31 ///\file
    31 //\file
    32 ///\brief Extenders for the digraph types
    32 //\brief Extenders for the digraph types
    33 namespace lemon {
    33 namespace lemon {
    34 
    34 
    35   /// \ingroup graphbits
    35   // \ingroup graphbits
    36   ///
    36   //
    37   /// \brief Extender for the Digraphs
    37   // \brief Extender for the Digraphs
    38   template <typename Base>
    38   template <typename Base>
    39   class DigraphExtender : public Base {
    39   class DigraphExtender : public Base {
    40   public:
    40   public:
    41 
    41 
    42     typedef Base Parent;
    42     typedef Base Parent;
   184         return *this;
   184         return *this;
   185       }
   185       }
   186 
   186 
   187     };
   187     };
   188 
   188 
   189     /// \brief Base node of the iterator
   189     // \brief Base node of the iterator
   190     ///
   190     //
   191     /// Returns the base node (i.e. the source in this case) of the iterator
   191     // Returns the base node (i.e. the source in this case) of the iterator
   192     Node baseNode(const OutArcIt &arc) const {
   192     Node baseNode(const OutArcIt &arc) const {
   193       return Parent::source(arc);
   193       return Parent::source(arc);
   194     }
   194     }
   195     /// \brief Running node of the iterator
   195     // \brief Running node of the iterator
   196     ///
   196     //
   197     /// Returns the running node (i.e. the target in this case) of the
   197     // Returns the running node (i.e. the target in this case) of the
   198     /// iterator
   198     // iterator
   199     Node runningNode(const OutArcIt &arc) const {
   199     Node runningNode(const OutArcIt &arc) const {
   200       return Parent::target(arc);
   200       return Parent::target(arc);
   201     }
   201     }
   202 
   202 
   203     /// \brief Base node of the iterator
   203     // \brief Base node of the iterator
   204     ///
   204     //
   205     /// Returns the base node (i.e. the target in this case) of the iterator
   205     // Returns the base node (i.e. the target in this case) of the iterator
   206     Node baseNode(const InArcIt &arc) const {
   206     Node baseNode(const InArcIt &arc) const {
   207       return Parent::target(arc);
   207       return Parent::target(arc);
   208     }
   208     }
   209     /// \brief Running node of the iterator
   209     // \brief Running node of the iterator
   210     ///
   210     //
   211     /// Returns the running node (i.e. the source in this case) of the
   211     // Returns the running node (i.e. the source in this case) of the
   212     /// iterator
   212     // iterator
   213     Node runningNode(const InArcIt &arc) const {
   213     Node runningNode(const InArcIt &arc) const {
   214       return Parent::source(arc);
   214       return Parent::source(arc);
   215     }
   215     }
   216 
   216 
   217 
   217 
   323       arc_notifier.clear();
   323       arc_notifier.clear();
   324       node_notifier.clear();
   324       node_notifier.clear();
   325     }
   325     }
   326   };
   326   };
   327 
   327 
   328   /// \ingroup _graphbits
   328   // \ingroup _graphbits
   329   ///
   329   //
   330   /// \brief Extender for the Graphs
   330   // \brief Extender for the Graphs
   331   template <typename Base>
   331   template <typename Base>
   332   class GraphExtender : public Base {
   332   class GraphExtender : public Base {
   333   public:
   333   public:
   334 
   334 
   335     typedef Base Parent;
   335     typedef Base Parent;
   553         _graph->nextInc(*this, _direction);
   553         _graph->nextInc(*this, _direction);
   554         return *this;
   554         return *this;
   555       }
   555       }
   556     };
   556     };
   557 
   557 
   558     /// \brief Base node of the iterator
   558     // \brief Base node of the iterator
   559     ///
   559     //
   560     /// Returns the base node (ie. the source in this case) of the iterator
   560     // Returns the base node (ie. the source in this case) of the iterator
   561     Node baseNode(const OutArcIt &arc) const {
   561     Node baseNode(const OutArcIt &arc) const {
   562       return Parent::source(static_cast<const Arc&>(arc));
   562       return Parent::source(static_cast<const Arc&>(arc));
   563     }
   563     }
   564     /// \brief Running node of the iterator
   564     // \brief Running node of the iterator
   565     ///
   565     //
   566     /// Returns the running node (ie. the target in this case) of the
   566     // Returns the running node (ie. the target in this case) of the
   567     /// iterator
   567     // iterator
   568     Node runningNode(const OutArcIt &arc) const {
   568     Node runningNode(const OutArcIt &arc) const {
   569       return Parent::target(static_cast<const Arc&>(arc));
   569       return Parent::target(static_cast<const Arc&>(arc));
   570     }
   570     }
   571 
   571 
   572     /// \brief Base node of the iterator
   572     // \brief Base node of the iterator
   573     ///
   573     //
   574     /// Returns the base node (ie. the target in this case) of the iterator
   574     // Returns the base node (ie. the target in this case) of the iterator
   575     Node baseNode(const InArcIt &arc) const {
   575     Node baseNode(const InArcIt &arc) const {
   576       return Parent::target(static_cast<const Arc&>(arc));
   576       return Parent::target(static_cast<const Arc&>(arc));
   577     }
   577     }
   578     /// \brief Running node of the iterator
   578     // \brief Running node of the iterator
   579     ///
   579     //
   580     /// Returns the running node (ie. the source in this case) of the
   580     // Returns the running node (ie. the source in this case) of the
   581     /// iterator
   581     // iterator
   582     Node runningNode(const InArcIt &arc) const {
   582     Node runningNode(const InArcIt &arc) const {
   583       return Parent::source(static_cast<const Arc&>(arc));
   583       return Parent::source(static_cast<const Arc&>(arc));
   584     }
   584     }
   585 
   585 
   586     /// Base node of the iterator
   586     // Base node of the iterator
   587     ///
   587     //
   588     /// Returns the base node of the iterator
   588     // Returns the base node of the iterator
   589     Node baseNode(const IncEdgeIt &edge) const {
   589     Node baseNode(const IncEdgeIt &edge) const {
   590       return edge._direction ? u(edge) : v(edge);
   590       return edge._direction ? u(edge) : v(edge);
   591     }
   591     }
   592     /// Running node of the iterator
   592     // Running node of the iterator
   593     ///
   593     //
   594     /// Returns the running node of the iterator
   594     // Returns the running node of the iterator
   595     Node runningNode(const IncEdgeIt &edge) const {
   595     Node runningNode(const IncEdgeIt &edge) const {
   596       return edge._direction ? v(edge) : u(edge);
   596       return edge._direction ? v(edge) : u(edge);
   597     }
   597     }
   598 
   598 
   599     // Mappable extension
   599     // Mappable extension