PSCF v1.1
|
Forward iterator for a PArray. More...
#include <ConstPArrayIterator.h>
Public Member Functions | |
ConstPArrayIterator () | |
Default constructor. More... | |
void | setCurrent (Data **ptr) |
Set the current pointer value. More... | |
void | setEnd (Data **ptr) |
Set the value of the end pointer. More... | |
void | setNull () |
Nullify the iterator. More... | |
bool | isEnd () const |
Is the current pointer at the end of the array. More... | |
bool | notEnd () const |
Is the current pointer not at the end of the array? More... | |
const Data * | get () const |
Return a pointer to const current data. More... | |
Operators | |
const Data & | operator* () const |
Return a const refererence to the current Data. More... | |
const Data * | operator-> () const |
Provide a pointer to the current Data object. More... | |
ConstPArrayIterator< Data > & | operator++ () |
Increment the current pointer. More... | |
Forward iterator for a PArray.
A ConstPArrayIterator is an abstraction of a pointer, similar to an STL forward iterator. The * operator returns a reference to an associated Data object, the -> operator returns a pointer to that object. The ++ operator increments the current pointer by one array element.
Unlike an STL forward iterator, a ConstPArrayIterator has the address of the end of the array. The isEnd() method can be used to test for termination of a for or while loop. When isEnd() is true, the iterator has no current value, and cannot be incremented further. The isEnd() method returns true either if the iterator: i) has already been incremented one past the end of an associated PArray, or ii) is in a null state that is produced by the constructor and the clear() method.
Definition at line 34 of file ConstPArrayIterator.h.
|
inline |
Default constructor.
Constructs a null iterator.
Definition at line 44 of file ConstPArrayIterator.h.
|
inline |
Set the current pointer value.
ptr | Pointer to current element of array of Data* pointers |
Definition at line 55 of file ConstPArrayIterator.h.
Referenced by Util::FPArray< Data, Capacity >::begin(), Util::PArray< Data >::begin(), and Util::SSet< Data, Capacity >::begin().
|
inline |
Set the value of the end pointer.
ptr | Pointer to one element past end of array of Data* pointers |
Definition at line 66 of file ConstPArrayIterator.h.
Referenced by Util::FPArray< Data, Capacity >::begin(), Util::PArray< Data >::begin(), and Util::SSet< Data, Capacity >::begin().
|
inline |
Nullify the iterator.
Definition at line 72 of file ConstPArrayIterator.h.
Referenced by Util::PArray< Data >::begin().
|
inline |
Is the current pointer at the end of the array.
Definition at line 84 of file ConstPArrayIterator.h.
|
inline |
Is the current pointer not at the end of the array?
Definition at line 92 of file ConstPArrayIterator.h.
|
inline |
Return a pointer to const current data.
Definition at line 100 of file ConstPArrayIterator.h.
|
inline |
Return a const refererence to the current Data.
Definition at line 111 of file ConstPArrayIterator.h.
|
inline |
Provide a pointer to the current Data object.
Definition at line 119 of file ConstPArrayIterator.h.
|
inline |
Increment the current pointer.
Definition at line 127 of file ConstPArrayIterator.h.