Iterator Class Reference¶
|
API
|
Public Member Functions | |
| Iterator (const cQueue &q, bool reverse=false) | |
| void | init (const cQueue &q, bool reverse=false) |
| cObject * | operator* () const |
| bool | end () const |
| Iterator & | operator++ () |
| Iterator | operator++ (int) |
| Iterator & | operator-- () |
| Iterator | operator-- (int) |
Description
Walks along a cQueue.
Constructor & Destructor Documentation
◆ Iterator()
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.
References cQueue::cQueue(), and init().
Referenced by operator++(), operator++(), operator--(), and operator--().
Member Function Documentation
◆ init()
|
inline |
◆ operator*()
|
inline |
Returns the current object.
◆ end()
|
inline |
Returns true if the iterator has reached either end of the queue.
Referenced by operator++(), operator++(), operator--(), and operator--().
◆ operator++() [1/2]
|
inline |
Prefix increment operator (++it). Moves the iterator to the next object in the queue. It has no effect if the iterator has reached either end of the queue.
References end(), and Iterator().
◆ operator++() [2/2]
|
inline |
Postfix increment operator (it++). Moves the iterator to the next object in the queue, and returns the iterator's previous state. It has no effect if the iterator has reached either end of the queue.
References end(), and Iterator().
◆ operator--() [1/2]
|
inline |
Prefix decrement operator (–it). Moves the iterator to the previous object in the queue. It has no effect if the iterator has reached either end of the queue.
References end(), and Iterator().
◆ operator--() [2/2]
|
inline |
Postfix decrement operator (it–). Moves the iterator to the previous object in the queue, and returns the iterator's previous state. It has no effect if the iterator has reached either end of the queue.
References end(), and Iterator().
Generated on for API by