Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
TObjectPtr< T > Struct Template Reference

#include <UE.h>

+ Collaboration diagram for TObjectPtr< T >:

Public Types

using ElementType = T
 

Public Member Functions

FORCEINLINE TGet () const
 
FORCEINLINE Toperator-> () const
 
FORCEINLINE Toperator* () const
 
FORCEINLINE operator bool () const
 
FORCEINLINE operator T* () const
 
 TObjectPtr ()
 
 TObjectPtr (TObjectPtr< T > &&Other)=default
 
 TObjectPtr (const TObjectPtr< T > &Other)=default
 
FORCEINLINE TObjectPtr (ENoInit)
 
FORCEINLINE TObjectPtr (TYPE_OF_NULLPTR)
 
template<typename U , decltype(ImplicitConv< T * >(std::declval< U * >())) * = nullptr>
FORCEINLINE TObjectPtr (const TObjectPtr< U > &Other)
 
template<typename U , std::enable_if_t< !TIsTObjectPtr< std::decay_t< U > >::Value, decltype(ImplicitConv< T * >(std::declval< U >())) > * = nullptr>
FORCEINLINE TObjectPtr (U &&Object)
 
FORCEINLINE TObjectPtr (TPrivateObjectPtr< T > &&PrivatePtr)
 
TObjectPtr< T > & operator= (TObjectPtr< T > &&)=default
 
TObjectPtr< T > & operator= (const TObjectPtr< T > &)=default
 
FORCEINLINE TObjectPtr< T > & operator= (TYPE_OF_NULLPTR)
 
template<typename U , decltype(ImplicitConv< T * >(std::declval< U * >())) * = nullptr>
FORCEINLINE TObjectPtr< T > & operator= (const TObjectPtr< U > &Other)
 
template<typename U , std::enable_if_t< !TIsTObjectPtr< std::decay_t< U > >::Value, decltype(ImplicitConv< T * >(std::declval< U >())) > * = nullptr>
FORCEINLINE TObjectPtr< T > & operator= (U &&Object)
 
FORCEINLINE TObjectPtr< T > & operator= (TPrivateObjectPtr< T > &&PrivatePtr)
 
template<typename U , typename Base = std::decay_t<decltype(false ? std::declval<std::decay_t<T*>>() : std::declval<std::decay_t<U*>>())>>
FORCEINLINE bool operator== (const TObjectPtr< U > &Other) const
 
FORCEINLINE bool operator== (TYPE_OF_NULLPTR) const
 
template<typename U , typename = decltype(ObjectPtr_Private::IsObjectPtrEqual(std::declval<const TObjectPtr<T>&>(), std::declval<U&&>()))>
FORCEINLINE bool operator== (U &&Other) const
 
template<typename U , typename Base = std::decay_t<decltype(false ? std::declval<std::decay_t<T*>>() : std::declval<std::decay_t<U*>>())>>
FORCEINLINE bool operator!= (const TObjectPtr< U > &Other) const
 
FORCEINLINE bool operator!= (TYPE_OF_NULLPTR) const
 
template<typename U , typename = decltype(ObjectPtr_Private::IsObjectPtrEqual(std::declval<const TObjectPtr<T>&>(), std::declval<U&&>()))>
FORCEINLINE bool operator!= (U &&Other) const
 
FORCEINLINE TGet () const
 
FORCEINLINE UClassGetClass () const
 
FORCEINLINE operator T* () const
 
template<typename U >
FORCEINLINE operator U* () const
 
FORCEINLINE operator UPTRINT () const
 
FORCEINLINE Toperator-> () const
 
FORCEINLINE Toperator* () const
 
FORCEINLINE operator T*& ()
 
FORCEINLINE bool IsNull () const
 
FORCEINLINE bool IsNullNoResolve () const
 
FORCEINLINE bool operator! () const
 
FORCEINLINE operator bool () const
 
FORCEINLINE bool IsResolved () const
 
FORCEINLINE FString GetPath () const
 
FORCEINLINE FString GetPathName () const
 
FORCEINLINE FName GetFName () const
 
FORCEINLINE FString GetName () const
 
FORCEINLINE FString GetFullName (EObjectFullNameFlags Flags=EObjectFullNameFlags::None) const
 
FORCEINLINE FObjectHandle GetHandle () const
 
FORCEINLINE bool IsA (const UClass *SomeBase) const
 
template<typename U >
FORCEINLINE bool IsA () const
 
FORCEINLINE uint32 GetPtrTypeHash () const
 
