OpenMPCD
|
Wraps a pointer in such a way that incrementing this iterator is equivalent to incrementing the underlying pointer once or more times, depending on the stride specified. More...
#include <StridedPointerIterator.hpp>
Public Member Functions | |
OPENMPCD_CUDA_HOST_AND_DEVICE | StridedPointerIterator () |
The default constructor. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE | StridedPointerIterator (Pointee *const start, const Pointee *const pastEnd_) |
The constructor. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE | StridedPointerIterator (const StridedPointerIterator &rhs) |
The copy constructor. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE bool | isSingular () const |
Returns whether this instance is singular, i.e. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE bool | isPastTheEnd () const |
Returns whether this iterator is past-the-end. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE bool | isDereferenceable () const |
Returns whether this instance can be dereferenced. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE bool | isValid () const |
Returns whether this instance is valid. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE bool | isIncrementable () const |
Returns whether this instance is incrementable. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE Pointee & | operator* () |
Dereferencing operator. More... | |
const OPENMPCD_CUDA_HOST_AND_DEVICE Pointee & | operator* () const |
Dereferencing operator. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE Pointee * | operator-> () |
Member access operator. More... | |
const OPENMPCD_CUDA_HOST_AND_DEVICE Pointee * | operator-> () const |
Member access operator. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE StridedPointerIterator & | operator++ () |
The prefix increment operator. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE StridedPointerIterator | operator++ (int) |
The postfix increment operator. More... | |
const OPENMPCD_CUDA_HOST_AND_DEVICE StridedPointerIterator & | operator+= (const unsigned int n) |
Advances the pointer n times, or until the past-the-end iterator is reached, whichever comes first. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE bool | operator== (const StridedPointerIterator &rhs) const |
Returns whether the address this instance and rhs point to the same memory. More... | |
OPENMPCD_CUDA_HOST_AND_DEVICE bool | operator!= (const StridedPointerIterator &rhs) const |
Returns whether the address this instance and rhs point to different memory. More... | |
Wraps a pointer in such a way that incrementing this iterator is equivalent to incrementing the underlying pointer once or more times, depending on the stride specified.
Pointee | The type the underlying pointer points at. |
stride | The iteration stride, which must not be 0. |
Definition at line 23 of file StridedPointerIterator.hpp.
|
inline |
The default constructor.
The constructed instance is singular.
Definition at line 33 of file StridedPointerIterator.hpp.
|
inline |
The constructor.
[in] | start | The first element to iterate over. |
[in] | pastEnd_ | The first element that is past the end of the array to iterate over. |
Definition at line 43 of file StridedPointerIterator.hpp.
|
inline |
The copy constructor.
[in] | rhs | The right-hand-side instance. |
Definition at line 52 of file StridedPointerIterator.hpp.
|
inline |
Returns whether this instance can be dereferenced.
Definition at line 86 of file StridedPointerIterator.hpp.
|
inline |
Returns whether this instance is incrementable.
Definition at line 110 of file StridedPointerIterator.hpp.
|
inline |
Returns whether this iterator is past-the-end.
InvalidCallException | Throws if isSingular() . |
Definition at line 72 of file StridedPointerIterator.hpp.
|
inline |
Returns whether this instance is singular, i.e.
invalid.
Definition at line 62 of file StridedPointerIterator.hpp.
|
inline |
Returns whether this instance is valid.
Definition at line 101 of file StridedPointerIterator.hpp.
|
inline |
Returns whether the address this instance and rhs point to different memory.
This function does not consider whether both this instance and rhs have the same iteration range.
[in] | rhs | The right-hand-side instance. |
InvalidCallException | Throws if !isValid() . |
Definition at line 272 of file StridedPointerIterator.hpp.
|
inline |
Dereferencing operator.
InvalidCallException | Throws if !isDereferenceable() . |
Definition at line 127 of file StridedPointerIterator.hpp.
|
inline |
Dereferencing operator.
InvalidCallException | Throws if !isDereferenceable() . |
Definition at line 142 of file StridedPointerIterator.hpp.
|
inline |
The prefix increment operator.
InvalidCallException | Throws if !isDereferenceable() . |
Definition at line 187 of file StridedPointerIterator.hpp.
|
inline |
The postfix increment operator.
InvalidCallException | Throws if !isDereferenceable() . |
Definition at line 210 of file StridedPointerIterator.hpp.
|
inline |
Advances the pointer n times, or until the past-the-end iterator is reached, whichever comes first.
[in] | n | The number of times to advance the pointer. |
Definition at line 235 of file StridedPointerIterator.hpp.
|
inline |
Member access operator.
InvalidCallException | Throws if !isDereferenceable() . |
Definition at line 157 of file StridedPointerIterator.hpp.
|
inline |
Member access operator.
InvalidCallException | Throws if !isDereferenceable() . |
Definition at line 172 of file StridedPointerIterator.hpp.
|
inline |
Returns whether the address this instance and rhs point to the same memory.
This function does not consider whether both this instance and rhs have the same iteration range.
[in] | rhs | The right-hand-side instance. |
InvalidCallException | Throws if !isValid() . |
Definition at line 255 of file StridedPointerIterator.hpp.