UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FStreamableHandle Struct Reference

#include <StreamableManager.h>

+ Inheritance diagram for FStreamableHandle:

Public Member Functions

bool HasLoadCompleted () const
 
bool WasCanceled () const
 
bool IsLoadingInProgress () const
 
bool IsActive () const
 
bool IsStalled () const
 
bool IsCombinedHandle () const
 
bool HasError () const
 
const TOptional< UE::UnifiedError::FError > & GetError () const
 
FStreamableDownloadCachePin GetDownloadCachePin () const
 
TArray< FStreamableDownloadCachePinGetDownloadCachePins () const
 
ENGINE_API bool HasLoadCompletedOrStalled () const
 
ENGINE_API void SetDebugNameIfEmptyOrDefault (const FString &NewName)
 
const FString & GetDebugName () const
 
TAsyncLoadPriority GetPriority () const
 
ENGINE_API TOptional< FStreamableDownloadPriorityGetDownloadPriority () const
 
ENGINE_API bool SetDownloadPriority (FStreamableDownloadPriority Priority)
 
ENGINE_API void ReleaseHandle ()
 
ENGINE_API void CancelHandle ()
 
ENGINE_API void StartStalledHandle ()
 
ENGINE_API bool HasCompleteDelegate () const
 
ENGINE_API bool HasCancelDelegate () const
 
ENGINE_API bool HasUpdateDelegate () const
 
ENGINE_API bool BindCompleteDelegate (FStreamableDelegateWithHandle NewDelegate)
 
ENGINE_API bool BindCompleteDelegate (FStreamableDelegate NewDelegate)
 
ENGINE_API bool BindCancelDelegate (FStreamableDelegateWithHandle NewDelegate)
 
ENGINE_API bool BindCancelDelegate (FStreamableDelegate NewDelegate)
 
ENGINE_API bool BindUpdateDelegate (FStreamableUpdateDelegate NewDelegate)
 
ENGINE_API EAsyncPackageState::Type WaitUntilComplete (float Timeout=0.0f, bool bStartStalledHandles=true)
 
ENGINE_API void GetRequestedAssets (TArray< FSoftObjectPath > &AssetList, bool bIncludeChildren=true) const
 
ENGINE_API void GetLoadedAssets (TArray< UObject * > &LoadedAssets) const
 
template<class T >
void GetLoadedAssets (TArray< T * > &LoadedAssets) const
 
ENGINE_API UObjectGetLoadedAsset () const
 
template<class T >
T * GetLoadedAsset () const
 
ENGINE_API void GetLoadedCount (int32 &LoadedCount, int32 &RequestedCount) const
 
template<typename CallableT >
void ForEachLoadedAsset (CallableT Callable) const
 
ENGINE_API float GetProgress (EStreamableProgressType Type=EStreamableProgressType::Load) const
 
float GetLoadProgress () const
 
float GetRelativeDownloadProgress () const
 
float GetAbsoluteDownloadProgress () const
 
ENGINE_API struct FStreamableManagerGetOwningManager () const
 
ENGINE_API TSharedPtr< FStreamableHandleFindMatchingHandle (TFunction< bool(const FStreamableHandle &)> Predicate) const
 
ENGINE_API TSharedPtr< FStreamableHandleCreateCombinedHandle (const TConstArrayView< TSharedPtr< FStreamableHandle > > &OtherHandles)
 
ENGINE_API TSharedPtr< FStreamableHandleGetOutermostHandle ()
 
template<typename T >
T & FindOrAddContextData ()
 
template<typename T >
void AddContextData (const TSharedPtr< T > &NewData)
 
template<typename T >
TSharedPtr< T > FindFirstContextDataOfType () const
 
template<typename T >
TArray< TSharedPtr< T > > GetContextDataOfType () const
 
 FStreamableHandle (FPrivateToken, UE::FSourceLocation &&InLocation)
 
ENGINE_API ~FStreamableHandle ()
 
 FStreamableHandle (const FStreamableHandle &)=delete
 
FStreamableHandleoperator= (const FStreamableHandle &)=delete
 
- Public Member Functions inherited from TSharedFromThis< FStreamableHandle >
TSharedRef< FStreamableHandle, Mode > AsShared ()
 
TSharedRef< FStreamableHandle const, Mode > AsShared () const
 
TSharedRef< SubobjectType, Mode > AsSharedSubobject (SubobjectType *SubobjectPtr) const
 
