diff -r f42cb3146ed4 -r fd1d073b6557 src/lemon/concept/graph_component.h --- a/src/lemon/concept/graph_component.h Mon Nov 22 17:50:26 2004 +0000 +++ b/src/lemon/concept/graph_component.h Thu Nov 25 14:48:24 2004 +0000 @@ -505,62 +505,66 @@ /// base class, the _selector is a additional template parameter. For /// InEdgeIt you should instantiate it with character 'i' and for /// OutEdgeIt with 'o'. - /// \todo check the name of the concept GraphIncEdgeIterator - template - class GraphIncEdgeIterator : public _Graph::Edge { + /// \todo Is this a good name for this concept? + template + class GraphIncIterator : public Edge { public: /// Default constructor. /// @warning The default constructor sets the iterator /// to an undefined value. - GraphIncEdgeIterator() {} + GraphIncIterator() {} /// Copy constructor. /// Copy constructor. /// - GraphIncEdgeIterator(GraphIncEdgeIterator const&) {} + GraphIncIterator(GraphIncIterator const&) {} /// Sets the iterator to the first edge incoming into or outgoing from the node. /// Sets the iterator to the first edge incoming into or outgoing from the node. /// - explicit GraphIncEdgeIterator(const _Graph&, const typename _Graph::Node&) {} + explicit GraphIncIterator(const Graph&, const typename Graph::Node&) {} /// Invalid constructor \& conversion. /// This constructor initializes the item to be invalid. /// \sa Invalid for more details. - GraphIncEdgeIterator(Invalid) {} + GraphIncIterator(Invalid) {} /// Assign operator for nodes. /// The nodes are assignable. /// - GraphIncEdgeIterator& operator=(GraphIncEdgeIterator const&) { return *this; } + GraphIncIterator& operator=(GraphIncIterator const&) { return *this; } /// Next edge. /// Assign the iterator to the next node. /// - GraphIncEdgeIterator& operator++() { return *this; } + GraphIncIterator& operator++() { return *this; } + // Node operator*() const { return INVALID; } + /// Equality operator /// Two iterators are equal if and only if they point to the /// same object or both are invalid. - bool operator==(const GraphIncEdgeIterator&) const { return true;} + bool operator==(const GraphIncIterator&) const { return true;} + /// Inequality operator /// \sa operator==(Node n) /// - bool operator!=(const GraphIncEdgeIterator&) const { return true;} + bool operator!=(const GraphIncIterator&) const { return true;} - template + template struct Constraints { - typedef typename _Graph::Node Node; - typedef typename _Graph::Edge Edge; + typedef typename Graph::Node Node; void constraints() { - checkConcept, _GraphIncEdgeIterator>(); - _GraphIncEdgeIterator it1(graph, node); + checkConcept, _GraphIncIterator>(); + _GraphIncIterator it1(graph, node); /// \todo Do we need OutEdgeIt(Edge) kind of constructor? - // _GraphIncEdgeIterator it2(edge); - _GraphIncEdgeIterator it2; + // _GraphIncIterator it2(edge); + _GraphIncIterator it2; it2 = ++it1; ++it2 = it1; @@ -571,9 +575,11 @@ Edge& edge; Node& node; - _Graph& graph; + Graph& graph; }; }; + + /// An empty iterable base graph class. /// This class provides beside the core graph features @@ -602,12 +608,12 @@ /// This iterator goes trough the \e inccoming edges of a certain node /// of a graph. - typedef GraphIncEdgeIterator InEdgeIt; + typedef GraphIncIterator InEdgeIt; /// This iterator goes trough the outgoing edges of a node. /// This iterator goes trough the \e outgoing edges of a certain node /// of a graph. - typedef GraphIncEdgeIterator OutEdgeIt; + typedef GraphIncIterator OutEdgeIt; }; template @@ -617,8 +623,8 @@ checkConcept, typename _Graph::EdgeIt >(); checkConcept, typename _Graph::NodeIt >(); - checkConcept, typename _Graph::InEdgeIt >(); - checkConcept, typename _Graph::OutEdgeIt >(); + checkConcept, typename _Graph::InEdgeIt >(); + checkConcept, typename _Graph::OutEdgeIt >(); } };