UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TSoftClassPtr< TClass > Class Template Reference

#include <SoftObjectPtr.h>

Public Types

using ElementType = TClass
 

Public Member Functions

UE_FORCEINLINE_HINT TSoftClassPtr ()=default
 
UE_FORCEINLINE_HINT TSoftClassPtr (const TSoftClassPtr &Other)=default
 
UE_FORCEINLINE_HINT TSoftClassPtr (TSoftClassPtr &&Other)=default
 
UE_FORCEINLINE_HINT ~TSoftClassPtr ()=default
 
UE_FORCEINLINE_HINT TSoftClassPtroperator= (const TSoftClassPtr &Other)=default
 
UE_FORCEINLINE_HINT TSoftClassPtroperator= (TSoftClassPtr &&Other)=default
 
template<class TClassA >
UE_FORCEINLINE_HINT TSoftClassPtr (const TSoftClassPtr< TClassA > &Other)
 
UE_FORCEINLINE_HINT TSoftClassPtr (const UClass *From)
 
UE_FORCEINLINE_HINT TSoftClassPtr (const FSoftObjectPath &ObjectPath)
 
UE_FORCEINLINE_HINT void Reset ()
 
UE_FORCEINLINE_HINT void ResetWeakPtr ()
 
UE_FORCEINLINE_HINT void operator= (const UClass *From)
 
UE_FORCEINLINE_HINT void operator= (const FSoftObjectPath &ObjectPath)
 
template<class TClassA >
TSoftClassPtroperator= (const TWeakObjectPtr< TClassA > &Other)
 
template<class TClassA >
TSoftClassPtroperator= (const TSoftObjectPtr< TClassA > &Other)
 
UE_FORCEINLINE_HINT bool operator== (const TSoftClassPtr &Other) const
 
UE_FORCEINLINE_HINT bool operator!= (const TSoftClassPtr &Other) const
 
UClassGet () const
 
UE_FORCEINLINE_HINT UClassoperator* () const
 
UE_FORCEINLINE_HINT UClassoperator-> () const
 
UE_FORCEINLINE_HINT bool IsValid () const
 
UE_FORCEINLINE_HINT bool IsPending () const
 
UE_FORCEINLINE_HINT bool IsNull () const
 
UE_FORCEINLINE_HINT const FSoftObjectPathGetUniqueID () const
 
UE_FORCEINLINE_HINT const FSoftObjectPathToSoftObjectPath () const
 
UE_FORCEINLINE_HINT FString ToString () const
 
UE_FORCEINLINE_HINT FString GetLongPackageName () const
 
UE_FORCEINLINE_HINT FName GetLongPackageFName () const
 
UE_FORCEINLINE_HINT FString GetAssetName () const
 
UE_FORCEINLINE_HINT operator bool () const
 
UE_FORCEINLINE_HINT uint32 GetPtrTypeHash () const
 
UClassLoadSynchronous () const
 
int32 LoadAsync (FLoadSoftObjectPathAsyncDelegate InCompletionDelegate, FLoadAssetAsyncOptionalParams InOptionalParams=FLoadAssetAsyncOptionalParams()) const
 
void Serialize (FArchive &Ar)
 

Friends

template<class TClassA >
class TSoftClassPtr
 

Detailed Description

template<class TClass = UObject>
class TSoftClassPtr< TClass >

TSoftClassPtr is a templatized wrapper around FSoftObjectPtr that works like a TSubclassOf, it can be used in UProperties for blueprint subclasses

Member Typedef Documentation

◆ ElementType

template<class TClass = UObject>
using TSoftClassPtr< TClass >::ElementType = TClass

Constructor & Destructor Documentation

◆ TSoftClassPtr() [1/6]

template<class TClass = UObject>
UE_FORCEINLINE_HINT TSoftClassPtr< TClass >::TSoftClassPtr ( )
default

◆ TSoftClassPtr() [2/6]

template<class TClass = UObject>
UE_FORCEINLINE_HINT TSoftClassPtr< TClass >::TSoftClassPtr ( const TSoftClassPtr< TClass > &  Other)
default

◆ TSoftClassPtr() [3/6]

template<class TClass = UObject>
UE_FORCEINLINE_HINT TSoftClassPtr< TClass >::TSoftClassPtr ( TSoftClassPtr< TClass > &&  Other)
default

◆ ~TSoftClassPtr()

template<class TClass = UObject>
UE_FORCEINLINE_HINT TSoftClassPtr< TClass >::~TSoftClassPtr ( )
default

◆ TSoftClassPtr() [4/6]

template<class TClass = UObject>
template<class TClassA >
UE_FORCEINLINE_HINT TSoftClassPtr< TClass >::TSoftClassPtr ( const TSoftClassPtr< TClassA > &  Other)
inline

Construct from another soft pointer

◆ TSoftClassPtr() [5/6]

template<class TClass = UObject>
UE_FORCEINLINE_HINT TSoftClassPtr< TClass >::TSoftClassPtr ( const UClass From)
inline

Construct from a class already in memory

◆ TSoftClassPtr() [6/6]

template<class TClass = UObject>
UE_FORCEINLINE_HINT TSoftClassPtr< TClass >::TSoftClassPtr ( const FSoftObjectPath ObjectPath)
inlineexplicit

Construct from a soft object path

Member Function Documentation

◆ Get()

template<class TClass = UObject>
UClass * TSoftClassPtr< TClass >::Get ( ) const
inline

Dereference the soft pointer

Returns
nullptr if this object is gone or the soft pointer was null, otherwise a valid UClass pointer

◆ GetAssetName()

template<class TClass = UObject>
UE_FORCEINLINE_HINT FString TSoftClassPtr< TClass >::GetAssetName ( ) const
inline

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

◆ GetLongPackageFName()

template<class TClass = UObject>
UE_FORCEINLINE_HINT FName TSoftClassPtr< TClass >::GetLongPackageFName ( ) const
inline

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

◆ GetLongPackageName()

template<class TClass = UObject>
UE_FORCEINLINE_HINT FString TSoftClassPtr< TClass >::GetLongPackageName ( ) const
inline

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

◆ GetPtrTypeHash()

template<class TClass = UObject>
UE_FORCEINLINE_HINT uint32 TSoftClassPtr< TClass >::GetPtrTypeHash ( ) const
inline

Hash function

◆ GetUniqueID()

template<class TClass = UObject>
UE_FORCEINLINE_HINT const FSoftObjectPath & TSoftClassPtr< TClass >::GetUniqueID ( ) const
inline

Returns the StringObjectPath that is wrapped by this SoftObjectPtr

◆ IsNull()

template<class TClass = UObject>
UE_FORCEINLINE_HINT bool TSoftClassPtr< TClass >::IsNull ( ) const
inline

Test if this can never point to a live UObject

Returns
true if this is explicitly pointing to no object

◆ IsPending()

template<class TClass = UObject>
UE_FORCEINLINE_HINT bool TSoftClassPtr< TClass >::IsPending ( ) const
inline

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

Returns
true if this does not point to a real object, but could possibly

◆ IsValid()

template<class TClass = UObject>
UE_FORCEINLINE_HINT bool TSoftClassPtr< TClass >::IsValid ( ) const
inline

Test if this points to a live UObject

Returns
true if Get() would return a valid non-null pointer

◆ LoadAsync()

template<class TClass = UObject>
int32 TSoftClassPtr< TClass >::LoadAsync ( FLoadSoftObjectPathAsyncDelegate  InCompletionDelegate,
FLoadAssetAsyncOptionalParams  InOptionalParams = FLoadAssetAsyncOptionalParams() 
) const
inline

Attempts to asynchronously load the object referenced by this soft pointer. This is a wrapper around the LoadAsync function in SoftObjectPath, and the delegate is responsible for validating it loaded the correct type

Parameters
InCompletionDelegateDelegate to be invoked when the async load finishes, this will execute on the game thread as soon as the load succeeds or fails
InOptionalParamsOptional parameters for async loading the asset
Returns
Unique ID associated with this load request (the same object or package can be associated with multiple IDs).