TWeakPtr< FStreamableHandle, Mode > AsWeak ()
 
TWeakPtr< FStreamableHandle const, Mode > AsWeak () const
 
TWeakPtr< SubobjectType, Mode > AsWeakSubobject (SubobjectType *SubobjectPtr) const
 
void UpdateWeakReferenceInternal (TSharedPtr< SharedPtrType, SharedPtrMode > const *InSharedPtr, OtherType *InObject) const
 
void UpdateWeakReferenceInternal (TSharedRef< SharedRefType, SharedPtrMode > const *InSharedRef, OtherType *InObject) const
 
UE_FORCEINLINE_HINT bool DoesSharedInstanceExist () const
 

Static Public Member Functions

static ENGINE_API void ExecuteDelegate (const FStreamableDelegateWithHandle &Delegate, TSharedPtr< FStreamableHandle > AssociatedHandle=nullptr, const FStreamableDelegateWithHandle &CancelDelegate=FStreamableDelegateWithHandle())
 
static ENGINE_API void ExecuteDelegate (FStreamableDelegateWithHandle &&Delegate, TSharedPtr< FStreamableHandle > AssociatedHandle=nullptr, FStreamableDelegateWithHandle &&CancelDelegate=FStreamableDelegateWithHandle())
 
static ENGINE_API void ExecuteDelegate (const FStreamableDelegate &Delegate, TSharedPtr< FStreamableHandle > AssociatedHandle=nullptr, const FStreamableDelegate &CancelDelegate=FStreamableDelegate())
 
static ENGINE_API void ExecuteDelegate (FStreamableDelegate &&Delegate, TSharedPtr< FStreamableHandle > AssociatedHandle=nullptr, FStreamableDelegate &&CancelDelegate=FStreamableDelegate())
 

Static Public Attributes

static ENGINE_API const FString HandleDebugName_Preloading = FString(TEXT("Preloading"))
 
static ENGINE_API const FString HandleDebugName_AssetList = FString(TEXT("LoadAssetList"))
 
static ENGINE_API const FString HandleDebugName_CombinedHandle = FString(TEXT("CreateCombinedHandle"))
 
static ENGINE_API const FString HandleDebugName_Error = FString(TEXT("CreateErrorHandle"))
 

Friends

struct FStreamableManager
 
struct FStreamable
 
struct UE::StreamableManager::Private::FDownloadContext
 

Additional Inherited Members

- Protected Member Functions inherited from TSharedFromThis< FStreamableHandle >
 TSharedFromThis ()
 
 TSharedFromThis (TSharedFromThis const &)
 
UE_FORCEINLINE_HINT TSharedFromThisoperator= (TSharedFromThis const &)
 
 ~TSharedFromThis ()
 
- Static Protected Member Functions inherited from TSharedFromThis< FStreamableHandle >
static UE_FORCEINLINE_HINT TSharedRef< OtherType, Mode > SharedThis (OtherType *ThisPtr)
 
static UE_FORCEINLINE_HINT TSharedRef< OtherType const, Mode > SharedThis (const OtherType *ThisPtr)
 

Detailed Description

A handle to a synchronous or async load. As long as the handle is Active, loaded assets will stay in memory

Constructor & Destructor Documentation

◆ FStreamableHandle() [1/2]

FStreamableHandle::FStreamableHandle ( FPrivateToken  ,
UE::FSourceLocation &&  InLocation 
)
explicit

◆ ~FStreamableHandle()

FStreamableHandle::~FStreamableHandle ( )

Destructor

◆ FStreamableHandle() [2/2]

FStreamableHandle::FStreamableHandle ( const FStreamableHandle )
delete

Not safe to copy or duplicate

Member Function Documentation

◆ AddContextData()

template<typename T >
void FStreamableHandle::AddContextData ( const TSharedPtr< T > &  NewData)
inline

Unconditionally adds a contextual data struct to this handle. Uniqueness is not enforced.

See also
FindFirstContextDataOfType

◆ BindCancelDelegate() [1/2]

bool FStreamableHandle::BindCancelDelegate ( FStreamableDelegate  NewDelegate)

◆ BindCancelDelegate() [2/2]

bool FStreamableHandle::BindCancelDelegate ( FStreamableDelegateWithHandle  NewDelegate)

Bind delegate that is called if handle is canceled, only works if loading is in progress. This will overwrite any already bound delegate!

◆ BindCompleteDelegate() [1/2]

