TSoftObjectPtr

[TSoftObjectPtr](API\Runtime\CoreUObject\UObject\TSoftObjectPtr) is templatized wrapper of the generic [FSoftObjectPtr](API\Runtime\CoreUObject\UObject\FSoftObjectPtr), it can be used in UProperties

References

Module

CoreUObject

Header

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

Include

#include "UObject/SoftObjectPtr.h"

Syntax

template<class T>
struct TSoftObjectPtr

Remarks

TSoftObjectPtr is templatized wrapper of the generic FSoftObjectPtr, it can be used in UProperties

Constructors

Name Description

Public function

TSoftObjectPtr()

Public function

TSoftObjectPtr

(
    const TSoftObjectPtr& Other
)

Public function

TSoftObjectPtr

(
    TSoftObjectPtr&& Other
)

Public function

TSoftObjectPtr

(
    const TSoftObjectPtr< U >& Other
)

Construct from another soft pointer

Public function

TSoftObjectPtr

(
    TSoftObjectPtr< U >&& Other
)

Construct from a moveable soft pointer

Public function

TSoftObjectPtr

(
    const U* Object
)

Construct from an object already in memory

Public function

TSoftObjectPtr

(
    const TObjectPtr< U > Object
)

Public function

TSoftObjectPtr

(
    TYPE_OF_NULLPTR
)

Construct from a nullptr

Public function

TSoftObjectPtr

(
    FSoftObjectPath ObjectPath
)

Construct from a soft object path

Destructors

Name Description

Public function

~TSoftObjectPtr()

Functions

Name Description

Public function Const

FString

 

GetAssetName()

Returns assetname string, leaving off the /package/path part

Public function Const

FString

 

GetLongPackageName()

Returns /package/path string, leaving off the asset name

Public function Const

uint32

 

GetPtrTypeHash()

Hash function

Public function Const

const FSoftO...

 

GetUniqueID()

Returns the StringObjectPath that is wrapped by this SoftObjectPtr

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

 

IsValid()

Test if this points to a live UObject

Public function Const

T *

 

LoadSynchronous()

Synchronously load (if necessary) and return the asset object represented by this asset ptr

Public function

void

 

Reset()

Reset the soft pointer back to the null state

Public function

void

 

ResetWeakPtr()

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

Public function

void

 

Serialize

(
    FArchive& Ar
)

Public function Const

const FSoftO...

 

ToSoftObjectPath()

Returns the StringObjectPath that is wrapped by this SoftObjectPtr

Public function Const

FString

 

ToString()

Returns string representation of reference, in form /package/path.assetname

Operators

Name Description

Public function Const

 

operator bool()

Dereference soft pointer to see if it points somewhere valid

Public function Const

bool

 

operator!=

(
    const TSoftObjectPtr& Rhs
)

Compare soft pointers for inequality Caution: Two soft pointers might not be equal to each other, but they both might return nullptr

Public function Const

bool

 

operator!=

(
    TYPE_OF_NULLPTR
)

Compare soft pointers for inequality Caution: Two soft pointers might not be equal to each other, but they both might return nullptr

Public function Const

T &

 

operator*()

Dereference the soft pointer

Public function

TSoftObjectP...

 

operator=

(
    FSoftObjectPath ObjectPath
)

Copy from a soft object path

Public function

TSoftObjectP...

 

operator=

(
    TSoftObjectPtr< U > Other
)

Copy from another soft pointer

Public function

TSoftObjectP...

 

operator=

(
    const TWeakObjectPtr< U >& Other
)

Copy from a weak pointer to an object already in memory

Public function

TSoftObjectP...

 

operator=

(
    const TSoftObjectPtr& Other
)

Public function

TSoftObjectP...

 

operator=

(
    TSoftObjectPtr&& Other
)

Public function

TSoftObjectP...

 

operator=

(
    const U* Object
)

Copy from an object already in memory

Public function

TSoftObjectP...

 

operator=

(
    const TObjectPtr< U > Object
)

Public function

TSoftObjectP...

 

operator=

(
    TYPE_OF_NULLPTR
)

Assign from a nullptr

Public function Const

bool

 

operator==

(
    TYPE_OF_NULLPTR
)

Compare soft pointers for equality Caution: Two soft pointers might not be equal to each other, but they both might return nullptr

Public function Const

bool

 

operator==

(
    const TSoftObjectPtr& Rhs
)

Compare soft pointers for equality Caution: Two soft pointers might not be equal to each other, but they both might return nullptr

Public function Const

T *

 

operator->()

Dereference the soft pointer

Typedefs

Name

Description

ElementType

Deprecated Functions

Name Description

Public function Const

T *

 

Get()

TAssetSubclassOf was renamed to TSoftClassPtr

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