Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
ObjectPtr.h File Reference
#include "HAL/Platform.h"
#include "Serialization/StructuredArchive.h"
#include <type_traits>
+ Include dependency graph for ObjectPtr.h:

Go to the source code of this file.

Classes

struct  UE::CoreUObject::Private::FObjectHandlePackageDebugData
 
struct  UE::CoreUObject::Private::FObjectHandleDataClassDescriptor
 
struct  FObjectPtr
 
struct  TIsTObjectPtr< T >
 
struct  TObjectPtr< T >
 
struct  TIsTObjectPtr< TObjectPtr< T > >
 
struct  TIsTObjectPtr< const TObjectPtr< T > >
 
struct  TIsTObjectPtr< volatile TObjectPtr< T > >
 
struct  TIsTObjectPtr< const volatile TObjectPtr< T > >
 
struct  TRemoveObjectPointer< T >
 
struct  TRemoveObjectPointer< TObjectPtr< T > >
 
struct  ObjectPtr_Private::TRawPointerType< T >
 
struct  ObjectPtr_Private::TRawPointerType< TObjectPtr< T > >
 
struct  ObjectPtr_Private::TRawPointerType< const TObjectPtr< T > >
 
struct  ObjectPtr_Private::TRawPointerType< volatile TObjectPtr< T > >
 
struct  ObjectPtr_Private::TRawPointerType< const volatile TObjectPtr< T > >
 
struct  ObjectPtr_Private::Friend
 
struct  TPrivateObjectPtr< T >
 
struct  TContainerElementTypeCompatibility< TObjectPtr< T > >
 
struct  TContainerElementTypeCompatibility< const TObjectPtr< T > >
 
struct  TIsZeroConstructType< TObjectPtr< T > >
 
struct  TIsBitwiseConstructible< TObjectPtr< T >, T * >
 
struct  TDereferenceWrapper< TObjectPtr< T >, PREDICATE_CLASS >
 
struct  TCallTraits< TObjectPtr< T > >
 
struct  TIsPointerOrObjectPtrToBaseOfImpl< T, DerivedType >
 
struct  TIsPointerOrObjectPtrToBaseOfImpl< T *, DerivedType >
 
struct  TIsPointerOrObjectPtrToBaseOfImpl< TObjectPtr< T >, DerivedType >
 
struct  TIsPointerOrObjectPtrToBaseOf< T, DerivedType >
 
struct  TPointedToTypeImpl< T * >
 
struct  TPointedToTypeImpl< TObjectPtr< T > >
 

Namespaces

namespace  UE
 
namespace  UE::CoreUObject
 
namespace  UE::CoreUObject::Private
 
namespace  ObjectPtr_Private
 

Macros

#define UE_WITH_OBJECT_PTR_DEPRECATIONS   0
 
#define UE_OBJPTR_DEPRECATED(Version, Message)
 
#define UE_TRANSITIONAL_OBJECT_PTR(Type)   auto
 
#define UE_TRANSITIONAL_OBJECT_PTR_TEMPLATE(Templ, Type)   auto
 
#define UE_TRANSITIONAL_OBJECT_PTR_TEMPLATE_SUFFIXED(Templ, Type, Suffix)   auto
 
#define UE_TRANSITIONAL_OBJECT_PTR_TEMPLATE2_ARG1(Templ, Type1, Type2)   auto
 
#define UE_TRANSITIONAL_OBJECT_PTR_TEMPLATE2_ARG1_SUFFIXED(Templ, Type1, Type2, Suffix)   auto
 
#define UE_TRANSITIONAL_OBJECT_PTR_TEMPLATE2_ARG2(Templ, Type1, Type2)   auto
 
#define UE_TRANSITIONAL_OBJECT_PTR_TEMPLATE2_ARG2_SUFFIXED(Templ, Type1, Type2, Suffix)   auto
 
#define UE_TRANSITIONAL_OBJECT_PTR_TEMPLATE2_ARG_BOTH(Templ, Type1, Type2)   auto
 
