| 185 | **********************************************************************/ |
| 186 | |
| 187 | ELIST2_LINK *ELIST2_ITERATOR::forward() { |
| 188 | #ifndef NDEBUG |
| 189 | if (!list) |
| 190 | NO_LIST.error ("ELIST2_ITERATOR::forward", ABORT, NULL); |
| 191 | #endif |
| 192 | if (list->empty ()) |
| 193 | return NULL; |
| 194 | |
| 195 | if (current) { //not removed so |
| 196 | //set previous |
| 197 | prev = current; |
| 198 | started_cycling = TRUE; |
| 199 | // In case next is deleted by another iterator, get it from the current. |
| 200 | current = current->next; |
| 201 | } |
| 202 | else { |
| 203 | if (ex_current_was_cycle_pt) |
| 204 | cycle_pt = next; |
| 205 | current = next; |
| 206 | } |
| 207 | next = current->next; |
| 208 | |
| 209 | #ifndef NDEBUG |
| 210 | if (!current) |
| 211 | NULL_DATA.error ("ELIST2_ITERATOR::forward", ABORT, NULL); |
| 212 | if (!next) |
| 213 | NULL_NEXT.error ("ELIST2_ITERATOR::forward", ABORT, |
| 214 | "This is: %p Current is: %p", this, current); |
| 215 | #endif |
| 216 | return current; |
| 217 | } |
| 218 | |
| 219 | /*********************************************************************** |
| 220 | * ELIST2_ITERATOR::backward |
no test coverage detected