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