#include <carray.h>
Public Member Functions | |
Iterator (const cArray &a, bool athead=true) | |
void | init (const cArray &a, bool athead=true) |
cObject * | operator() () |
bool | end () const |
cObject * | operator++ (int) |
cObject * | operator-- (int) |
|
Constructor. Iterator will walk on the array passed as argument. The starting object will be the first (if athead==true) or the last (athead==false) object in the array, not counting empty slots. |
|
Returns true if the iterator has reached either end of the array.
|
|
Reinitializes the iterator object.
|
|
Returns the current object, or NULL if the iterator is not at a valid position.
|
|
Returns the current object, then moves the iterator to the next item. Empty slots in the array are skipped. If the iterator has reached either end of the array, nothing happens; you have to call init() again to restart iterating. If elements are added or removed during interation, the behaviour is undefined. |
|
Returns the current object, then moves the iterator to the previous item. Empty slots in the array are skipped. If the iterator has reached either end of the array, nothing happens; you have to call init() again to restart iterating. If elements are added or removed during interation, the behaviour is undefined. |