Changeset 654:8fd893331298 in lemon-0.x for src/hugo
- Timestamp:
- 05/21/04 12:18:30 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@854
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/hugo/for_each_macros.h
r644 r654 20 20 /// ... 21 21 /// Graph::NodeIt n; 22 /// FOR_EACH_GLOB(n, g) {22 /// h_for_glob(n, g) { 23 23 /// ... 24 24 /// } 25 25 /// Graph::EdgeIt e; 26 /// FOR_EACH_GLOB(e, g) {26 /// h_for_glob(e, g) { 27 27 /// ... 28 28 /// } 29 29 /// \endcode 30 30 /// Note that the iterated variables \c n and \c e are global ones. 31 #define h_for_glob(e, g) for((g).first((e)); (g).valid((e)); (g).next((e))) 32 33 /// \deprecated 31 34 #define FOR_EACH_GLOB(e, g) for((g).first((e)); (g).valid((e)); (g).next((e))) 32 35 … … 38 41 /// Graph::Node v; 39 42 /// Graph::OutEdgeIt e; 40 /// FOR_EACH_INC_GLOB(e, g, v) {43 /// h_for_inc_glob(e, g, v) { 41 44 /// ... 42 45 /// } … … 45 48 /// ... 46 49 /// BGraph::ClassNodeIt n; 47 /// FOR_EACH_INC_GLOB(BGraph::ClassNodeIt, n, h, h.S_CLASS) {50 /// h_for_inc_glob(BGraph::ClassNodeIt, n, h, h.S_CLASS) { 48 51 /// ... 49 52 /// } 50 53 /// \endcode 51 54 /// Note that iterated variables \c e and \c n are global ones. 55 #define h_for_inc_glob(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e))) 56 57 /// \deprecated 52 58 #define FOR_EACH_INC_GLOB(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e))) 53 59 … … 125 131 /// Graph g; 126 132 /// ... 127 /// FOR_EACH_LOC(Graph::NodeIt, n, g) {133 /// h_for(Graph::NodeIt, n, g) { 128 134 /// ... 129 135 /// } 130 /// FOR_EACH_LOC(Graph::EdgeIt, e, g) {136 /// h_for(Graph::EdgeIt, e, g) { 131 137 /// ... 132 138 /// } 133 139 /// \endcode 134 140 /// Note that the iterated variables \c n and \c e are local ones. 141 #define h_for(Ittype, e, g) for(Ittype e=loopFirst(Ittype(), (g)); (g).valid(e); (g).next(e)) 142 143 /// \deprecated 135 144 #define FOR_EACH_LOC(Ittype, e, g) for(Ittype e=loopFirst(Ittype(), (g)); (g).valid(e); (g).next(e)) 136 145 137 146 /// This macro provides a comfortable interface for iterating with HUGO 138 147 /// iterators. … … 141 150 /// ... 142 151 /// Graph::Node v; 143 /// FOR_EACH_INC_LOC(Graph::OutEdgeIt, e, g, v) {152 /// h_for_inc(Graph::OutEdgeIt, e, g, v) { 144 153 /// ... 145 154 /// } … … 147 156 /// BGraph h; 148 157 /// ... 149 /// FOR_EACH_INC_LOC(BGraph::ClassNodeIt, n, h, h.S_CLASS) {158 /// h_for_inc(BGraph::ClassNodeIt, n, h, h.S_CLASS) { 150 159 /// ... 151 160 /// } 152 161 /// \endcode 153 162 /// Note that the iterated variables \c e and \c n are local ones. 163 #define h_for_inc(Ittype, e, g, v) for(Ittype e=loopFirst(Ittype(), (g), (v)); (g).valid(e); (g).next(e)) 164 165 /// \deprecated 154 166 #define FOR_EACH_INC_LOC(Ittype, e, g, v) for(Ittype e=loopFirst(Ittype(), (g), (v)); (g).valid(e); (g).next(e)) 155 167 … … 159 171 // #define FOR_EACH_OUTEDGE_LOC(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e))) 160 172 161 162 173 } //namespace hugo 163 174
Note: See TracChangeset
for help on using the changeset viewer.