src/lemon/iterable_graph_extender.h
changeset 1090 9e9195331ea6
parent 1022 567f392d1d2e
child 1158 29961fa390a3
equal deleted inserted replaced
3:131f2a8ff7ec 4:8aceb7229828
   155 	return *this; 
   155 	return *this; 
   156       }
   156       }
   157 
   157 
   158     };
   158     };
   159 
   159 
   160     class UndirIncEdgeIt : public UndirEdge { 
   160     class IncEdgeIt : public UndirEdge { 
   161       const Graph* graph;
   161       const Graph* graph;
   162       bool forward;
   162       bool forward;
   163       friend class IterableUndirGraphExtender;
   163       friend class IterableUndirGraphExtender;
   164       template <typename G>
   164       template <typename G>
   165       friend class UndirGraphExtender;
   165       friend class UndirGraphExtender;
   166     public:
   166     public:
   167 
   167 
   168       UndirIncEdgeIt() { }
   168       IncEdgeIt() { }
   169 
   169 
   170       UndirIncEdgeIt(Invalid i) : UndirEdge(i), forward(false) { }
   170       IncEdgeIt(Invalid i) : UndirEdge(i), forward(false) { }
   171 
   171 
   172       explicit UndirIncEdgeIt(const Graph& _graph, const Node &n)
   172       explicit IncEdgeIt(const Graph& _graph, const Node &n)
   173 	: graph(&_graph)
   173 	: graph(&_graph)
   174       {
   174       {
   175 	_graph._dirFirstOut(*this, n);
   175 	_graph._dirFirstOut(*this, n);
   176       }
   176       }
   177 
   177 
   178       // FIXME: Do we need this type of constructor here?
   178       // FIXME: Do we need this type of constructor here?
   179       // UndirIncEdgeIt(const Graph& _graph, const Edge& e) : 
   179       // IncEdgeIt(const Graph& _graph, const Edge& e) : 
   180       //   UndirEdge(e), graph(&_graph), forward(_graph.forward(e)) { }
   180       //   UndirEdge(e), graph(&_graph), forward(_graph.forward(e)) { }
   181       // or
   181       // or
   182       // UndirIncEdgeIt(const Graph& _graph, const Node& n,
   182       // IncEdgeIt(const Graph& _graph, const Node& n,
   183       //    Const UndirEdge &e) ... ?
   183       //    Const UndirEdge &e) ... ?
   184 
   184 
   185       UndirIncEdgeIt& operator++() {
   185       IncEdgeIt& operator++() {
   186 	graph->_dirNextOut(*this);
   186 	graph->_dirNextOut(*this);
   187 	return *this; 
   187 	return *this; 
   188       }
   188       }
   189     };
   189     };
   190 
   190 
   191     Node source(const UndirIncEdgeIt &e) const {
   191     Node source(const IncEdgeIt &e) const {
   192       return _dirSource(e);
   192       return _dirSource(e);
   193     }
   193     }
   194 
   194 
   195     /// \todo Shouldn't the "source" of an undirected edge be called "aNode"
   195     /// \todo Shouldn't the "source" of an undirected edge be called "aNode"
   196     /// or something???
   196     /// or something???
   197     using Parent::source;
   197     using Parent::source;
   198 
   198 
   199     /// Target of the given Edge.
   199     /// Target of the given Edge.
   200     Node target(const UndirIncEdgeIt &e) const {
   200     Node target(const IncEdgeIt &e) const {
   201       return _dirTarget(e);
   201       return _dirTarget(e);
   202     }
   202     }
   203 
   203 
   204     /// \todo Shouldn't the "target" of an undirected edge be called "bNode"
   204     /// \todo Shouldn't the "target" of an undirected edge be called "bNode"
   205     /// or something???
   205     /// or something???