FORCEINLINE void SerializePtrStructured (FStructuredArchiveSlot Slot)
 

Private Member Functions

FORCEINLINE UObjectRealGet () const
 
FORCEINLINE TGetNoReadNoCheck () const
 
FORCEINLINE TGetNoResolveNoCheck () const
 
FORCEINLINE T *& GetInternalRef ()
 

Private Attributes

FObjectHandlePrivate Handle
 
union { 
 
   FObjectPtr   ObjectPtr 
 
   T *   DebugPtr 
 
};  
 

Friends

struct FObjectPtr
 
template<typename U >
struct TObjectPtr
 
template<typename U , typename V >
bool ObjectPtr_Private::IsObjectPtrEqualToRawPtrOfRelatedType (const TObjectPtr< U > &Ptr, const V *Other)
 

Detailed Description

template<typename T>
struct TObjectPtr< T >

TObjectPtr is a type of pointer to a UObject that is meant to function as a drop-in replacement for raw pointer member properties. It is size equivalent to a 64-bit pointer and supports access tracking and optional lazy load behavior in editor builds. It stores either the address to the referenced object or (in editor builds) an index in the object handle table that describes a referenced object that hasn't been loaded yet. It is serialized identically to a raw pointer to a UObject. When resolved, its participation in garbage collection is identical to a raw pointer to a UObject.

This is useful for automatic replacement of raw pointers to support advanced cook-time dependency tracking and editor-time lazy load use cases. See UnrealObjectPtrTool for tooling to automatically replace raw pointer members with FObjectPtr/TObjectPtr members instead.

Definition at line 123 of file UE.h.

Member Typedef Documentation

◆ ElementType

template<typename T >
using TObjectPtr< T >::ElementType = T

Definition at line 493 of file ObjectPtr.h.

Constructor & Destructor Documentation

◆ TObjectPtr() [1/8]

template<typename T >
TObjectPtr< T >::TObjectPtr ( )
inline

Definition at line 495 of file ObjectPtr.h.

◆ TObjectPtr() [2/8]

template<typename T >
TObjectPtr< T >::TObjectPtr ( TObjectPtr< T > && Other)
default

◆ TObjectPtr() [3/8]

template<typename T >
TObjectPtr< T >::TObjectPtr ( const TObjectPtr< T > & Other)
default

◆ TObjectPtr() [4/8]

template<typename T >
FORCEINLINE TObjectPtr< T >::TObjectPtr ( ENoInit )
inlineexplicit

Definition at line 503 of file ObjectPtr.h.

◆ TObjectPtr() [5/8]

Definition at line 508 of file ObjectPtr.h.

◆ TObjectPtr() [6/8]

template<typename T >
template<typename U , decltype(ImplicitConv< T * >(std::declval< U * >())) * = nullptr>
FORCEINLINE TObjectPtr< T >::TObjectPtr ( const TObjectPtr< U > & Other)
inline

Definition at line 517 of file ObjectPtr.h.

◆ TObjectPtr() [7/8]

template<typename T >
template<typename U , std::enable_if_t< !TIsTObjectPtr< std::decay_t< U > >::Value, decltype(ImplicitConv< T * >(std::declval< U >())) > * = nullptr>
FORCEINLINE TObjectPtr< T >::TObjectPtr ( U && Object)
inline

Definition at line 530 of file ObjectPtr.h.

◆ TObjectPtr() [8/8]

template<typename T >
FORCEINLINE TObjectPtr< T >::TObjectPtr ( TPrivateObjectPtr< T > && PrivatePtr)
inlineexplicit

Definition at line 535 of file ObjectPtr.h.

Member Function Documentation

◆ Get() [1/2]

template<typename T >
FORCEINLINE T * TObjectPtr< T >::Get ( ) const
inline

Definition at line 130 of file UE.h.

◆ Get() [2/2]

template<typename T >
FORCEINLINE T * TObjectPtr< T >::Get ( ) const
inline

Definition at line 636 of file ObjectPtr.h.

◆ GetClass()

template<typename T >
FORCEINLINE UClass * TObjectPtr< T >::GetClass ( ) const
inline

Definition at line 637 of file ObjectPtr.h.

◆ GetFName()

template<typename T >
FORCEINLINE FName TObjectPtr< T >::GetFName ( ) const
inline

Definition at line 661 of file ObjectPtr.h.

◆ GetFullName()

template<typename T >
FORCEINLINE FString TObjectPtr< T >::GetFullName ( EObjectFullNameFlags Flags = EObjectFullNameFlags::None) const
inline

