Language:
Discover
By Skill Level
By Category

TWeakObjectPtr

Choose your OS:

Inheritance Hierarchy

TWeakObjectPtrBase

TWeakObjectPtr

TAutoWeakObjectPtr

Syntax

template<class T, class TWeakObjectPtrBase>
struct TWeakObjectPtr : private TWeakObjectPtrBase

Constructors

Name Description

Public function

TWeakObjectPtr()

Public function

TWeakObjectPtr

(
    const TWeakObjectPtr &
)

Public function

TWeakObjectPtr

(
    TYPE_OF_NULLPTR
)

Construct from a null pointer

Public function

TWeakObjectPtr

(
    const TWeakObjectPtr < OtherT, TWeak...
)

Construct from another weak pointer of another type, intended for derived-to-base conversions

Public function

TWeakObjectPtr

(
    U* Object,
    EDummy1
)

Construct from an object pointer

Public function

TWeakObjectPtr

(
    U* Object,
    EDummy2
)

Destructors

Name Description

Public function

~TWeakObjectPtr()

Functions

Name Description

Public function

T *

 

Get

(
    bool bEvenIfPendingKill
)

Dereference the weak pointer

Public function

T *

 

Get()

Dereference the weak pointer. This is an optimized version implying bEvenIfPendingKill=false.

Public function

T *

 

GetEvenIfUnreachable()

Deferences the weak pointer even if its marked RF_Unreachable.

Public function

bool

 

HasSameIndexAndSerialNumber

(
    const TWeakObjectPtr & Other
)

Public function

bool

 

IsStale

(
    bool bIncludingIfPendingKill,
    bool bThreadsafeTest
)

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.

Public function

bool

 

IsValid()

Test if this points to a live UObject .

Public function

bool

 

IsValid

(
    bool bEvenIfPendingKill,
    bool bThreadsafeTest
)

Test if this points to a live UObject

Public function

void

 

Reset()

Reset the weak pointer back to the NULL state

Operators

Name Description

Public function

T &

 

operator*()

Dereference the weak pointer

Public function

TWeakObjectP ...

 

operator=

(
    const TWeakObjectPtr &
)

Public function

TEnableIf <&#...

 

operator=

(
    U* Object
)

Copy from an object pointer

Public function

TEnableIf < T ...

 

operator=

(
    U* Object
)

Public function

void

 

operator=

(
    const TWeakObjectPtr < OtherT, TWeak...
)

Assign from another weak pointer, intended for derived-to-base conversions

Public function

T *

 

operator->()

Dereference the weak pointer

Enums

Name

Description

Public enum

EDummy1

These exists only to disambiguate the two constructors below.

Public enum

EDummy2

References

Module

Core

Header

Runtime/Core/Public/UObject/WeakObjectPtrTemplates.h