Iterator class for iterating over arrays of data that may be interleaved with other data. More...
#include <PxStrideIterator.h>
Public Member Functions | |
PX_INLINE | PxStrideIterator (T *ptr=NULL, PxU32 stride=sizeof(T)) |
Constructor. More... | |
PX_INLINE | PxStrideIterator (const PxStrideIterator< typename StripConst< T >::Type > &strideIterator) |
Copy constructor. More... | |
PX_INLINE T * | ptr () const |
Get pointer to element. More... | |
PX_INLINE PxU32 | stride () const |
Get stride. More... | |
PX_INLINE T & | operator* () const |
Indirection operator. More... | |
PX_INLINE T * | operator-> () const |
Dereferencing operator. More... | |
PX_INLINE T & | operator[] (unsigned int i) const |
Indexing operator. More... | |
PX_DEPRECATED PX_INLINE T & | operator[] (int i) const |
Indexing operator. More... | |
PX_INLINE PxStrideIterator & | operator++ () |
Pre-increment operator. More... | |
PX_INLINE PxStrideIterator | operator++ (int) |
Post-increment operator. More... | |
PX_INLINE PxStrideIterator & | operator-- () |
Pre-decrement operator. More... | |
PX_INLINE PxStrideIterator | operator-- (int) |
Post-decrement operator. More... | |
PX_INLINE PxStrideIterator | operator+ (unsigned int i) const |
Addition operator. More... | |
PX_DEPRECATED PX_INLINE PxStrideIterator | operator+ (int i) const |
Addition operator. More... | |
PX_INLINE PxStrideIterator | operator- (unsigned int i) const |
Subtraction operator. More... | |
PX_DEPRECATED PX_INLINE PxStrideIterator | operator- (int i) const |
Subtraction operator. More... | |
PX_INLINE PxStrideIterator & | operator+= (unsigned int i) |
Addition compound assignment operator. More... | |
PX_DEPRECATED PX_INLINE PxStrideIterator & | operator+= (int i) |
Addition compound assignment operator. More... | |
PX_INLINE PxStrideIterator & | operator-= (unsigned int i) |
Subtraction compound assignment operator. More... | |
PX_DEPRECATED PX_INLINE PxStrideIterator & | operator-= (int i) |
Subtraction compound assignment operator. More... | |
PX_INLINE int | operator- (const PxStrideIterator &other) const |
Iterator difference. More... | |
PX_INLINE bool | operator== (const PxStrideIterator &other) const |
Equality operator. More... | |
PX_INLINE bool | operator!= (const PxStrideIterator &other) const |
Inequality operator. More... | |
PX_INLINE bool | operator< (const PxStrideIterator &other) const |
Less than operator. More... | |
PX_INLINE bool | operator> (const PxStrideIterator &other) const |
Greater than operator. More... | |
PX_INLINE bool | operator<= (const PxStrideIterator &other) const |
Less or equal than operator. More... | |
PX_INLINE bool | operator>= (const PxStrideIterator &other) const |
Greater or equal than operator. More... | |
Private Member Functions | |
PX_INLINE bool | isCompatible (const PxStrideIterator &other) const |
Static Private Member Functions | |
static PX_INLINE T * | byteAdd (T *ptr, PxU32 bytes) |
static PX_INLINE T * | byteSub (T *ptr, PxU32 bytes) |
Private Attributes | |
T * | mPtr |
PxU32 | mStride |
Iterator class for iterating over arrays of data that may be interleaved with other data.
This class is used for iterating over arrays of elements that may have a larger element to element offset, called the stride, than the size of the element itself (non-contiguous).
The template parameter T denotes the type of the element accessed. The stride itself is stored as a member field so multiple instances of a PxStrideIterator class can have different strides. This is useful for cases were the stride depends on runtime configuration.
The stride iterator can be used for index based access, e.g.:
or iteration by increment, e.g.:
Two special cases:
|
inlineexplicit |
Constructor.
Optionally takes a pointer to an element and a stride.
[in] | ptr | pointer to element, defaults to NULL. |
[in] | stride | stride for accessing consecutive elements, defaults to the size of one element. |
|
inline |
Copy constructor.
[in] | strideIterator | PxStrideIterator to be copied. |
|
inlinestaticprivate |
|
inlinestaticprivate |
|
inlineprivate |
|
inline |
Inequality operator.
|
inline |
Indirection operator.
|
inline |
Addition operator.
|
inline |
Addition operator.
|
inline |
Pre-increment operator.
|
inline |
Post-increment operator.
|
inline |
Addition compound assignment operator.
|
inline |
Addition compound assignment operator.
|
inline |
Subtraction operator.
|
inline |
Subtraction operator.
|
inline |
Iterator difference.
|
inline |
Pre-decrement operator.
|
inline |
Post-decrement operator.
|
inline |
Subtraction compound assignment operator.
|
inline |
Subtraction compound assignment operator.
|
inline |
Dereferencing operator.
|
inline |
Less than operator.
|
inline |
Less or equal than operator.
|
inline |
Equality operator.
|
inline |
Greater than operator.
|
inline |
Greater or equal than operator.
|
inline |
Indexing operator.
|
inline |
Indexing operator.
|
inline |
Get pointer to element.
|
inline |
Get stride.
Referenced by PxStrideIterator< const PxFlags >::isCompatible().
|
private |
Referenced by PxStrideIterator< const PxFlags >::isCompatible(), PxStrideIterator< const PxFlags >::operator!=(), PxStrideIterator< const PxFlags >::operator-(), PxStrideIterator< const PxFlags >::operator<(), PxStrideIterator< const PxFlags >::operator<=(), PxStrideIterator< const PxFlags >::operator==(), PxStrideIterator< const PxFlags >::operator>(), and PxStrideIterator< const PxFlags >::operator>=().
|
private |