bool FStreamableHandle::BindCompleteDelegate ( FStreamableDelegate  NewDelegate)

◆ BindCompleteDelegate() [2/2]

bool FStreamableHandle::BindCompleteDelegate ( FStreamableDelegateWithHandle  NewDelegate)

Bind delegate that is called when load completes, only works if loading is in progress. This will overwrite any already bound delegate!

◆ BindUpdateDelegate()

bool FStreamableHandle::BindUpdateDelegate ( FStreamableUpdateDelegate  NewDelegate)

Bind delegate that is called periodically as request updates, only works if loading is in progress. This will overwrite any already bound delegate!

◆ CancelHandle()

void FStreamableHandle::CancelHandle ( )

Cancel a request, callable from within the manager or externally This will immediately release the handle even if it is still in progress, and call the cancel callback if bound This stops the completion callback from happening, even if it is in the delayed callback queue

◆ CreateCombinedHandle()

TSharedPtr< FStreamableHandle > FStreamableHandle::CreateCombinedHandle ( const TConstArrayView< TSharedPtr< FStreamableHandle > > &  OtherHandles)

Creates a new merged handle which contains this handle as well as any external handles. No delegates are moved, and the new handle is returned for convenience. Parent handles no longer directly track this, but will be correctly linked with the newly merged handle (and this handle is a child of the merged hande).

Parameters
OtherHandlesContainer of handles which should be merged with this handle
Returns
Either the new merged handle or nullptr when merging isn't feasible

◆ ExecuteDelegate() [1/4]

void FStreamableHandle::ExecuteDelegate ( const FStreamableDelegate Delegate,
TSharedPtr< FStreamableHandle AssociatedHandle = nullptr,
const FStreamableDelegate CancelDelegate = FStreamableDelegate() 
)
static

Calls a StreamableDelegate, this will add to the delayed callback queue depending on s.StreamableDelegateDelayFrames

Parameters
DelegatePrimary delegate to execute
AssociatedHandleStreamable handle associated with this delegate, may be null
CancelDelegateIf handle gets cancelled before primary delegate executes, this delegate will be called instead

◆ ExecuteDelegate() [2/4]

void FStreamableHandle::ExecuteDelegate ( const FStreamableDelegateWithHandle Delegate,
TSharedPtr< FStreamableHandle AssociatedHandle = nullptr,
const FStreamableDelegateWithHandle CancelDelegate = FStreamableDelegateWithHandle() 
)
static

Calls a StreamableDelegate, this will add to the delayed callback queue depending on s.StreamableDelegateDelayFrames

Parameters
DelegatePrimary delegate to execute
AssociatedHandleStreamable handle associated with this delegate, may be null
CancelDelegateIf handle gets cancelled before primary delegate executes, this delegate will be called instead

◆ ExecuteDelegate() [3/4]

void FStreamableHandle::ExecuteDelegate ( FStreamableDelegate &&  Delegate,
TSharedPtr< FStreamableHandle AssociatedHandle = nullptr,
FStreamableDelegate &&  CancelDelegate = FStreamableDelegate() 
)
static

Overload taking the Delegate by rvalue. Using this will prevent any copies of FStreamableDelegate from being made if the callback is deferred.

◆ ExecuteDelegate() [4/4]

void FStreamableHandle::ExecuteDelegate ( FStreamableDelegateWithHandle &&  Delegate,
TSharedPtr< FStreamableHandle AssociatedHandle = nullptr,
FStreamableDelegateWithHandle &&  CancelDelegate = FStreamableDelegateWithHandle() 
)
static

Overload taking the Delegate by rvalue. Using this will prevent any copies of FStreamableDelegate from being made if the callback is deferred.

◆ FindFirstContextDataOfType()

template<typename T >
TSharedPtr< T > FStreamableHandle::FindFirstContextDataOfType ( ) const
inline

Finds the first instance of a contextual data struct which is attached to this handle.

Returns
Either nullptr, or TSharedPtr to the first instance of a T on this handle.
See also
AddContextData

◆ FindMatchingHandle()

TSharedPtr< FStreamableHandle > FStreamableHandle::FindMatchingHandle ( TFunction< bool(const FStreamableHandle &)>  Predicate) const

Return a TSharedPtr of the first handle among this and descendants which satisfies the predicate.

Parameters
PredicateConditional applied to each candidate handle
Returns
Either the first matching handle, or nullptr
See also
GetOutermostHandle

◆ FindOrAddContextData()

