Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/UObject
Inheritance Hierarchy
- TWeakObjectPtrBase
- TWeakObjectPtr
References
| Module | Core |
| Header | /Engine/Source/Runtime/Core/Public/UObject/WeakObjectPtrTemplates.h |
| Include | #include "UObject/WeakObjectPtrTemplates.h" |
Syntax
template<class T, class TWeakObjectPtrBase>
struct TWeakObjectPtr : private TWeakObjectPtrBase
Remarks
TWeakObjectPtr is the templated version of the generic FWeakObjectPtr
Constructors
| Type | Name | Description | |
|---|---|---|---|
TWeakObjectPtr
(
const TWeakObjectPtr& |
|||
| Construct from a null pointer | |||
TWeakObjectPtr
(
U Object |
Construct from an object pointer | ||
TWeakObjectPtr
(
const TWeakObjectPtr< OtherT, TWeakObjectPtrBase >& Other |
Construct from another weak pointer of another type, intended for derived-to-base conversions |
Destructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| T * | Get
(
bool bEvenIfPendingKill |
Dereference the weak pointer | |
| T * | Get () |
Dereference the weak pointer. This is an optimized version implying bEvenIfPendingKill=false. | |
| T * | Deferences the weak pointer even if its marked RF_Unreachable. | ||
| uint32 | Hash function. | ||
| bool | HasSameIndexAndSerialNumber
(
const TWeakObjectPtr< OtherT, TWeakObjectPtrBase >& Other |
Returns true if two weak pointers were originally set to the same object, even if they are now stale | |
| bool | HasSameIndexAndSerialNumber
(
const TWeakObjectPtr& Other |
Returns true if two weak pointers were originally set to the same object, even if they are now stale | |
| bool | Returns true if this pointer was explicitly assigned to null, was reset, or was never initialized. | ||
| bool | IsStale
(
bool bIncludingIfPendingKill, |
Slightly different than !IsValid(), returns true if this used to point to a UObject, but doesn't any more and has not been assigned or reset in the mean time. | |
| bool | IsValid () |
Test if this points to a live UObject. | |
| bool | IsValid
(
bool bEvenIfPendingKill, |
Test if this points to a live UObject. | |
| TStrongObjectPtr< T > | Pin
(
bool bEvenIfPendingKill |
Pin the weak pointer and get a strongptr. | |
| TStrongObjectPtr< T > | Pin () |
Pin the weak pointer as a strong ptr. | |
| void | Reset () |
Reset the weak pointer back to the null state | |
| void | Weak object pointer serialization, this forwards to FArchive::operator<<(struct FWeakObjectPtr&) or an override |
Operators
| Type | Name | Description | |
|---|---|---|---|
| This is explicitly not added to avoid resolving weak pointers too often - use Get() once in a function. | |||
| bool | operator!=
(
const TWeakObjectPtr< RhsT, TWeakObjectPtrBase >& Rhs |
Compare weak pointers for inequality | |
| bool | operator!=
(
const RhsT* Rhs |
||
| bool | |||
| T & | operator* () |
Dereference the weak pointer | |
| TWeakObjectPtr & | operator=
(
const TWeakObjectPtr< OtherT, TWeakObjectPtrBase >& Other |
Assign from another weak pointer, intended for derived-to-base conversions | |
| TWeakObjectPtr & | operator=
(
const TWeakObjectPtr& |
||
| TWeakObjectPtr & | operator=
(
U* Object |
Copy from an object pointer | |
| bool | operator==
(
const TWeakObjectPtr< RhsT, TWeakObjectPtrBase >& Rhs |
Compare weak pointers for equality. | |
| bool | operator==
(
const RhsT* Rhs |
||
| bool | |||
| T * | operator-> () |
Dereference the weak pointer |
Typedefs
| Name | Description |
|---|---|
| ElementType | Although templated, these parameters are not intended to be anything other than the default, and are only templates for module organization reasons. |