UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::AssetRegistry::Premade::FPreloader Class Reference

Public Types

enum class  EConsumeResult { Succeeded , Failed , Deferred }
 
using FConsumeFunction = TFunction< void(ELoadResult LoadResult, FAssetRegistryState &&ARState)>
 

Public Member Functions

 FPreloader ()
 
 ~FPreloader ()
 
bool Consume (FConsumeFunction &&ConsumeFunction)
 
EConsumeResult ConsumeOrDefer (FConsumeFunction &&ConsumeSynchronous, FConsumeFunction &&ConsumeAsynchronous)
 

Member Typedef Documentation

◆ FConsumeFunction

Member Enumeration Documentation

◆ EConsumeResult

Enumerator
Succeeded 
Failed 
Deferred 

Constructor & Destructor Documentation

◆ FPreloader()

UE::AssetRegistry::Premade::FPreloader::FPreloader ( )
inline

◆ ~FPreloader()

UE::AssetRegistry::Premade::FPreloader::~FPreloader ( )
inline

Member Function Documentation

◆ Consume()

bool UE::AssetRegistry::Premade::FPreloader::Consume ( FConsumeFunction &&  ConsumeFunction)
inline

Block on any pending async load, load if synchronous, and call ConsumeFunction with the results before returning. If Consume has been called previously, the current ConsumeFunction is ignored and this call returns false.

Returns
Whether the load succeeded (this information is also passed to the ConsumeFunction).

◆ ConsumeOrDefer()

EConsumeResult UE::AssetRegistry::Premade::FPreloader::ConsumeOrDefer ( FConsumeFunction &&  ConsumeSynchronous,
FConsumeFunction &&  ConsumeAsynchronous 
)
inline

If a load is pending, store ConsumeAsynchronous for later calling and return EConsumeResult::Deferred. If load is complete, or failed, or needs to run synchronously, load if necessary and call ConsumeSynchronous with results before returning. Note if this function returns EConsumeResult::Deferred, the ConsumeAsynchronous will be called from another thread, possibly before this call returns. If Consume has been called previously, this call is ignored and returns EConsumeResult::Failed.

Returns
Whether the load succeeded (this information is also passed to the ConsumeFunction).

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