14 #ifndef PX_FOUNDATION_PX_STRIDE_ITERATOR_H
15 #define PX_FOUNDATION_PX_STRIDE_ITERATOR_H
75 struct StripConst<const X>
92 mPtr(ptr), mStride(stride)
94 PX_ASSERT(mStride == 0 ||
sizeof(T) <= mStride);
103 mPtr(strideIterator.ptr()), mStride(strideIterator.stride())
105 PX_ASSERT(mStride == 0 ||
sizeof(T) <= mStride);
145 return *byteAdd(mPtr, i * stride());
154 return this->operator[]((
unsigned int)i);
162 mPtr = byteAdd(mPtr, stride());
172 mPtr = byteAdd(mPtr, stride());
181 mPtr = byteSub(mPtr, stride());
191 mPtr = byteSub(mPtr, stride());
232 mPtr = byteAdd(mPtr, i * stride());
241 mPtr = byteAdd(mPtr, i * stride());
250 mPtr = byteSub(mPtr, i * stride());
259 mPtr = byteSub(mPtr, i * stride());
269 int byteDiff =
static_cast<int>(
reinterpret_cast<const PxU8*
>(mPtr) - reinterpret_cast<const PxU8*>(other.
mPtr));
270 return byteDiff /
static_cast<int>(stride());
279 return mPtr == other.
mPtr;
288 return mPtr != other.
mPtr;
297 return mPtr < other.
mPtr;
306 return mPtr > other.
mPtr;
315 return mPtr <= other.
mPtr;
324 return mPtr >= other.
mPtr;
330 return const_cast<T*
>(
reinterpret_cast<const T*
>(
reinterpret_cast<const PxU8*
>(ptr) + bytes));
335 return const_cast<T*
>(
reinterpret_cast<const T*
>(
reinterpret_cast<const PxU8*
>(ptr) - bytes));
340 int byteDiff =
static_cast<int>(
reinterpret_cast<const PxU8*
>(mPtr) - reinterpret_cast<const PxU8*>(other.
mPtr));
341 return (stride() == other.
stride()) && (abs(byteDiff) % stride() == 0);
381 #endif // PX_FOUNDATION_PX_STRIDE_ITERATOR_H