TPersistentObjectPtr

[TPersistentObjectPtr](API\Runtime\CoreUObject\UObject\TPersistentObjectPtr) is a template base class for [FLazyObjectPtr](API\Runtime\CoreUObject\UObject\FLazyObjectPtr) and [FSoftObjectPtr](API\Runtime\CoreUObject\UObject\FSoftObjectPtr)

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

CoreUObject

Header

/Engine/Source/Runtime/CoreUObject/Public/UObject/PersistentObjectPtr.h

Include

#include "UObject/PersistentObjectPtr.h"

Syntax

template<class TObjectID>
struct TPersistentObjectPtr

Remarks

TPersistentObjectPtr is a template base class for FLazyObjectPtr and FSoftObjectPtr

Constructors

Name Description

Public function

TPersistentObjectPtr()

Default constructor, will be null

Public function

TPersistentObjectPtr

(
    const TObjectID& InObjectID
)

Construct from a unique object identifier

Functions

Name Description

Public function Const

UObject *...

 

Get()

Dereference the pointer, which may cause it to become valid again.

Public function Const

UObject *...

 

Get

(
    bool bEvenIfPendingKill
)

Dereference the lazy pointer, which may cause it to become valid again.

Public function

TObjectID &

 

GetUniqueID()

Non-const version of the above

Public function Const

const TObjec...

 

GetUniqueID()

Gets the unique object identifier associated with this lazy pointer.

Public function Const

bool

 

IsNull()

Test if this can never point to a live UObject

Public function Const

bool

 

IsPending()

Test if this does not point to a live UObject, but may in the future

Public function Const

bool

 

IsStale()

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 Const

bool

 

IsValid()

Test if this points to a live UObject

Public function

void

 

Reset()

Reset the lazy pointer back to the null state

Public function

void

 

ResetWeakPtr()

Resets the weak ptr only, call this when ObjectId may change

Operators

Name Description

Public function Const

UObject &

 

operator*()

Dereference the pointer

Public function

void

 

operator=

(
    const TObjectID& InObjectID
)

Copy from a unique object identifier

Public function

void

 

operator=

(
    const UObject* Object
)

Copy from an object pointer

Public function

void

 

operator=

(
    const FWeakObjectPtr& Other
)

Copy from an existing weak pointer, reserve IDs if required

Public function Const

UObject *...

 

operator->()

Dereference the pointer

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss