Changeset 962:1a770e9f80b2 in lemon-0.x for src/lemon/iterable_graph_extender.h
- Timestamp:
- 11/05/04 01:31:49 (18 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1345
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/lemon/iterable_graph_extender.h
r946 r962 9 9 template <typename _Base> 10 10 class IterableGraphExtender : public _Base { 11 public: 11 12 12 13 typedef _Base Parent; 13 14 typedef IterableGraphExtender<_Base> Graph; 14 15 public:16 15 17 16 typedef typename Parent::Node Node; … … 27 26 NodeIt(Invalid i) : Node(i) { } 28 27 29 explicit NodeIt(const Graph& _graph) : Node(),graph(&_graph) {28 explicit NodeIt(const Graph& _graph) : graph(&_graph) { 30 29 _graph.first(*static_cast<Node*>(this)); 31 30 } … … 50 49 EdgeIt(Invalid i) : Edge(i) { } 51 50 52 explicit EdgeIt(const Graph& _graph) : Edge(),graph(&_graph) {51 explicit EdgeIt(const Graph& _graph) : graph(&_graph) { 53 52 _graph.first(*static_cast<Edge*>(this)); 54 53 } … … 74 73 75 74 OutEdgeIt(const Graph& _graph, const Node& node) 76 : Edge(),graph(&_graph) {75 : graph(&_graph) { 77 76 _graph.firstOut(*this, node); 78 77 } … … 98 97 99 98 InEdgeIt(const Graph& _graph, const Node& node) 100 : Edge(),graph(&_graph) {99 : graph(&_graph) { 101 100 _graph.firstIn(*this, node); 102 101 } … … 127 126 }; 128 127 128 template <typename _Base> 129 class IterableUndirGraphExtender : public IterableGraphExtender<_Base> { 130 public: 131 132 typedef IterableGraphExtender<_Base> Parent; 133 typedef IterableUndirGraphExtender<_Base> Graph; 134 135 typedef typename Parent::UndirEdge UndirEdge; 136 137 class UndirEdgeIt : public UndirEdge { 138 const Graph* graph; 139 public: 140 141 UndirEdgeIt() { } 142 143 UndirEdgeIt(Invalid i) : UndirEdge(i) { } 144 145 explicit UndirEdgeIt(const Graph& _graph) : graph(&_graph) { 146 _graph.first(*static_cast<UndirEdge*>(this)); 147 } 148 149 UndirEdgeIt(const Graph& _graph, const UndirEdge& e) : 150 UndirEdge(e), graph(&_graph) { } 151 152 UndirEdgeIt& operator++() { 153 graph->next(*this); 154 return *this; 155 } 156 157 }; 158 159 160 }; 129 161 } 130 162
Note: See TracChangeset
for help on using the changeset viewer.