#define UE_TRANSITIONAL_OBJECT_PTR_TEMPLATE2_ARG_BOTH_SUFFIXED(Templ, Type1, Type2, Suffix)   auto
 
#define UE_OBJECT_PTR_NONCONFORMANCE_SUPPORT   0
 

Typedefs

using FObjectHandle = UE::CoreUObject::Private::FObjectHandlePrivate
 
template<typename T >
using TPointedToType = typename TPointedToTypeImpl<T>::Type
 

Functions

FObjectHandle UE::CoreUObject::Private::MakeObjectHandle (UObject *Object)
 
UObjectUE::CoreUObject::Private::ResolveObjectHandle (FObjectHandle &Handle)
 
UClassUE::CoreUObject::Private::ResolveObjectHandleClass (FObjectHandle Handle)
 
UObjectUE::CoreUObject::Private::ResolveObjectHandleNoRead (FObjectHandle &Handle)
 
UObjectUE::CoreUObject::Private::ResolveObjectHandleNoReadNoCheck (FObjectHandle &Handle)
 
UObjectUE::CoreUObject::Private::ReadObjectHandlePointerNoCheck (FObjectHandle Handle)
 
template<typename T >
FORCEINLINE const TObjectPtr_Private::CoerceToPointer (const T *Other)
 
template<typename T , typename U , typename CommonPointerType = decltype(std::declval<bool>() ? std::declval<const T*>() : std::declval<U>()), std::enable_if_t< std::is_pointer< CommonPointerType >::value > * = nullptr>
FORCEINLINE auto ObjectPtr_Private::CoerceToPointer (U &&Other) -> CommonPointerType
 
template<typename T , typename U , std::enable_if_t< !TIsTObjectPtr< std::decay_t< U > >::Value, decltype(std::declval< U >().Get()) > * = nullptr>
FORCEINLINE auto ObjectPtr_Private::CoerceToPointer (U &&Other) -> decltype(std::declval< U >().Get())
 
template<typename T , typename U >
bool ObjectPtr_Private::IsObjectPtrEqualToRawPtrOfRelatedType (const TObjectPtr< T > &Ptr, const U *Other)
 
template<typename T , typename U , std::enable_if_t< !TIsTObjectPtr< std::decay_t< U > >::Value, decltype(CoerceToPointer< T >(std::declval< U >())==std::declval< const T * >()) > * = nullptr>
bool ObjectPtr_Private::IsObjectPtrEqual (const TObjectPtr< T > &Ptr, U &&Other)
 
template<typename T , int = sizeof(T)>
char(& ObjectPtr_Private::ResolveTypeIsComplete (int))[2]
 
template<typename T >
char(& ObjectPtr_Private::ResolveTypeIsComplete (...))[1]
 
template<typename T >
FORCEINLINE uint32 GetTypeHash (const TObjectPtr< T > &InObjectPtr)
 
template<typename T >
FORCEINLINE FArchiveoperator<< (FArchive &Ar, TObjectPtr< T > &InObjectPtr)
 
template<typename T >
FORCEINLINE void operator<< (FStructuredArchiveSlot Slot, TObjectPtr< T > &InObjectPtr)
 
template<typename T , typename U , decltype(ObjectPtr_Private::IsObjectPtrEqual(std::declval< const TObjectPtr< T > & >(), std::declval< U && >())) * = nullptr>
FORCEINLINE bool operator== (U &&Other, const TObjectPtr< T > &Ptr)
 
template<typename T , typename U , decltype(ObjectPtr_Private::IsObjectPtrEqual(std::declval< const TObjectPtr< T > & >(), std::declval< U && >())) * = nullptr>
FORCEINLINE bool operator!= (U &&Other, const TObjectPtr< T > &Ptr)
 
template<typename T >
TPrivateObjectPtr< TMakeObjectPtrUnsafe (const UObject *Obj)
 
template<typename T >
TObjectPtr< TToObjectPtr (T *Obj)
 
template<typename T >
FORCEINLINE TToRawPtr (const TObjectPtr< T > &Ptr)
 
template<typename T >
FORCEINLINE TToRawPtr (T *Ptr)
 
template<typename T , SIZE_T Size>
FORCEINLINE T ** ToRawPtrArrayUnsafe (TObjectPtr< T >(&ArrayOfPtr)[Size])
 
template<typename T >
FORCEINLINE T ** ToRawPtrArrayUnsafe (T **ArrayOfPtr)
 
template<typename ArrayType , typename ArrayTypeNoRef = std::remove_reference_t<ArrayType>, std::enable_if_t< TIsTArray< ArrayTypeNoRef >::Value > * = nullptr>
PRAGMA_DISABLE_DEPRECATION_WARNINGS decltype(autoToRawPtrTArrayUnsafe (ArrayType &&Array)
 
template<typename T >
FORCEINLINE TWeakObjectPtr< TMakeWeakObjectPtr (TObjectPtr< T > Ptr)
 
template<typename T >
void Swap (TObjectPtr< T > &A, T *&B)
 
template<typename T >
void Swap (T *&A, TObjectPtr< T > &B)
 
template<typename T >
void Swap (TArray< TObjectPtr< T > > &A, TArray< T * > &B)
 
template<typename T >
void Swap (TArray< T * > &A, TArray< TObjectPtr< T > > &B)
 
template<typename T >
void Exchange (TObjectPtr< T > &A, T *&B)
 
template<typename T >
void Exchange (T *&A, TObjectPtr< T > &B)
 
template<typename T >
void Exchange (TArray< TObjectPtr< T > > &A, TArray< T * > &B)
 
template<typename T >
void Exchange (TArray< T * > &A, TArray< TObjectPtr< T > > &B)
 
template<typename T >
TGetValid (const TObjectPtr< T > &Test)
 

Variables

constexpr uint32 UE::CoreUObject::Private::PackageIdShift = 33
 
constexpr uint32 UE::CoreUObject::Private::ObjectPathIdShift = 1
 
constexpr uint32 UE::CoreUObject::Private::ObjectPathIdMask = 0x00FF'FFFF
 
constexpr uint32 UE::CoreUObject::Private::DataClassDescriptorIdShift = 25
 
constexpr uint32 UE::CoreUObject::Private::DataClassDescriptorIdMask = 0x0000'00FF
 
constexpr uint32 UE::CoreUObject::Private::PackageIdMask = 0x7FFF'FFFF
 

Macro Definition Documentation

◆ UE_OBJECT_PTR_NONCONFORMANCE_SUPPORT

#define UE_OBJECT_PTR_NONCONFORMANCE_SUPPORT   0

Definition at line 44 of file ObjectPtr.h.

◆ UE_OBJPTR_DEPRECATED

#define UE_OBJPTR_DEPRECATED ( Version,
Message )

Definition at line 17 of file ObjectPtr.h.

◆ UE_TRANSITIONAL_OBJECT_PTR

#define UE_TRANSITIONAL_OBJECT_PTR ( Type)    auto

Wrapper macro for use in places where code needs to allow for a pointer type that could be a TObjectPtr<T> or a raw object pointer during a transitional period. The coding standard disallows general use of the auto keyword, but in wrapping it in this macro, we have a record of the explicit type meant to be used, and an avenue to go back and change these instances to an explicit TObjectPtr<T> after the transition is complete and the type won't be toggling back and forth anymore.

Definition at line 26 of file ObjectPtr.h.

◆ UE_TRANSITIONAL_OBJECT_PTR_TEMPLATE

#define UE_TRANSITIONAL_OBJECT_PTR_TEMPLATE ( Templ,
Type )   auto

Definition at line 27 of file ObjectPtr.h.

◆ UE_TRANSITIONAL_OBJECT_PTR_TEMPLATE2_ARG1

#define UE_TRANSITIONAL_OBJECT_PTR_TEMPLATE2_ARG1 ( Templ,
Type1,
Type2 )   auto

Definition at line 29 of file ObjectPtr.h.

◆ UE_TRANSITIONAL_OBJECT_PTR_TEMPLATE2_ARG1_SUFFIXED

#define UE_TRANSITIONAL_OBJECT_PTR_TEMPLATE2_ARG1_SUFFIXED ( Templ,
Type1,
Type2,
Suffix )   auto

Definition at line 30 of file ObjectPtr.h.

◆ UE_TRANSITIONAL_OBJECT_PTR_TEMPLATE2_ARG2

#define UE_TRANSITIONAL_OBJECT_PTR_TEMPLATE2_ARG2 ( Templ,
Type1,
Type2 )   auto

Definition at line 31 of file ObjectPtr.h.

◆ UE_TRANSITIONAL_OBJECT_PTR_TEMPLATE2_ARG2_SUFFIXED

#define UE_TRANSITIONAL_OBJECT_PTR_TEMPLATE2_ARG2_SUFFIXED ( Templ,
Type1,
Type2,
Suffix )   auto

Definition at line 32 of file ObjectPtr.h.

◆ UE_TRANSITIONAL_OBJECT_PTR_TEMPLATE2_ARG_BOTH

#define UE_TRANSITIONAL_OBJECT_PTR_TEMPLATE2_ARG_BOTH ( Templ,
Type1,
Type2 )   auto

Definition at line 33 of file ObjectPtr.h.

◆ UE_TRANSITIONAL_OBJECT_PTR_TEMPLATE2_ARG_BOTH_SUFFIXED

#define UE_TRANSITIONAL_OBJECT_PTR_TEMPLATE2_ARG_BOTH_SUFFIXED ( Templ,
Type1,
Type2,
Suffix )   auto

Definition at line 34 of file ObjectPtr.h.

◆ UE_TRANSITIONAL_OBJECT_PTR_TEMPLATE_SUFFIXED

#define UE_TRANSITIONAL_OBJECT_PTR_TEMPLATE_SUFFIXED ( Templ,
Type,
Suffix )   auto

Definition at line 28 of file ObjectPtr.h.

◆ UE_WITH_OBJECT_PTR_DEPRECATIONS

#define UE_WITH_OBJECT_PTR_DEPRECATIONS   0

Definition at line 13 of file ObjectPtr.h.

Typedef Documentation

◆ FObjectHandle

using FObjectHandle = UE::CoreUObject::Private::FObjectHandlePrivate

Definition at line 58 of file ObjectPtr.h.

◆ TPointedToType

Definition at line 1132 of file ObjectPtr.h.

Function Documentation

◆ Exchange() [1/4]

template<typename T >
void Exchange ( T *& A,
TObjectPtr< T > & B )
inline

Definition at line 1043 of file ObjectPtr.h.

◆ Exchange() [2/4]

template<typename T >
void Exchange ( TArray< T * > & A,
TArray< TObjectPtr< T > > & B )
inline

Definition at line 1055 of file ObjectPtr.h.

◆ Exchange() [3/4]

template<typename T >
void Exchange ( TArray< TObjectPtr< T > > & A,
TArray< T * > & B )
inline

Exchange variants between TArray<TObjectPtr<T>> and TArray<T*>

Definition at line 1050 of file ObjectPtr.h.

◆ Exchange() [4/4]

template<typename T >
void Exchange ( TObjectPtr< T > & A,
T *& B )
inline

Exchange variants between TObjectPtr<T> and raw pointer to T

Definition at line 1038 of file ObjectPtr.h.

◆ GetTypeHash()

template<typename T >
FORCEINLINE uint32 GetTypeHash ( const TObjectPtr< T > & InObjectPtr)

Definition at line 754 of file ObjectPtr.h.

◆ GetValid()

template<typename T >
T * GetValid ( const TObjectPtr< T > & Test)

Returns a pointer to a valid object if the Test object passes IsValid() tests, otherwise null

Definition at line 1064 of file ObjectPtr.h.

◆ MakeObjectPtrUnsafe()

template<typename T >
TPrivateObjectPtr< T > MakeObjectPtrUnsafe ( const UObject * Obj)