Definition at line 663 of file ObjectPtr.h.

◆ GetHandle()

template<typename T >
FORCEINLINE FObjectHandle TObjectPtr< T >::GetHandle ( ) const
inline

Definition at line 664 of file ObjectPtr.h.

◆ GetInternalRef()

template<typename T >
FORCEINLINE T *& TObjectPtr< T >::GetInternalRef ( )
inlineprivate

Definition at line 690 of file ObjectPtr.h.

◆ GetName()

template<typename T >
FORCEINLINE FString TObjectPtr< T >::GetName ( ) const
inline

Definition at line 662 of file ObjectPtr.h.

◆ GetNoReadNoCheck()

template<typename T >
FORCEINLINE T * TObjectPtr< T >::GetNoReadNoCheck ( ) const
inlineprivate

Definition at line 684 of file ObjectPtr.h.

◆ GetNoResolveNoCheck()

template<typename T >
FORCEINLINE T * TObjectPtr< T >::GetNoResolveNoCheck ( ) const
inlineprivate

Definition at line 685 of file ObjectPtr.h.

◆ GetPath()

template<typename T >
FORCEINLINE FString TObjectPtr< T >::GetPath ( ) const
inline

Definition at line 659 of file ObjectPtr.h.

◆ GetPathName()

template<typename T >
FORCEINLINE FString TObjectPtr< T >::GetPathName ( ) const
inline

Definition at line 660 of file ObjectPtr.h.

◆ GetPtrTypeHash()

template<typename T >
FORCEINLINE uint32 TObjectPtr< T >::GetPtrTypeHash ( ) const
inline

Definition at line 668 of file ObjectPtr.h.

◆ IsA() [1/2]

template<typename T >
template<typename U >
FORCEINLINE bool TObjectPtr< T >::IsA ( ) const
inline

Definition at line 666 of file ObjectPtr.h.

◆ IsA() [2/2]

template<typename T >
FORCEINLINE bool TObjectPtr< T >::IsA ( const UClass * SomeBase) const
inline

Definition at line 665 of file ObjectPtr.h.

◆ IsNull()

template<typename T >
FORCEINLINE bool TObjectPtr< T >::IsNull ( ) const
inline

Definition at line 651 of file ObjectPtr.h.

◆ IsNullNoResolve()

template<typename T >
FORCEINLINE bool TObjectPtr< T >::IsNullNoResolve ( ) const
inline

Definition at line 654 of file ObjectPtr.h.

◆ IsResolved()

template<typename T >
FORCEINLINE bool TObjectPtr< T >::IsResolved ( ) const
inline

Definition at line 658 of file ObjectPtr.h.

◆ operator bool() [1/2]

template<typename T >
FORCEINLINE TObjectPtr< T >::operator bool ( ) const
inline

Definition at line 133 of file UE.h.

◆ operator bool() [2/2]

template<typename T >
FORCEINLINE TObjectPtr< T >::operator bool ( ) const
inlineexplicit

Definition at line 657 of file ObjectPtr.h.

◆ operator T*() [1/2]

template<typename T >
FORCEINLINE TObjectPtr< T >::operator T* ( ) const
inline

Definition at line 134 of file UE.h.

◆ operator T*() [2/2]

template<typename T >
FORCEINLINE TObjectPtr< T >::operator T* ( ) const
inline

Definition at line 639 of file ObjectPtr.h.

◆ operator T*&()

template<typename T >
FORCEINLINE TObjectPtr< T >::operator T*& ( )
inlineexplicit

Definition at line 648 of file ObjectPtr.h.

◆ operator U*()

template<typename T >
template<typename U >
FORCEINLINE TObjectPtr< T >::operator U* ( ) const
inlineexplicit

Definition at line 642 of file ObjectPtr.h.

◆ operator UPTRINT()

template<typename T >
FORCEINLINE TObjectPtr< T >::operator UPTRINT ( ) const
inlineexplicit

Definition at line 643 of file ObjectPtr.h.

◆ operator!()

template<typename T >
FORCEINLINE bool TObjectPtr< T >::operator! ( ) const
inline

Definition at line 656 of file ObjectPtr.h.

◆ operator!=() [1/3]

template<typename T >
template<typename U , typename Base = std::decay_t<decltype(false ? std::declval<std::decay_t<T*>>() : std::declval<std::decay_t<U*>>())>>
FORCEINLINE bool TObjectPtr< T >::operator!= ( const TObjectPtr< U > & Other) const
inline

