Navigation
API > API/Runtime > API/Runtime/Engine
A handle to a synchronous or async load. As long as the handle is Active, loaded assets will stay in memory
| Name | FStreamableHandle |
| Type | struct |
| Header File | /Engine/Source/Runtime/Engine/Classes/Engine/StreamableManager.h |
| Include Path | #include "Engine/StreamableManager.h" |
Syntax
struct FStreamableHandle : public TSharedFromThis< FStreamableHandle >
Inheritance Hierarchy
- FSharedFromThisBase → TSharedFromThis → FStreamableHandle
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FStreamableHandle
(
FPrivateToken, |
Engine/StreamableManager.h | ||
FStreamableHandle
(
const FStreamableHandle& |
Not safe to copy or duplicate | Engine/StreamableManager.h | |
| Engine/StreamableManager.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FStreamableHandle() |
Destructor | Engine/StreamableManager.h |
Structs
| Name | Remarks |
|---|---|
| FPrivateToken | Constructor is private, but this allows use by MakeShared |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| HandleDebugName_AssetList | const FString | Engine/StreamableManager.h | |
| HandleDebugName_CombinedHandle | const FString | Engine/StreamableManager.h | |
| HandleDebugName_Error | const FString | Engine/StreamableManager.h | |
| HandleDebugName_Preloading | const FString | Engine/StreamableManager.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AdditionalContextData | TArray< TSharedPtr< FStreamableHandleContextDataBase > > | Array of contextual data added by game/engine code | Engine/StreamableManager.h | |
| bCanceled | bool | True if this request was explicitly canceled, which stops it from calling the completion delegate and immediately releases it | Engine/StreamableManager.h | |
| bIsCombinedHandle | bool | If true, this is a combined handle that depends on child handles. | Engine/StreamableManager.h | |
| bLoadCompleted | bool | True if this request has finished loading. It may still be active, or it may have been released | Engine/StreamableManager.h | |
| bLoadStarted | bool | True if this request ever started loading from disk. | Engine/StreamableManager.h | |
| bReleased | bool | True if this request was released, which will stop it from keeping hard GC references | Engine/StreamableManager.h | |
| bReleaseWhenLoaded | bool | If true, this handle will be released when it finishes loading | Engine/StreamableManager.h | |
| bStalled | bool | True if this handle has been created but not yet actually requested. | Engine/StreamableManager.h | |
| CancelDelegate | FStreamableDelegateWithHandle | Delegate to call when streaming is canceled | Engine/StreamableManager.h | |
| CanceledChildCount | int32 | How many of our children that have been canceled | Engine/StreamableManager.h | |
| ChildHandles | TArray< TSharedPtr< FStreamableHandle > > | List of handles this depends on, these will keep the child references alive | Engine/StreamableManager.h | |
| CompletedChildCount | int32 | How many of our children that have been completed | Engine/StreamableManager.h | |
| CompleteDelegate | FStreamableDelegateWithHandle | Delegate to call when streaming is completed | Engine/StreamableManager.h | |
| CookLoadType | ECookLoadType | Engine/StreamableManager.h | ||
| DebugName | FString | Name of this handle, passed in by caller to help in debugging | Engine/StreamableManager.h | |
| DownloadCachePin | FStreamableDownloadCachePin | Handle that holds packages in the download cache | Engine/StreamableManager.h | |
| DownloadContext | TUniquePtr< UE::StreamableManager::Private::FDownloadContext > | Download book-keeping, released when download finishes | Engine/StreamableManager.h | |
| Error | TOptional< UE::UnifiedError::FError > | Error details in case of an error | Engine/StreamableManager.h | |
| Location | UE::FSourceLocation | Holds a location where this asset list was requested from | Engine/StreamableManager.h | |
| OwningManager | FStreamableManager * | This is set at the time of creation, and will be cleared when request completes or is canceled | Engine/StreamableManager.h | |
| ParentHandles | TArray< TWeakPtr< FStreamableHandle > > | Backpointer to handles that depend on this | Engine/StreamableManager.h | |
| Priority | TAsyncLoadPriority | The async priority for this request | Engine/StreamableManager.h | |
| ReferencerPackage | FName | Engine/StreamableManager.h | ||
| ReferencerPackageOp | FName | Engine/StreamableManager.h | ||
| RequestedAssets | TArray< FSoftObjectPath > | List of assets that were referenced by this handle | Engine/StreamableManager.h | |
| StreamablesLoading | int32 | How many FStreamables is this waiting on to finish loading | Engine/StreamableManager.h | |
| UpdateDelegate | FStreamableUpdateDelegate | Called periodically during streaming to update progress UI | Engine/StreamableManager.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddContextData
(
const TSharedPtr< T >& NewData |
Unconditionally adds a contextual data struct to this handle. Uniqueness is not enforced. | Engine/StreamableManager.h | |
bool BindCancelDelegate
(
FStreamableDelegate NewDelegate |
Engine/StreamableManager.h | ||
bool BindCancelDelegate
(
FStreamableDelegateWithHandle NewDelegate |
Bind delegate that is called if handle is canceled, only works if loading is in progress. | Engine/StreamableManager.h | |
bool BindCompleteDelegate
(
FStreamableDelegate NewDelegate |
Engine/StreamableManager.h | ||
bool BindCompleteDelegate
(
FStreamableDelegateWithHandle NewDelegate |
Bind delegate that is called when load completes, only works if loading is in progress. | Engine/StreamableManager.h | |
bool BindUpdateDelegate
(
FStreamableUpdateDelegate NewDelegate |
Bind delegate that is called periodically as request updates, only works if loading is in progress. | Engine/StreamableManager.h | |
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 | Engine/StreamableManager.h | |
TSharedPtr< FStreamableHandle > CreateCombinedHandle
(
const TConstArrayView< TSharedPtr< FStreamableHandle > >& OtherHandles |
Creates a new merged handle which contains this handle as well as any external handles. | Engine/StreamableManager.h | |
TSharedPtr< T > FindFirstContextDataOfType () |
Finds the first instance of a contextual data struct which is attached to this handle. | Engine/StreamableManager.h | |
TSharedPtr< FStreamableHandle > FindMatchingHandle
(
TFunction< bool(const FStreamableHandle&)> Predicate |
Return a TSharedPtr of the first handle among this and descendants which satisfies the predicate. | Engine/StreamableManager.h | |
T & FindOrAddContextData() |
Gives you a mutable reference to a contextual data struct of the specified type. | Engine/StreamableManager.h | |
void ForEachLoadedAsset
(
CallableT Callable |
Invokes a callable for each loaded asset if load has succeeded. | Engine/StreamableManager.h | |
float GetAbsoluteDownloadProgress() |
Returns progress as a value between 0.0 and 1.0 representing the total percentage of installed packages for the request. | Engine/StreamableManager.h | |
TArray< TSharedPtr< T > > GetContextDataOfType() |
Finds all instances of a contextual data struct which are attached to this handle | Engine/StreamableManager.h | |
ECookLoadType GetCookLoadType() |
Engine/StreamableManager.h | ||
const FString & GetDebugName() |
Returns the debug name for this handle. | Engine/StreamableManager.h | |
FStreamableDownloadCachePin GetDownloadCachePin() |
Get download cache pin for this handle | Engine/StreamableManager.h | |
TArray< FStreamableDownloadCachePin > GetDownloadCachePins() |
Get download cache pins for this handle and all childern | Engine/StreamableManager.h | |
TOptional< FStreamableDownloadPriority > GetDownloadPriority() |
Returns download priority. Only valid if a download has been requested and is not yet complete. | Engine/StreamableManager.h | |
const TOptional< UE::UnifiedError::FError > & GetError() |
Get error details | Engine/StreamableManager.h | |
T * GetLoadedAsset () |
Templated version of above | Engine/StreamableManager.h | |
UObject * GetLoadedAsset () |
Returns first asset in requested asset list, if it's been successfully loaded. | Engine/StreamableManager.h | |
void GetLoadedAssets
(
TArray< UObject* >& LoadedAssets |
Adds all loaded assets if load has succeeded. Some entries will be null if loading failed | Engine/StreamableManager.h | |
void GetLoadedAssets
(
TArray< T* >& LoadedAssets |
Templated version of above. Entries that fail to cast will also be null. | Engine/StreamableManager.h | |
void GetLoadedCount
(
int32& LoadedCount, |
Returns number of assets that have completed loading out of initial list, failed loads will count as loaded | Engine/StreamableManager.h | |
float GetLoadProgress() |
Returns progress as a value between 0.0 and 1.0. | Engine/StreamableManager.h | |
| Crawls out to the outermost handle and returns it. | Engine/StreamableManager.h | ||
FStreamableManager * GetOwningManager() |
Get the StreamableManager for this handle | Engine/StreamableManager.h | |
TAsyncLoadPriority GetPriority() |
Returns the streaming priority. | Engine/StreamableManager.h | |
float GetProgress
(
EStreamableProgressType Type |
Returns progress as a value between 0.0 and 1.0. | Engine/StreamableManager.h | |
FName GetRefencerPackageOp() |
Engine/StreamableManager.h | ||
FName GetReferencerPackage() |
Engine/StreamableManager.h | ||
float GetRelativeDownloadProgress() |
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. | Engine/StreamableManager.h | |
void GetRequestedAssets
(
TArray< FSoftObjectPath >& AssetList, |
Gets list of assets references this load was started with. | Engine/StreamableManager.h | |
bool HasCancelDelegate() |
Check to see whether or not the Cancel delegate is bound; useful for doing extra work before/without stomping the existing delegate. | Engine/StreamableManager.h | |
bool HasCompleteDelegate() |
Check to see whether or not the Complete delegate is bound; useful for doing extra work before/without stomping the existing delegate. | Engine/StreamableManager.h | |
bool HasError() |
True if an error occured | Engine/StreamableManager.h | |
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 | Engine/StreamableManager.h | |
bool HasLoadCompletedOrStalled() |
Returns true if we've done all the loading we can now, ie all handles are either completed or stalled | Engine/StreamableManager.h | |
bool HasUpdateDelegate() |
Check to see whether or not the Update delegate is bound; useful for doing extra work before/without stomping the existing delegate. | Engine/StreamableManager.h | |
bool IsActive() |
If this handle is still active, meaning it wasn't canceled or released | Engine/StreamableManager.h | |
bool IsCombinedHandle() |
Returns true if this is a combined handle that depends on child handles. | Engine/StreamableManager.h | |
bool IsLoadingInProgress() |
True if load is still ongoing and we haven't been cancelled | Engine/StreamableManager.h | |
bool IsStalled() |
If this handle is stalled and waiting for another event to occur before it is actually requested | Engine/StreamableManager.h | |
void ReleaseHandle () |
Release this handle. | Engine/StreamableManager.h | |
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. | Engine/StreamableManager.h | |
bool SetDownloadPriority
(
FStreamableDownloadPriority Priority |
Set download priority. Only valid if a download has been requested and is not yet complete. | Engine/StreamableManager.h | |
void StartStalledHandle() |
Tells a stalled handle to start its actual request. | Engine/StreamableManager.h | |
EAsyncPackageState::Type WaitUntilComplete
(
float Timeout, |
Blocks until the requested assets have loaded. | Engine/StreamableManager.h | |
bool WasCanceled () |
If this request was cancelled. | Engine/StreamableManager.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void ExecuteDelegate
(
FStreamableDelegateWithHandle&& Delegate, |
Overload taking the Delegate by rvalue. | Engine/StreamableManager.h | |
static void ExecuteDelegate
(
const FStreamableDelegateWithHandle& Delegate, |
Calls a StreamableDelegate, this will add to the delayed callback queue depending on s.StreamableDelegateDelayFrames | Engine/StreamableManager.h | |
static void ExecuteDelegate
(
const FStreamableDelegate& Delegate, |
Calls a StreamableDelegate, this will add to the delayed callback queue depending on s.StreamableDelegateDelayFrames | Engine/StreamableManager.h | |
static void ExecuteDelegate
(
FStreamableDelegate&& Delegate, |
Overload taking the Delegate by rvalue. | Engine/StreamableManager.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FStreamableHandle & operator=
(
const FStreamableHandle& |
Engine/StreamableManager.h |