template<typename T >
T & FStreamableHandle::FindOrAddContextData ( )
inline

Gives you a mutable reference to a contextual data struct of the specified type.

Returns
Either a newly constructed T, or one which was previously added to this handle.

◆ ForEachLoadedAsset()

template<typename CallableT >
void FStreamableHandle::ForEachLoadedAsset ( CallableT  Callable) const

Invokes a callable for each loaded asset if load has succeeded. Some entries will be null if loading failed

Parameters
CallableCallable object

◆ GetAbsoluteDownloadProgress()

float FStreamableHandle::GetAbsoluteDownloadProgress ( ) const
inline

Returns progress as a value between 0.0 and 1.0 representing the total percentage of installed packages for the request.

◆ GetContextDataOfType()

template<typename T >
TArray< TSharedPtr< T > > FStreamableHandle::GetContextDataOfType ( ) const
inline

Finds all instances of a contextual data struct which are attached to this handle

Returns
Array filled with all instances of T currently attached to this handle

◆ GetDebugName()

const FString & FStreamableHandle::GetDebugName ( ) const
inline

Returns the debug name for this handle.

◆ GetDownloadCachePin()

FStreamableDownloadCachePin FStreamableHandle::GetDownloadCachePin ( ) const
inline

Get download cache pin for this handle

◆ GetDownloadCachePins()

TArray< FStreamableDownloadCachePin > FStreamableHandle::GetDownloadCachePins ( ) const

Get download cache pins for this handle and all childern

◆ GetDownloadPriority()

TOptional< FStreamableDownloadPriority > FStreamableHandle::GetDownloadPriority ( ) const

Returns download priority. Only valid if a download has been requested and is not yet complete.

◆ GetError()

const TOptional< UE::UnifiedError::FError > & FStreamableHandle::GetError ( ) const
inline

Get error details

◆ GetLoadedAsset() [1/2]

UObject * FStreamableHandle::GetLoadedAsset ( ) const

Returns first asset in requested asset list, if it's been successfully loaded. This will fail if the asset failed to load

◆ GetLoadedAsset() [2/2]

template<class T >
T * FStreamableHandle::GetLoadedAsset ( ) const
inline

Templated version of above

◆ GetLoadedAssets() [1/2]

template<class T >
void FStreamableHandle::GetLoadedAssets ( TArray< T * > &  LoadedAssets) const
inline

Templated version of above. Entries that fail to cast will also be null.

◆ GetLoadedAssets() [2/2]

void FStreamableHandle::GetLoadedAssets ( TArray< UObject * > &  LoadedAssets) const

Adds all loaded assets if load has succeeded. Some entries will be null if loading failed

◆ GetLoadedCount()

void FStreamableHandle::GetLoadedCount ( int32 LoadedCount,
int32 RequestedCount 
) const

Returns number of assets that have completed loading out of initial list, failed loads will count as loaded

◆ GetLoadProgress()

float FStreamableHandle::GetLoadProgress ( ) const
inline

Returns progress as a value between 0.0 and 1.0.

◆ GetOutermostHandle()

TSharedPtr< FStreamableHandle > FStreamableHandle::GetOutermostHandle ( )

Crawls out to the outermost handle and returns it. Since we could have multiple Parent handles, we might have a tie. In cases of a tie, the eldest parent handle (so, lower indices) will win.

Returns
The single parent which is the most outer, or this if no Parent Handle

◆ GetOwningManager()

FStreamableManager * FStreamableHandle::GetOwningManager ( ) const

Get the StreamableManager for this handle

◆ GetPriority()

TAsyncLoadPriority FStreamableHandle::GetPriority ( ) const
inline

Returns the streaming priority.

◆ GetProgress()

float FStreamableHandle::GetProgress ( EStreamableProgressType  Type = EStreamableProgressType::Load) const

Returns progress as a value between 0.0 and 1.0.

◆ GetRelativeDownloadProgress()

float FStreamableHandle::GetRelativeDownloadProgress ( ) const
inline

Returns progress as a value between 0.0 and 1.0 representing progress of downloading packages that were not installed when the request was issued.

◆ GetRequestedAssets()

void FStreamableHandle::GetRequestedAssets ( TArray< FSoftObjectPath > &  AssetList,
bool  bIncludeChildren = true 
) const

Gets list of assets references this load was started with. This will be the paths before redirectors, and not all of these are guaranteed to be loaded

