UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::AssetDataGather::Private::FFileReadScheduler Class Reference

#include <AssetDataGathererPrivate.h>

Public Member Functions

 FFileReadScheduler (int32 InNumReadThreads, bool InGatherAssetPackageData, bool InGatherDependsData)
 
 ~FFileReadScheduler ()
 
bool IsAssetPackageDataGatherEnabled () const
 
bool IsDependsDataGatherEnabled () const
 
void AddFile (const FName PackageName, FGatheredPathData &&AssetData)
 
void WaitOnDirectoriesAndUpdateWaitList (FWaitBatchDirectorySet &WaitBatchDirectories)
 
void Schedule (const TArray< FString > &PriorityDirectories)
 
void CollectCompletedReads (TArray< TUniquePtr< FReadContext > > &OutReadyContexts)
 
void RemoveScheduledDirectory (const FString &Directory)
 
void ProcessReadContexts (TArray< TUniquePtr< UE::AssetDataGather::Private::FReadContext > > &&ReadContexts, bool bIsTimeSliced)
 
void FreeReadTaskLoaders ()
 
void Shrink ()
 

Detailed Description

Manages the scheduling of FReadContexts

Constructor & Destructor Documentation

◆ FFileReadScheduler()

UE::AssetDataGather::Private::FFileReadScheduler::FFileReadScheduler ( int32  InNumReadThreads,
bool  InGatherAssetPackageData,
bool  InGatherDependsData 
)

◆ ~FFileReadScheduler()

UE::AssetDataGather::Private::FFileReadScheduler::~FFileReadScheduler ( )

Member Function Documentation

◆ AddFile()

void UE::AssetDataGather::Private::FFileReadScheduler::AddFile ( const FName  PackageName,
FGatheredPathData &&  AssetData 
)

Add file to be scheduled for reading asynchronously.

◆ CollectCompletedReads()

void UE::AssetDataGather::Private::FFileReadScheduler::CollectCompletedReads ( TArray< TUniquePtr< FReadContext > > &  OutReadyContexts)

Populates the provided array with all completed reads (completed means read context is no longer being processed. One must still check for success/failure/cancellation).

◆ FreeReadTaskLoaders()

void UE::AssetDataGather::Private::FFileReadScheduler::FreeReadTaskLoaders ( )

Releases all allocated read task loaders created during gathering. Must be called while gathering is not in progress.

◆ IsAssetPackageDataGatherEnabled()

bool UE::AssetDataGather::Private::FFileReadScheduler::IsAssetPackageDataGatherEnabled ( ) const
inline

Returns true if AssetPackageData should be gathered. Constant during threading.

◆ IsDependsDataGatherEnabled()

bool UE::AssetDataGather::Private::FFileReadScheduler::IsDependsDataGatherEnabled ( ) const
inline

Returns true if dependency data should be gathered. Constant during threading.

◆ ProcessReadContexts()

void UE::AssetDataGather::Private::FFileReadScheduler::ProcessReadContexts ( TArray< TUniquePtr< UE::AssetDataGather::Private::FReadContext > > &&  ReadContexts,
bool  bIsTimeSliced 
)

Reads and stores gather results for asset files in the provided array. If time slicing is used this method may exit before all read contexts are processed, and if so, will mark unprocessed read contexts as cancelled so they may be rescheduled in another gatherer tick.

◆ RemoveScheduledDirectory()

void UE::AssetDataGather::Private::FFileReadScheduler::RemoveScheduledDirectory ( const FString &  Directory)

Removes a scheduled directory from the scheduler. When all added files for a directory have been scheduled and completed, the directory should be removed to avoid overhead should a wait batch directory attempt to wait on the empty, still scheduled, directory.

◆ Schedule()

void UE::AssetDataGather::Private::FFileReadScheduler::Schedule ( const TArray< FString > &  PriorityDirectories)

Schedules all added files since the last call to Schedule to be picked up by the task system such that up to NumReadTaskThreads normal priority tasks may be in-flight at once. Existing or newly added directories in the given list of PriorityDirectories will be scheduled immediately and not bound by the schedulers NumReadTaskThreads limit.

◆ Shrink()

void UE::AssetDataGather::Private::FFileReadScheduler::Shrink ( )

Frees unnecessary allocations the scheduler may have accrued.

◆ WaitOnDirectoriesAndUpdateWaitList()

void UE::AssetDataGather::Private::FFileReadScheduler::WaitOnDirectoriesAndUpdateWaitList ( FWaitBatchDirectorySet WaitBatchDirectories)

Schedule immediately and waits for all reads for the directories listed in WaitBatchDirectories. The list will be updated with all child directories waited on if the passed in directory was listed as recursive.


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