21 StridedPtr(T *inPtr,
int inStride =
sizeof(T)) : mPtr(const_cast<
uint8 *>(reinterpret_cast<const
uint8 *>(inPtr))), mStride(inStride) { }
27 inline StridedPtr & operator ++ () { mPtr += mStride;
return *
this; }
28 inline StridedPtr & operator -- () { mPtr -= mStride;
return *
this; }
31 inline StridedPtr operator + (
int inOffset)
const {
StridedPtr new_ptr(*
this); new_ptr.mPtr += inOffset * mStride;
return new_ptr; }
32 inline StridedPtr operator - (
int inOffset)
const {
StridedPtr new_ptr(*
this); new_ptr.mPtr -= inOffset * mStride;
return new_ptr; }
33 inline void operator += (
int inOffset) { mPtr += inOffset * mStride; }
34 inline void operator -= (
int inOffset) { mPtr -= inOffset * mStride; }
37 inline int operator - (
const StridedPtr &inRHS)
const {
JPH_ASSERT(inRHS.mStride == mStride);
return (mPtr - inRHS.mPtr) / mStride; }
40 inline bool operator == (
const StridedPtr &inRHS)
const {
return mPtr == inRHS.mPtr; }
41 inline bool operator != (
const StridedPtr &inRHS)
const {
return mPtr != inRHS.mPtr; }
42 inline bool operator <= (
const StridedPtr &inRHS)
const {
return mPtr <= inRHS.mPtr; }
43 inline bool operator >= (
const StridedPtr &inRHS)
const {
return mPtr >= inRHS.mPtr; }
44 inline bool operator < (
const StridedPtr &inRHS)
const {
return mPtr < inRHS.mPtr; }
45 inline bool operator > (
const StridedPtr &inRHS)
const {
return mPtr > inRHS.mPtr; }
48 inline T &
operator * ()
const {
return *
reinterpret_cast<T *
>(mPtr); }
49 inline T * operator -> ()
const {
return reinterpret_cast<T *
>(mPtr); }
50 inline T & operator [] (
int inOffset)
const {
uint8 *ptr = mPtr + inOffset * mStride;
return *
reinterpret_cast<T *
>(ptr); }
53 inline T *
GetPtr()
const {
return reinterpret_cast<T *
>(mPtr); }
59 uint8 * mPtr =
nullptr;