Parameters
AssetListOutput array for requested assets. Array is Reset before adding values.
bIncludeChildrenWhether the child handles should be included in the search.

◆ HasCancelDelegate()

bool FStreamableHandle::HasCancelDelegate ( ) const

Check to see whether or not the Cancel delegate is bound; useful for doing extra work before/without stomping the existing delegate.

◆ HasCompleteDelegate()

bool FStreamableHandle::HasCompleteDelegate ( ) const

Check to see whether or not the Complete delegate is bound; useful for doing extra work before/without stomping the existing delegate.

◆ HasError()

bool FStreamableHandle::HasError ( ) const
inline

True if an error occured

◆ HasLoadCompleted()

bool FStreamableHandle::HasLoadCompleted ( ) const
inline

If this request has finished loading, meaning all available assets were loaded Any assets that failed to load will still be null This can be true before the completion callback has happened as it may be in the delayed callback queue

◆ HasLoadCompletedOrStalled()

bool FStreamableHandle::HasLoadCompletedOrStalled ( ) const

Returns true if we've done all the loading we can now, ie all handles are either completed or stalled

◆ HasUpdateDelegate()

bool FStreamableHandle::HasUpdateDelegate ( ) const

Check to see whether or not the Update delegate is bound; useful for doing extra work before/without stomping the existing delegate.

◆ IsActive()

bool FStreamableHandle::IsActive ( ) const
inline

If this handle is still active, meaning it wasn't canceled or released

◆ IsCombinedHandle()

bool FStreamableHandle::IsCombinedHandle ( ) const
inline

Returns true if this is a combined handle that depends on child handles.

◆ IsLoadingInProgress()

bool FStreamableHandle::IsLoadingInProgress ( ) const
inline

True if load is still ongoing and we haven't been cancelled

◆ IsStalled()

bool FStreamableHandle::IsStalled ( ) const
inline

If this handle is stalled and waiting for another event to occur before it is actually requested

◆ operator=()

FStreamableHandle & FStreamableHandle::operator= ( const FStreamableHandle )
delete

◆ ReleaseHandle()

void FStreamableHandle::ReleaseHandle ( )

Release this handle. This can be called from normal gameplay code to indicate that the loaded assets are no longer needed This will be called implicitly if all shared pointers to this handle are destroyed If called before the completion delegate, the release will be delayed until after completion

◆ SetDebugNameIfEmptyOrDefault()

void FStreamableHandle::SetDebugNameIfEmptyOrDefault ( const FString &  NewName)

Allows user code to provide a more detailed name in the cases where a name is autogenerated or otherwise default.

◆ SetDownloadPriority()

bool FStreamableHandle::SetDownloadPriority ( FStreamableDownloadPriority  Priority)

Set download priority. Only valid if a download has been requested and is not yet complete.

Returns
true if the priority could be set.

◆ StartStalledHandle()

void FStreamableHandle::StartStalledHandle ( )

Tells a stalled handle to start its actual request.

◆ WaitUntilComplete()

EAsyncPackageState::Type FStreamableHandle::WaitUntilComplete ( float  Timeout = 0.0f,
bool  bStartStalledHandles = true 
)

Blocks until the requested assets have loaded. This pushes the requested asset to the top of the priority list, but does not flush all async loading, usually resulting in faster completion than a LoadObject call

Parameters
TimeoutMaximum time to wait, if this is 0 it will wait forever
StartStalledHandlesIf true it will force all handles waiting on external resources to try and load right now

◆ WasCanceled()

bool FStreamableHandle::WasCanceled ( ) const
inline

If this request was cancelled. Assets may still have been loaded, but completion delegate was not called

Friends And Related Symbol Documentation

◆ FStreamable

◆ FStreamableManager

◆ UE::StreamableManager::Private::FDownloadContext

Member Data Documentation

◆ HandleDebugName_AssetList

const FString FStreamableHandle::HandleDebugName_AssetList = FString(TEXT("LoadAssetList"))
static

◆ HandleDebugName_CombinedHandle

const FString FStreamableHandle::HandleDebugName_CombinedHandle = FString(TEXT("CreateCombinedHandle"))
static

◆ HandleDebugName_Error

const FString FStreamableHandle::HandleDebugName_Error = FString(TEXT("CreateErrorHandle"))
static

◆ HandleDebugName_Preloading

const FString FStreamableHandle::HandleDebugName_Preloading = FString(TEXT("Preloading"))
static

The documentation for this struct was generated from the following files: