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;
std::uint8_t uint8
Definition: Core.h:453
#define JPH_EXPORT
Definition: Core.h:236
#define JPH_NAMESPACE_END
Definition: Core.h:378
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:372
DVec3 operator*(double inV1, DVec3Arg inV2)
Definition: DVec3.inl:451
#define JPH_ASSERT(...)
Definition: IssueReporting.h:33
Definition: StridedPtr.h:14
StridedPtr()=default
Constructors.
T * GetPtr() const
Explicit conversion.
Definition: StridedPtr.h:53
T value_type
Definition: StridedPtr.h:16
StridedPtr(T *inPtr, int inStride=sizeof(T))
Definition: StridedPtr.h:21
StridedPtr(const StridedPtr &inRHS)=default
int GetStride() const
Get stride in bytes.
Definition: StridedPtr.h:56