Definition at line 610 of file ObjectPtr.h.

◆ operator!=() [2/3]

Definition at line 615 of file ObjectPtr.h.

◆ operator!=() [3/3]

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

Definition at line 624 of file ObjectPtr.h.

◆ operator*() [1/2]

template<typename T >
FORCEINLINE T & TObjectPtr< T >::operator* ( ) const
inline

Definition at line 132 of file UE.h.

◆ operator*() [2/2]

template<typename T >
FORCEINLINE T & TObjectPtr< T >::operator* ( ) const
inline

Definition at line 645 of file ObjectPtr.h.

◆ operator->() [1/2]

template<typename T >
FORCEINLINE T * TObjectPtr< T >::operator-> ( ) const
inline

Definition at line 131 of file UE.h.

◆ operator->() [2/2]

template<typename T >
FORCEINLINE T * TObjectPtr< T >::operator-> ( ) const
inline

Definition at line 644 of file ObjectPtr.h.

◆ operator=() [1/6]

template<typename T >
TObjectPtr< T > & TObjectPtr< T >::operator= ( const TObjectPtr< T > & )
default

◆ operator=() [2/6]

template<typename T >
template<typename U , decltype(ImplicitConv< T * >(std::declval< U * >())) * = nullptr>
FORCEINLINE TObjectPtr< T > & TObjectPtr< T >::operator= ( const TObjectPtr< U > & Other)
inline

Definition at line 553 of file ObjectPtr.h.

◆ operator=() [3/6]

template<typename T >
TObjectPtr< T > & TObjectPtr< T >::operator= ( TObjectPtr< T > && )
default

◆ operator=() [4/6]

template<typename T >
FORCEINLINE TObjectPtr< T > & TObjectPtr< T >::operator= ( TPrivateObjectPtr< T > && PrivatePtr)
inline

Definition at line 573 of file ObjectPtr.h.

◆ operator=() [5/6]

Definition at line 543 of file ObjectPtr.h.

◆ operator=() [6/6]

template<typename T >
template<typename U , std::enable_if_t< !TIsTObjectPtr< std::decay_t< U > >::Value, decltype(ImplicitConv< T * >(std::declval< U >())) > * = nullptr>
FORCEINLINE TObjectPtr< T > & TObjectPtr< T >::operator= ( U && Object)
inline

Definition at line 567 of file ObjectPtr.h.

◆ operator==() [1/3]

template<typename T >
template<typename U , typename Base = std::decay_t<decltype(false ? std::declval<std::decay_t<T*>>() : std::declval<std::decay_t<U*>>())>>
FORCEINLINE bool TObjectPtr< T >::operator== ( const TObjectPtr< U > & Other) const
inline

Definition at line 584 of file ObjectPtr.h.

◆ operator==() [2/3]

template<typename T >
FORCEINLINE bool TObjectPtr< T >::operator== ( TYPE_OF_NULLPTR ) const
inline

Definition at line 590 of file ObjectPtr.h.

◆ operator==() [3/3]

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

Definition at line 600 of file ObjectPtr.h.

◆ RealGet()

template<typename T >
FORCEINLINE UObject * TObjectPtr< T >::RealGet ( ) const
inlineprivate

Definition at line 127 of file UE.h.

◆ SerializePtrStructured()

template<typename T >
FORCEINLINE void TObjectPtr< T >::SerializePtrStructured ( FStructuredArchiveSlot Slot)
inline

Definition at line 673 of file ObjectPtr.h.

Friends And Related Symbol Documentation

◆ FObjectPtr

template<typename T >
friend struct FObjectPtr
friend

Definition at line 679 of file ObjectPtr.h.

◆ ObjectPtr_Private::IsObjectPtrEqualToRawPtrOfRelatedType

◆ TObjectPtr

template<typename T >
template<typename U >
friend struct TObjectPtr
friend

Definition at line 680 of file ObjectPtr.h.

Member Data Documentation

◆ [union]

union { ... } TObjectPtr< T >

◆ DebugPtr

template<typename T >
T* TObjectPtr< T >::DebugPtr

Definition at line 701 of file ObjectPtr.h.

◆ Handle

template<typename T >
FObjectHandlePrivate TObjectPtr< T >::Handle
private

Definition at line 126 of file UE.h.

◆ ObjectPtr

template<typename T >
FObjectPtr TObjectPtr< T >::ObjectPtr

Definition at line 698 of file ObjectPtr.h.


The documentation for this struct was generated from the following files: