Fix concepts and constraints
authordeba
Mon, 18 Jul 2005 15:03:55 +0000
changeset 15630853ed07a677
parent 1562 73c3f5d0079c
child 1564 16d316199cf6
Fix concepts and constraints
lemon/concept/graph.h
lemon/concept/graph_component.h
     1.1 --- a/lemon/concept/graph.h	Fri Jul 15 21:17:18 2005 +0000
     1.2 +++ b/lemon/concept/graph.h	Mon Jul 18 15:03:55 2005 +0000
     1.3 @@ -406,6 +406,75 @@
     1.4        ///Gives back the source node of an edge.
     1.5        ///
     1.6        Node source(Edge) const { return INVALID; }
     1.7 +
     1.8 +      /// Gives back the first Node in the iterating order.
     1.9 +      
    1.10 +      /// Gives back the first Node in the iterating order.
    1.11 +      ///     
    1.12 +      void first(Node&) const {}
    1.13 +
    1.14 +      /// Gives back the next Node in the iterating order.
    1.15 +      
    1.16 +      /// Gives back the next Node in the iterating order.
    1.17 +      ///     
    1.18 +      void next(Node&) const {}
    1.19 +
    1.20 +      /// Gives back the first Edge in the iterating order.
    1.21 +      
    1.22 +      /// Gives back the first Edge in the iterating order.
    1.23 +      ///     
    1.24 +      void first(Edge&) const {}
    1.25 +      /// Gives back the next Edge in the iterating order.
    1.26 +      
    1.27 +      /// Gives back the next Edge in the iterating order.
    1.28 +      ///     
    1.29 +      void next(Edge&) const {}
    1.30 +
    1.31 +
    1.32 +      /// Gives back the first of the Edges point to the given Node.
    1.33 +      
    1.34 +      /// Gives back the first of the Edges point to the given Node.
    1.35 +      ///     
    1.36 +      void firstIn(Edge&, const Node&) const {}
    1.37 +
    1.38 +      /// Gives back the next of the Edges points to the given Node.
    1.39 +
    1.40 +
    1.41 +      /// Gives back the next of the Edges points to the given Node.
    1.42 +      ///
    1.43 +      void nextIn(Edge&) const {}
    1.44 +
    1.45 +      /// Gives back the first of the Edges start from the given Node.
    1.46 +      
    1.47 +      /// Gives back the first of the Edges start from the given Node.
    1.48 +      ///     
    1.49 +      void firstOut(Edge&, const Node&) const {}
    1.50 +
    1.51 +      /// Gives back the next of the Edges start from the given Node.
    1.52 +      
    1.53 +      /// Gives back the next of the Edges start from the given Node.
    1.54 +      ///     
    1.55 +      void nextOut(Edge&) const {}
    1.56 +
    1.57 +      /// \brief The base node of the iterator.
    1.58 +      ///
    1.59 +      /// Gives back the base node of the iterator.
    1.60 +      Node baseNode(const InEdgeIt&) const { return INVALID; }
    1.61 +
    1.62 +      /// \brief The running node of the iterator.
    1.63 +      ///
    1.64 +      /// Gives back the running node of the iterator.
    1.65 +      Node runningNode(const InEdgeIt&) const { return INVALID; }
    1.66 +
    1.67 +      /// \brief The base node of the iterator.
    1.68 +      ///
    1.69 +      /// Gives back the base node of the iterator.
    1.70 +      Node baseNode(const OutEdgeIt&) const { return INVALID; }
    1.71 +
    1.72 +      /// \brief The running node of the iterator.
    1.73 +      ///
    1.74 +      /// Gives back the running node of the iterator.
    1.75 +      Node runningNode(const OutEdgeIt&) const { return INVALID; }
    1.76        /// Read write map of the nodes to type \c T.
    1.77  
    1.78        /// \ingroup concept
     2.1 --- a/lemon/concept/graph_component.h	Fri Jul 15 21:17:18 2005 +0000
     2.2 +++ b/lemon/concept/graph_component.h	Mon Jul 18 15:03:55 2005 +0000
     2.3 @@ -677,20 +677,41 @@
     2.4        /// This iterator goes trough the \e outgoing edges of a certain node
     2.5        /// of a graph.
     2.6        typedef GraphIncIterator<Graph, Edge, 'o'> OutEdgeIt;
     2.7 -    };
     2.8 +
     2.9 +      /// \brief The base node of the iterator.
    2.10 +      ///
    2.11 +      /// Gives back the base node of the iterator.
    2.12 +      Node baseNode(const InEdgeIt&) const { return INVALID; }
    2.13 +
    2.14 +      /// \brief The running node of the iterator.
    2.15 +      ///
    2.16 +      /// Gives back the running node of the iterator.
    2.17 +      Node runningNode(const InEdgeIt&) const { return INVALID; }
    2.18 +
    2.19 +      /// \brief The base node of the iterator.
    2.20 +      ///
    2.21 +      /// Gives back the base node of the iterator.
    2.22 +      Node baseNode(const OutEdgeIt&) const { return INVALID; }
    2.23 +
    2.24 +      /// \brief The running node of the iterator.
    2.25 +      ///
    2.26 +      /// Gives back the running node of the iterator.
    2.27 +      Node runningNode(const OutEdgeIt&) const { return INVALID; }
    2.28 +
    2.29      
    2.30 -    template <typename _Graph> 
    2.31 -    struct Constraints {
    2.32 -      void constraints() {
    2.33 -  	checkConcept< BaseGraphComponent, _Graph>();
    2.34 -
    2.35 -	checkConcept<GraphIterator<_Graph, typename _Graph::Edge>,
    2.36 -	  typename _Graph::EdgeIt >();
    2.37 -	checkConcept<GraphIterator<_Graph, typename _Graph::Node>,
    2.38 -	  typename _Graph::NodeIt >();
    2.39 -	checkConcept<GraphIncIterator<_Graph>, typename _Graph::InEdgeIt >();
    2.40 -	checkConcept<GraphIncIterator<_Graph>, typename _Graph::OutEdgeIt >();
    2.41 -      }
    2.42 +      template <typename _Graph> 
    2.43 +      struct Constraints {
    2.44 +	void constraints() {
    2.45 +	  checkConcept< BaseGraphComponent, _Graph>();
    2.46 +	  
    2.47 +	  checkConcept<GraphIterator<_Graph, typename _Graph::Edge>,
    2.48 +	    typename _Graph::EdgeIt >();
    2.49 +	  checkConcept<GraphIterator<_Graph, typename _Graph::Node>,
    2.50 +	    typename _Graph::NodeIt >();
    2.51 +	  checkConcept<GraphIncIterator<_Graph>, typename _Graph::InEdgeIt>();
    2.52 +	  checkConcept<GraphIncIterator<_Graph>, typename _Graph::OutEdgeIt>();
    2.53 +	}
    2.54 +      };
    2.55      };
    2.56  
    2.57      /// An empty alteration notifier base graph class.