Used to allow the caller to provide a pointer to an incomplete type of T that has explicitly cast to a UObject.

Definition at line 816 of file ObjectPtr.h.

◆ MakeWeakObjectPtr()

template<typename T >
FORCEINLINE TWeakObjectPtr< T > MakeWeakObjectPtr ( TObjectPtr< T > Ptr)

Definition at line 997 of file ObjectPtr.h.

◆ operator!=()

template<typename T , typename U , decltype(ObjectPtr_Private::IsObjectPtrEqual(std::declval< const TObjectPtr< T > & >(), std::declval< U && >())) * = nullptr>
FORCEINLINE bool operator!= ( U && Other,
const TObjectPtr< T > & Ptr )

Definition at line 787 of file ObjectPtr.h.

◆ operator<<() [1/2]

template<typename T >
FORCEINLINE FArchive & operator<< ( FArchive & Ar,
TObjectPtr< T > & InObjectPtr )

Definition at line 760 of file ObjectPtr.h.

◆ operator<<() [2/2]

template<typename T >
FORCEINLINE void operator<< ( FStructuredArchiveSlot Slot,
TObjectPtr< T > & InObjectPtr )

Definition at line 766 of file ObjectPtr.h.

◆ operator==()

template<typename T , typename U , decltype(ObjectPtr_Private::IsObjectPtrEqual(std::declval< const TObjectPtr< T > & >(), std::declval< U && >())) * = nullptr>
FORCEINLINE bool operator== ( U && Other,
const TObjectPtr< T > & Ptr )

Definition at line 778 of file ObjectPtr.h.

◆ Swap() [1/4]

template<typename T >
void Swap ( T *& A,
TObjectPtr< T > & B )
inline

Definition at line 1019 of file ObjectPtr.h.

◆ Swap() [2/4]

template<typename T >
void Swap ( TArray< T * > & A,
TArray< TObjectPtr< T > > & B )
inline

Definition at line 1031 of file ObjectPtr.h.

◆ Swap() [3/4]

template<typename T >
void Swap ( TArray< TObjectPtr< T > > & A,
TArray< T * > & B )
inline

Swap variants between TArray<TObjectPtr<T>> and TArray<T*>

Definition at line 1026 of file ObjectPtr.h.

◆ Swap() [4/4]

template<typename T >
void Swap ( TObjectPtr< T > & A,
T *& B )
inline

Swap variants between TObjectPtr<T> and raw pointer to T

Definition at line 1014 of file ObjectPtr.h.

◆ ToObjectPtr()

template<typename T >
TObjectPtr< T > ToObjectPtr ( T * Obj)

Definition at line 822 of file ObjectPtr.h.

◆ ToRawPtr() [1/2]

template<typename T >
FORCEINLINE T * ToRawPtr ( const TObjectPtr< T > & Ptr)

Definition at line 828 of file ObjectPtr.h.

◆ ToRawPtr() [2/2]

template<typename T >
FORCEINLINE T * ToRawPtr ( T * Ptr)

Definition at line 835 of file ObjectPtr.h.

◆ ToRawPtrArrayUnsafe() [1/2]

template<typename T >
FORCEINLINE T ** ToRawPtrArrayUnsafe ( T ** ArrayOfPtr)

Definition at line 854 of file ObjectPtr.h.

◆ ToRawPtrArrayUnsafe() [2/2]

template<typename T , SIZE_T Size>
FORCEINLINE T ** ToRawPtrArrayUnsafe ( TObjectPtr< T >(&) ArrayOfPtr[Size])

Definition at line 841 of file ObjectPtr.h.

◆ ToRawPtrTArrayUnsafe()

template<typename ArrayType , typename ArrayTypeNoRef = std::remove_reference_t<ArrayType>, std::enable_if_t< TIsTArray< ArrayTypeNoRef >::Value > * = nullptr>
PRAGMA_DISABLE_DEPRECATION_WARNINGS decltype(auto) ToRawPtrTArrayUnsafe ( ArrayType && Array)

Definition at line 865 of file ObjectPtr.h.