FStreamableHandle

A handle to a synchronous or async load.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

TSharedFromThis

FStreamableHandle

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Engine/StreamableManager.h

Include

#include "Engine/StreamableManager.h"

Syntax

struct FStreamableHandle : public TSharedFromThis< FStreamableHandle >

Remarks

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

Constructors

Name Description

Public function

FStreamableHandle

(
    const FStreamableHandle&
)

Not safe to copy or duplicate

Destructors

Name Description

Public function

~FStreamableHandle()

Destructor

Functions

Name Description

Public function

void

 

AddContextData

(
    const TSharedPtr< T >& NewData
)

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

Public function

bool

 

BindCancelDelegate

(
    FStreamableDelegate NewDelegate
)

Bind delegate that is called if handle is canceled, only works if loading is in progress.

Public function

bool

 

BindCompleteDelegate

(
    FStreamableDelegate NewDelegate
)

Bind delegate that is called when load completes, only works if loading is in progress.

Public function

bool

 

BindUpdateDelegate

(
    FStreamableUpdateDelegate NewDelega...
)

Bind delegate that is called periodically as delegate updates, only works if loading is in progress.

Public function

void

 

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

Public function

TSharedPtr< ...

 

CreateCombinedHandle

(
    const TConstArrayView< TSharedPtr< ...
)

Creates a new merged handle which contains this handle as well as any external handles.

Public function Static

void

 

ExecuteDelegate

(
    const FStreamableDelegate& Delegat...,
    TSharedPtr< FStreamableHandle > Ass...,
    const FStreamableDelegate& CancelD...
)

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

Public function Const

TSharedPtr< ...

 

FindFirstContextDataOfType()

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

Public function Const

TSharedPtr< ...

 

FindMatchingHandle

(
    TFunction< bool...
)

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

Public function

T &

 

FindOrAddContextData()

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

Public function Const

TArray< TSha...

 

GetContextDataOfType()

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

Public function Const

const FStrin...

 

GetDebugName()

Returns the debug name for this handle.

Public function Const

UObject *...

 

GetLoadedAsset()

Returns first asset in requested asset list, if it's been successfully loaded.

Public function Const

void

 

GetLoadedAssets

(
    TArray< UObject* >& LoadedAss...
)

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

Public function Const

void

 

GetLoadedCount

(
    int32& LoadedCount,
    int32& RequestedCount
)

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

Public function

TSharedPtr< ...

 

GetOutermostHandle()

Crawls out to the outermost handle and returns it.

Public function Const

FStreamableM...

 

GetOwningManager()

Get the StreamableManager for this handle

Public function Const

TAsyncLoadPr...

 

GetPriority()

Returns the streaming priority.

Public function Const

float

 

GetProgress()

Returns progress as a value between 0.0 and 1.0.

Public function Const

void

 

GetRequestedAssets

(
    TArray< FSoftObjectPath >& AssetLi...,
    bool bIncludeChildren
)

Gets list of assets references this load was started with.

Public function Const

bool

 

HasCancelDelegate()

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

Public function Const

bool

 

HasCompleteDelegate()

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

Public function Const

bool

 

HasLoadCompleted()

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

Public function Const

bool

 

HasLoadCompletedOrStalled()

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

Public function Const

bool

 

HasUpdateDelegate()

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

Public function Const

bool

 

IsActive()

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

Public function Const

bool

 

IsCombinedHandle()

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

Public function Const

bool

 

IsLoadingInProgress()

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

Public function Const

bool

 

IsStalled()

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

Public function

void

 

ReleaseHandle()

Release this handle.

Public function

void

 

SetDebugNameIfEmptyOrDefault

(
    const FString& NewName
)

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

Public function

void

 

StartStalledHandle()

Tells a stalled handle to start its actual request.

Public function

EAsyncPackag...

 

WaitUntilComplete

(
    float Timeout,
    bool bStartStalledHandles
)

Blocks until the requested assets have loaded.

Public function Const

bool

 

WasCanceled()

If this request was cancelled.

Operators

Name Description

Public function

FStreamableH...

 

operator=

(
    const FStreamableHandle&
)

Constants