9template<
typename T,
typename OffsetType =
int16>
12 static constexpr OffsetType
NullValue = std::numeric_limits<OffsetType>::max();
14 static_assert(std::is_integral_v<OffsetType>,
"Offset type must be a signed integer");
29 explicit operator bool()
const
36 return Offset ==
NullValue ? nullptr :
reinterpret_cast<T*
>(
static_cast<uint8*
>(
const_cast<void*
>(
BasePtr)) + Offset);
58 TEXT(
"Attempting to create a relative pointer outside the bounds of its capacity."));
59 Offset =
static_cast<OffsetType
>(
OffsetPtr);
61 else if constexpr (std::is_signed_v<OffsetType>)
65 TEXT(
"Attempting to create a relative pointer outside the bounds of its capacity."));
66 Offset = -
static_cast<OffsetType
>(
OffsetPtr);
70 checkf(
false,
TEXT(
"Attempting to assign a negative offset to an unsigned relative pointer!!"));
#define checkf(expr, format,...)
Definition AssertionMacros.h:315
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
const bool
Definition NetworkReplayStreaming.h:178
Definition RelativePtr.h:11
T * Resolve(const void *BasePtr) const
Definition RelativePtr.h:34
U * Resolve(const void *BasePtr) const
Definition RelativePtr.h:40
void Reset(const void *BasePtr, const void *ThisPtr)
Definition RelativePtr.h:50
TRelativePtr()
Definition RelativePtr.h:16
static constexpr OffsetType NullValue
Definition RelativePtr.h:12
void Reset(TYPE_OF_NULLPTR)
Definition RelativePtr.h:45
TRelativePtr(TYPE_OF_NULLPTR)
Definition RelativePtr.h:20
TRelativePtr(const void *BasePtr, const void *ThisPtr)
Definition RelativePtr.h:24