Navigation
Unreal Engine C++ API Reference > Runtime > Core > Delegates
References
Module | Core |
Header | /Engine/Source/Runtime/Core/Public/Delegates/DelegateSignatureImpl.inl |
Include | #include "Delegates/DelegateSignatureImpl.inl" |
Syntax
template<typename T>
struct TObjectPtr
Remarks
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.
Variables
Type | Name | Description | |
---|---|---|---|
![]() |
T * | DebugPtr | DebugPtr allows for easier dereferencing of a resolved TObjectPtr in watch windows of debuggers. |
![]() |
FObjectPtr | ObjectPtr |
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
TObjectPtr () |
||
![]() |
TObjectPtr
(
TPrivateObjectPtr< T >&& PrivatePtr |
||
![]() |
TObjectPtr
(
TObjectPtr< T >&& Other |
||
![]() |
TObjectPtr
(
const TObjectPtr< T >& Other |
||
![]() |
TObjectPtr
(
ENoInit |
||
![]() |
TObjectPtr
(
TYPE_OF_NULLPTR |
||
![]() |
TObjectPtr
(
FObjectPtr ObjPtr |
||
![]() |
TObjectPtr
(
const TObjectPtr< U >& Other |
||
![]() |
TObjectPtr
(
U&& Object |
||
![]() |
TObjectPtr
(
T& Object |
Functions
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
T * | Get () |
: OBJPTR: There is a risk that the FObjectPtr is storing a reference to the wrong type. |
![]() ![]() |
UClass * | GetClass () |
|
![]() ![]() |
FName | GetFName () |
|
![]() ![]() |
FString | GetFullName
(
EObjectFullNameFlags Flags |
|
![]() ![]() |
FObjectHandle | GetHandle () |
|
![]() ![]() |
FString | GetName () |
|
![]() ![]() |
TObjectPtr< UObject > | GetOuter () |
|
![]() ![]() |
TObjectPtr< UPackage > | GetPackage () |
|
![]() ![]() |
FString | GetPath () |
|
![]() ![]() |
FString | GetPathName () |
|
![]() ![]() |
uint32 | ||
![]() ![]() |
bool | ||
![]() ![]() |
bool | IsA () |
|
![]() ![]() |
bool | IsResolved () |
|
![]() |
void |
Operators
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
|||
![]() ![]() |
operator T * () |
||
![]() |
|||
![]() ![]() |
operator U * () |
||
![]() ![]() |
|||
![]() ![]() |
bool | operator! () |
|
![]() ![]() |
bool | operator!=
(
const TObjectPtr< U >& Other |
|
![]() ![]() |
bool | operator!=
(
TYPE_OF_NULLPTR |
|
![]() ![]() |
bool | operator!=
(
U&& Other |
|
![]() ![]() |
T & | operator* () |
|
![]() |
TObjectPtr< T > & | operator=
(
TYPE_OF_NULLPTR |
|
![]() |
TObjectPtr< T > & | operator=
(
U&& Object |
|
![]() |
TObjectPtr< T > & | operator=
(
const TObjectPtr< U >& Other |
|
![]() |
TObjectPtr< T > & | operator=
(
TPrivateObjectPtr< T >&& PrivatePtr |
|
![]() |
TObjectPtr< T > & | operator=
(
const TObjectPtr< T >& |
|
![]() |
TObjectPtr< T > & | operator=
(
TObjectPtr< T >&& |
|
![]() ![]() |
bool | operator==
(
const TObjectPtr< U >& Other |
Equality/Inequality comparisons against other TObjectPtr. |
![]() ![]() |
bool | operator==
(
TYPE_OF_NULLPTR |
Equality/Inequality comparisons against nullptr. |
![]() ![]() |
bool | operator==
(
U&& Other |
Equality/Inequality comparisons against another type that can be implicitly converted to the pointer type kept in a TObjectPtr. |
![]() ![]() |
T * | operator-> () |
Typedefs
Name | Description |
---|---|
ElementType | TObjectPtr should only be used on types T that are EITHER: |
Deprecated Functions
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
bool | IsNull () |
IsNull is deprecated, please use operator bool instead. if (!MyObjectPtr) { ... } |
![]() ![]() |
bool | IsNullNoResolve is deprecated, please use operator bool instead. if (!MyObjectPtr) { ... } |