#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) |
Walks along a cArray.
cArray::Iterator::Iterator | ( | const cArray & | a, | |
bool | athead = true | |||
) | [inline] |
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.
cObject* cArray::Iterator::operator++ | ( | int | ) |
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.
cObject* cArray::Iterator::operator-- | ( | int | ) |
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.