◆ LoadSynchronous()

template<class TClass = UObject>
UClass * TSoftClassPtr< TClass >::LoadSynchronous ( ) const
inline

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

◆ operator bool()

template<class TClass = UObject>
UE_FORCEINLINE_HINT TSoftClassPtr< TClass >::operator bool ( ) const
inlineexplicit

Dereference soft pointer to see if it points somewhere valid

◆ operator!=()

template<class TClass = UObject>
UE_FORCEINLINE_HINT bool TSoftClassPtr< TClass >::operator!= ( const TSoftClassPtr< TClass > &  Other) const
inline

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

Parameters
Othersoft pointer to compare to

◆ operator*()

template<class TClass = UObject>
UE_FORCEINLINE_HINT UClass & TSoftClassPtr< TClass >::operator* ( ) const
inline

Dereference the soft pointer

◆ operator->()

template<class TClass = UObject>
UE_FORCEINLINE_HINT UClass * TSoftClassPtr< TClass >::operator-> ( ) const
inline

Dereference the soft pointer

◆ operator=() [1/6]

template<class TClass = UObject>
UE_FORCEINLINE_HINT void TSoftClassPtr< TClass >::operator= ( const FSoftObjectPath ObjectPath)
inline

Copy from a soft object path

◆ operator=() [2/6]

template<class TClass = UObject>
UE_FORCEINLINE_HINT TSoftClassPtr & TSoftClassPtr< TClass >::operator= ( const TSoftClassPtr< TClass > &  Other)
default

◆ operator=() [3/6]

template<class TClass = UObject>
template<class TClassA >
TSoftClassPtr & TSoftClassPtr< TClass >::operator= ( const TSoftObjectPtr< TClassA > &  Other)
inline

Copy from another soft pointer

◆ operator=() [4/6]

template<class TClass = UObject>
template<class TClassA >
TSoftClassPtr & TSoftClassPtr< TClass >::operator= ( const TWeakObjectPtr< TClassA > &  Other)
inline

Copy from a weak pointer already in memory

◆ operator=() [5/6]

template<class TClass = UObject>
UE_FORCEINLINE_HINT void TSoftClassPtr< TClass >::operator= ( const UClass From)
inline

Copy from a class already in memory

◆ operator=() [6/6]

template<class TClass = UObject>
UE_FORCEINLINE_HINT TSoftClassPtr & TSoftClassPtr< TClass >::operator= ( TSoftClassPtr< TClass > &&  Other)
default

◆ operator==()

template<class TClass = UObject>
UE_FORCEINLINE_HINT bool TSoftClassPtr< TClass >::operator== ( const TSoftClassPtr< TClass > &  Other) const
inline

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

Parameters
Othersoft pointer to compare to

◆ Reset()

template<class TClass = UObject>
UE_FORCEINLINE_HINT void TSoftClassPtr< TClass >::Reset ( )
inline

Reset the soft pointer back to the null state

◆ ResetWeakPtr()

template<class TClass = UObject>
UE_FORCEINLINE_HINT void TSoftClassPtr< TClass >::ResetWeakPtr ( )
inline

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

◆ Serialize()

template<class TClass = UObject>
void TSoftClassPtr< TClass >::Serialize ( FArchive Ar)
inline

◆ ToSoftObjectPath()

template<class TClass = UObject>
UE_FORCEINLINE_HINT const FSoftObjectPath & TSoftClassPtr< TClass >::ToSoftObjectPath ( ) const
inline

Returns the StringObjectPath that is wrapped by this SoftObjectPtr

◆ ToString()

template<class TClass = UObject>
UE_FORCEINLINE_HINT FString TSoftClassPtr< TClass >::ToString ( ) const
inline

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

Friends And Related Symbol Documentation

◆ TSoftClassPtr

template<class TClass = UObject>
template<class TClassA >
friend class TSoftClassPtr
friend

The documentation for this class was generated from the following file: