#include <cqueue.h>
Public Member Functions | |
Iterator (const cQueue &q, bool reverse=false) | |
void | init (const cQueue &q, bool reverse=false) |
cObject * | operator() () |
bool | end () const |
cObject * | operator++ (int) |
cObject * | operator-- (int) |
Walks along a cQueue.
cQueue::Iterator::Iterator | ( | const cQueue & | q, | |
bool | reverse = false | |||
) | [inline] |
Constructor.
Iterator will walk on the queue passed as argument. The iterator can be initialized for forward (front-to-back, using ++
) or reverse (back-to-front, using --
) iteration.
cObject* cQueue::Iterator::operator++ | ( | int | ) | [inline] |
Returns the current object, then moves the iterator to the next item (towards the back of the queue).
If the iterator has previously reached either end of the queue, nothing happens, and one has to call init() to restart iterating.
cObject* cQueue::Iterator::operator-- | ( | int | ) | [inline] |
Returns the current object, then moves the iterator to the previous item (towards the front of the queue).
If the iterator has previously reached either end of the queue, nothing happens, and one has to call init() to restart iterating.