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

#include <AsyncLoading.h>

+ Inheritance diagram for FAsyncPackage:

Classes

struct  FExportIORequest
 

Public Member Functions

 FAsyncPackage (FAsyncLoadingThread &InThread, const FAsyncPackageDesc &InDesc, struct FEDLBootNotificationManager &InEDLBootNotificationManager)
 
 ~FAsyncPackage ()
 
EAsyncPackageState::Type TickAsyncPackage (bool bUseTimeLimit, bool bInbUseFullTimeLimit, float &InOutTimeLimit)
 
void MarkRequestIDsAsComplete ()
 
FORCEINLINE float GetLoadPercentage () const
 
double GetLoadStartTime () const
 
void ResetLoader ()
 
void DetachLinker ()
 
void FlushObjectLinkerCache ()
 
FORCEINLINE const FNameGetPackageName () const
 
FORCEINLINE const FPackagePathGetPackagePath () const
 
void AddCompletionCallback (TUniquePtr< FLoadPackageAsyncDelegate > &&Callback, bool bInternal)
 
FORCEINLINE int32 GetDependencyRefCount () const
 
FORCEINLINE UPackageGetLinkerRoot () const
 
FORCEINLINE bool HasFinishedLoading () const
 
FORCEINLINE int32 GetRequestID () const
 
FORCEINLINE TAsyncLoadPriority GetPriority () const
 
FORCEINLINE void SetPriority (TAsyncLoadPriority InPriority)
 
FORCEINLINE bool HasLoadFailed () const
 
void ThreadedLoadingHasFinished ()
 
bool HasThreadedLoadingFinished () const
 
void AddRequestID (int32 Id)
 
void Cancel ()
 
void SetDependencyRootPackage (FAsyncPackage *InDependencyRootPackage)
 
bool IsBeingProcessedRecursively () const
 
virtual void AddReferencedObjects (FReferenceCollector &Collector) override
 
virtual FString GetReferencerName () const override
 
void AddObjectReference (UObject *InObject)
 
void EmptyReferencedObjects ()
 
UPackageGetLoadedPackage ()
 
bool AreAllDependenciesFullyLoaded (TSet< UPackage * > &VisitedPackages)
 
bool HasClusterObjects () const
 
EAsyncPackageState::Type CreateClusters (double InTickStartTime, bool bInUseTimeLimit, double InOutTimeLimit)
 
bool IsDependencyOf (int32 RequestID)
 
void Event_CreateLinker ()
 
void Event_FinishLinker ()
 
void Event_StartImportPackages ()
 
void Event_SetupImports ()
 
void Event_SetupExports ()
 
void Event_ProcessImportsAndExports ()
 
void Event_ExportsDone ()
 
void Event_ProcessPostloadWait ()
 
void Event_StartPostload ()
 
void MarkNewObjectForLoadIfItIsAnExport (UObject *Object)
 
bool AnyImportsAndExportWorkOutstanding ()
 
void ConditionalQueueProcessImportsAndExports (bool bRequeueForTimeout=false)
 
void ConditionalQueueProcessPostloadWait ()
 
EAsyncPackageState::Type LoadImports_Event ()
 
EAsyncPackageState::Type SetupImports_Event ()
 
EAsyncPackageState::Type SetupExports_Event ()
 
EAsyncPackageState::Type ProcessImportsAndExports_Event ()
 
FObjectImportFindExistingImport (int32 LocalImportIndex)
 
void LinkImport (int32 LocalImportIndex)
 
void EventDrivenCreateExport (int32 LocalExportIndex)
 
void StartPrecacheRequest ()
 
void EventDrivenSerializeExport (int32 LocalExportIndex)
 
int64 PrecacheRequestReady (IAsyncReadRequest *Req)
 
void MakeNextPrecacheRequestCurrent ()
 
void FlushPrecacheBuffer ()
 
void EventDrivenLoadingComplete ()
 
void DumpDependencies (const TCHAR *Label, UObject *Obj)
 
void DumpDependencies (const TCHAR *Label, FLinkerLoad *DumpLinker, FPackageIndex Index)
 
UObjectEventDrivenIndexToObject (FPackageIndex Index, bool bCheckSerialized, FPackageIndex DumpIndex=FPackageIndex())
 
template<class T >
T * CastEventDrivenIndexToObject (FPackageIndex Index, bool bCheckSerialized, FPackageIndex DumpIndex=FPackageIndex())
 
FEventLoadNodePtr AddNode (EEventLoadNode Phase, FPackageIndex ImportOrExportIndex=FPackageIndex(), bool bHoldForLater=false, int32 NumImplicitPrereqs=0)
 
void DoneAddingPrerequistesFireIfNone (EEventLoadNode Phase, FPackageIndex ImportOrExportIndex=FPackageIndex(), bool bWasHeldForLater=false)
 
void RemoveNode (EEventLoadNode Phase, FPackageIndex ImportOrExportIndex=FPackageIndex())
 
void NodeWillBeFiredExternally (EEventLoadNode Phase, FPackageIndex ImportOrExportIndex=FPackageIndex())
 
void AddArc (FEventLoadNodePtr &PrereqisiteNode, FEventLoadNodePtr &DependentNode)
 
void RemoveAllNodes ()
 
void FireNode (FEventLoadNodePtr &NodeToFire)
 
FString GetDebuggingPath (FPackageIndex Idx)
 
void SetTimeLimit (FAsyncLoadEventArgs &Args, const TCHAR *WorkType)
 
FAsyncLoadingThreadGetOwnerThread ()
 
void CallCompletionCallbacks (bool bInternalOnly, EAsyncLoadingResult::Type LoadingResult)
 
EAsyncPackageState::Type PostLoadDeferredObjects (double InTickStartTime, bool bInUseTimeLimit, double InOutTimeLimit)
 
void CloseDelayedLinkers ()
 
FUObjectSerializeContextGetSerializeContext ()
 
- Public Member Functions inherited from FGCObject
 FGCObject ()
 
 FGCObject (const FGCObject &Other)
 
 FGCObject (FGCObject &&Other)
 
 FGCObject (EFlags Flags)
 
virtual ~FGCObject ()
 
FGCObjectoperator= (const FGCObject &)
 
FGCObjectoperator= (FGCObject &&)
 
COREUOBJECT_API void RegisterGCObject ()
 
COREUOBJECT_API void UnregisterGCObject ()
 
virtual bool GetReferencerPropertyName (UObject *Object, FString &OutPropertyName) const
 

Public Attributes

EAsyncPackageLoadingState AsyncPackageLoadingState
 
int32 SerialNumber
 
FImportOrImportIndexArray ImportsThatAreNowCreated
 
FImportOrImportIndexArray ImportsThatAreNowSerialized
 
FImportOrImportIndexArray ExportsThatCanBeCreated
 
FImportOrImportIndexArray ExportsThatCanHaveIOStarted
 
FImportOrImportIndexArray ExportsThatCanBeSerialized
 
TArray< IAsyncReadRequest * > ReadyPrecacheRequests
 
TMap< IAsyncReadRequest *, FAsyncPackage::FExportIORequestPrecacheRequests
 
TMap< int32, IAsyncReadRequest * > ExportIndexToPrecacheRequest
 
int64 CurrentBlockOffset
 
int64 CurrentBlockBytes
 
TSet< int32ExportsInThisBlock
 
TMap< TPair< FName, FPackageIndex >, FPackageIndexObjectNameWithOuterToExport
 
TSet< FWeakAsyncPackagePtrPackagesIMayBeWaitingForBeforePostload
 
TSet< FWeakAsyncPackagePtrPackagesIAmWaitingForBeforePostload
 
TSet< FWeakAsyncPackagePtrOtherPackagesWaitingForMeBeforePostload
 
TArray< FCheckedWeakAsyncPackagePtrPackagesWaitingToLinkImports
 
int32 ImportAddNodeIndex
 
int32 ExportAddNodeIndex
 
bool bProcessImportsAndExportsInFlight
 
bool bProcessPostloadWaitInFlight
 
bool bAllExportsSerialized
 
FEventLoadNodeArray EventNodeArray
 

Friends

struct FScopedAsyncPackageEvent
 
struct FAsyncPackageScope
 
class FLinkerLoad
 

Additional Inherited Members

- Public Types inherited from FGCObject
enum class  EFlags : uint32 { None = 0 , RegisterLater = 1 << 0 , AddStableNativeReferencesOnly = 1 << 1 }
 
- Static Public Member Functions inherited from FGCObject
static COREUOBJECT_API void StaticInit ()
 
- Static Public Attributes inherited from FGCObject
static COREUOBJECT_API UGCObjectReferencerGGCObjectReferencer = nullptr
 

Detailed Description

Structure containing intermediate data required for async loading of all imports and exports of a FLinkerLoad.

Constructor & Destructor Documentation

◆ FAsyncPackage()

FAsyncPackage::FAsyncPackage ( FAsyncLoadingThread InThread,
const FAsyncPackageDesc InDesc,
struct FEDLBootNotificationManager InEDLBootNotificationManager 
)

Constructor

◆ ~FAsyncPackage()

FAsyncPackage::~FAsyncPackage ( )

Member Function Documentation

◆ AddArc()

void FAsyncPackage::AddArc ( FEventLoadNodePtr PrereqisiteNode,
FEventLoadNodePtr DependentNode 
)

◆ AddCompletionCallback()

void FAsyncPackage::AddCompletionCallback ( TUniquePtr< FLoadPackageAsyncDelegate > &&  Callback,
bool  bInternal 
)

◆ AddNode()

FEventLoadNodePtr FAsyncPackage::AddNode ( EEventLoadNode  Phase,
FPackageIndex  ImportOrExportIndex = FPackageIndex(),
bool  bHoldForLater = false,
int32  NumImplicitPrereqs = 0 
)

◆ AddObjectReference()

void FAsyncPackage::AddObjectReference ( UObject InObject)

Adds a new object referenced by this package

◆ AddReferencedObjects()

void FAsyncPackage::AddReferencedObjects ( FReferenceCollector Collector)
overridevirtual

FGCObject Interface

Implements FGCObject.

◆ AddRequestID()

void FAsyncPackage::AddRequestID ( int32  Id)

Adds new request ID to the existing package

◆ AnyImportsAndExportWorkOutstanding()

bool FAsyncPackage::AnyImportsAndExportWorkOutstanding ( )

◆ AreAllDependenciesFullyLoaded()

bool FAsyncPackage::AreAllDependenciesFullyLoaded ( TSet< UPackage * > &  VisitedPackages)

Checks if all dependencies (imported packages) of this package have been fully loaded

◆ CallCompletionCallbacks()

void FAsyncPackage::CallCompletionCallbacks ( bool  bInternalOnly,
EAsyncLoadingResult::Type  LoadingResult 
)

[EDL] End Event driven loader specific stuff

◆ Cancel()

void FAsyncPackage::Cancel ( )

Cancel loading this package.

◆ CastEventDrivenIndexToObject()

template<class T >
T * FAsyncPackage::CastEventDrivenIndexToObject ( FPackageIndex  Index,
bool  bCheckSerialized,
FPackageIndex  DumpIndex = FPackageIndex() 
)
inline

◆ CloseDelayedLinkers()

void FAsyncPackage::CloseDelayedLinkers ( )

Close any linkers that have been open as a result of synchronous load during async loading

◆ ConditionalQueueProcessImportsAndExports()

void FAsyncPackage::ConditionalQueueProcessImportsAndExports ( bool  bRequeueForTimeout = false)

◆ ConditionalQueueProcessPostloadWait()

void FAsyncPackage::ConditionalQueueProcessPostloadWait ( )

◆ CreateClusters()

EAsyncPackageState::Type FAsyncPackage::CreateClusters ( double  InTickStartTime,
bool  bInUseTimeLimit,
double  InOutTimeLimit 
)

Creates GC clusters from loaded objects

◆ DetachLinker()

void FAsyncPackage::DetachLinker ( )

Disassociates linker from this package

◆ DoneAddingPrerequistesFireIfNone()

void FAsyncPackage::DoneAddingPrerequistesFireIfNone ( EEventLoadNode  Phase,
FPackageIndex  ImportOrExportIndex = FPackageIndex(),
bool  bWasHeldForLater = false 
)

◆ DumpDependencies() [1/2]

void FAsyncPackage::DumpDependencies ( const TCHAR Label,
FLinkerLoad DumpLinker,
FPackageIndex  Index 
)

◆ DumpDependencies() [2/2]

void FAsyncPackage::DumpDependencies ( const TCHAR Label,
UObject Obj 
)

◆ EmptyReferencedObjects()

void FAsyncPackage::EmptyReferencedObjects ( )

Removes all objects from the list and clears async loading flags

◆ Event_CreateLinker()

void FAsyncPackage::Event_CreateLinker ( )

◆ Event_ExportsDone()

void FAsyncPackage::Event_ExportsDone ( )

◆ Event_FinishLinker()

void FAsyncPackage::Event_FinishLinker ( )

◆ Event_ProcessImportsAndExports()

void FAsyncPackage::Event_ProcessImportsAndExports ( )

◆ Event_ProcessPostloadWait()

void FAsyncPackage::Event_ProcessPostloadWait ( )

◆ Event_SetupExports()

void FAsyncPackage::Event_SetupExports ( )

◆ Event_SetupImports()

void FAsyncPackage::Event_SetupImports ( )

◆ Event_StartImportPackages()

void FAsyncPackage::Event_StartImportPackages ( )

◆ Event_StartPostload()

void FAsyncPackage::Event_StartPostload ( )

◆ EventDrivenCreateExport()

void FAsyncPackage::EventDrivenCreateExport ( int32  LocalExportIndex)

◆ EventDrivenIndexToObject()

UObject * FAsyncPackage::EventDrivenIndexToObject ( FPackageIndex  Index,
bool  bCheckSerialized,
FPackageIndex  DumpIndex = FPackageIndex() 
)

◆ EventDrivenLoadingComplete()

void FAsyncPackage::EventDrivenLoadingComplete ( )

◆ EventDrivenSerializeExport()

void FAsyncPackage::EventDrivenSerializeExport ( int32  LocalExportIndex)

◆ FindExistingImport()

FObjectImport * FAsyncPackage::FindExistingImport ( int32  LocalImportIndex)

◆ FireNode()

void FAsyncPackage::FireNode ( FEventLoadNodePtr NodeToFire)

◆ FlushObjectLinkerCache()

void FAsyncPackage::FlushObjectLinkerCache ( )

Flushes linker cache for all objects loaded with this package

◆ FlushPrecacheBuffer()

void FAsyncPackage::FlushPrecacheBuffer ( )

◆ GetDebuggingPath()

FString FAsyncPackage::GetDebuggingPath ( FPackageIndex  Idx)

◆ GetDependencyRefCount()

FORCEINLINE int32 FAsyncPackage::GetDependencyRefCount ( ) const
inline

Gets the number of references to this package from other packages in the dependency tree.

◆ GetLinkerRoot()

FORCEINLINE UPackage * FAsyncPackage::GetLinkerRoot ( ) const
inline

◆ GetLoadedPackage()

UPackage * FAsyncPackage::GetLoadedPackage ( )

Returns the UPackage wrapped by this, if it is valid

◆ GetLoadPercentage()

FORCEINLINE float FAsyncPackage::GetLoadPercentage ( ) const
inline
Returns
Estimated load completion percentage.

◆ GetLoadStartTime()

double FAsyncPackage::GetLoadStartTime ( ) const
Returns
Time load begun. This is NOT the time the load was requested in the case of other pending requests.

◆ GetOwnerThread()

FAsyncLoadingThread & FAsyncPackage::GetOwnerThread ( )
inline

◆ GetPackageName()

FORCEINLINE const FName & FAsyncPackage::GetPackageName ( ) const
inline

Returns the name of the package to load.

◆ GetPackagePath()

FORCEINLINE const FPackagePath & FAsyncPackage::GetPackagePath ( ) const
inline

Returns the PackagePath from which to load the package.

◆ GetPriority()

FORCEINLINE TAsyncLoadPriority FAsyncPackage::GetPriority ( ) const
inline

Returns package loading priority.

◆ GetReferencerName()

virtual FString FAsyncPackage::GetReferencerName ( ) const
inlineoverridevirtual

Overload this method to report a name for your referencer

Implements FGCObject.

◆ GetRequestID()

FORCEINLINE int32 FAsyncPackage::GetRequestID ( ) const
inline

Returns package loading priority.

◆ GetSerializeContext()

FUObjectSerializeContext * FAsyncPackage::GetSerializeContext ( )

Serialization context for this package

◆ HasClusterObjects()

bool FAsyncPackage::HasClusterObjects ( ) const
inline

Returs true if this package loaded objects that can create GC clusters

◆ HasFinishedLoading()

FORCEINLINE bool FAsyncPackage::HasFinishedLoading ( ) const
inline

Returns true if the package has finished loading.

◆ HasLoadFailed()

FORCEINLINE bool FAsyncPackage::HasLoadFailed ( ) const
inline

Returns true if loading has failed

◆ HasThreadedLoadingFinished()

bool FAsyncPackage::HasThreadedLoadingFinished ( ) const
inline

Returns true if the threaded loaded phas has completed for this package

◆ IsBeingProcessedRecursively()

bool FAsyncPackage::IsBeingProcessedRecursively ( ) const
inline

Returns true if this package is already being loaded in the current callstack

◆ IsDependencyOf()

bool FAsyncPackage::IsDependencyOf ( int32  RequestID)

Returns true if this package is a dependency to the explicit request id RequestID.

◆ LinkImport()

void FAsyncPackage::LinkImport ( int32  LocalImportIndex)

◆ LoadImports_Event()

EAsyncPackageState::Type FAsyncPackage::LoadImports_Event ( )

◆ MakeNextPrecacheRequestCurrent()

void FAsyncPackage::MakeNextPrecacheRequestCurrent ( )

◆ MarkNewObjectForLoadIfItIsAnExport()

void FAsyncPackage::MarkNewObjectForLoadIfItIsAnExport ( UObject Object)

◆ MarkRequestIDsAsComplete()

void FAsyncPackage::MarkRequestIDsAsComplete ( )

Marks a specific request as complete

◆ NodeWillBeFiredExternally()

void FAsyncPackage::NodeWillBeFiredExternally ( EEventLoadNode  Phase,
FPackageIndex  ImportOrExportIndex = FPackageIndex() 
)

◆ PostLoadDeferredObjects()

EAsyncPackageState::Type FAsyncPackage::PostLoadDeferredObjects ( double  InTickStartTime,
bool  bInUseTimeLimit,
double  InOutTimeLimit 
)

Route PostLoad to deferred objects.

Returns
true if we finished calling PostLoad on all loaded objects and no new ones were created, false otherwise

◆ PrecacheRequestReady()

int64 FAsyncPackage::PrecacheRequestReady ( IAsyncReadRequest Req)

◆ ProcessImportsAndExports_Event()

EAsyncPackageState::Type FAsyncPackage::ProcessImportsAndExports_Event ( )

◆ RemoveAllNodes()

void FAsyncPackage::RemoveAllNodes ( )

◆ RemoveNode()

void FAsyncPackage::RemoveNode ( EEventLoadNode  Phase,
FPackageIndex  ImportOrExportIndex = FPackageIndex() 
)

◆ ResetLoader()

void FAsyncPackage::ResetLoader ( )

Emulates ResetLoaders for the package's Linker objects, hence deleting it.

◆ SetDependencyRootPackage()

void FAsyncPackage::SetDependencyRootPackage ( FAsyncPackage InDependencyRootPackage)
inline

Set the package that spawned this package as a dependency.

◆ SetPriority()

FORCEINLINE void FAsyncPackage::SetPriority ( TAsyncLoadPriority  InPriority)
inline

Returns package loading priority.

◆ SetTimeLimit()

void FAsyncPackage::SetTimeLimit ( FAsyncLoadEventArgs Args,
const TCHAR WorkType 
)
inline

◆ SetupExports_Event()

EAsyncPackageState::Type FAsyncPackage::SetupExports_Event ( )

◆ SetupImports_Event()

EAsyncPackageState::Type FAsyncPackage::SetupImports_Event ( )

◆ StartPrecacheRequest()

void FAsyncPackage::StartPrecacheRequest ( )

◆ ThreadedLoadingHasFinished()

void FAsyncPackage::ThreadedLoadingHasFinished ( )
inline

Marks the threaded loading phase as complete for this package

◆ TickAsyncPackage()

EAsyncPackageState::Type FAsyncPackage::TickAsyncPackage ( bool  InbUseTimeLimit,
bool  InbUseFullTimeLimit,
float InOutTimeLimit 
)

Ticks the async loading code.

Parameters
InbUseTimeLimitWhether to use a time limit
InbUseFullTimeLimitIf true use the entire time limit, even if you have to block on IO
InTimeLimitSoft limit to time this function may take
Returns
true if package has finished loading, false otherwise

Ticks the async loading code.

Parameters
InbUseTimeLimitWhether to use a time limit
InbUseFullTimeLimitIf true use the entire time limit, even if you have to block on IO
InOutTimeLimitSoft limit to time this function may take
Returns
true if package has finished loading, false otherwise

Friends And Related Symbol Documentation

◆ FAsyncPackageScope

◆ FLinkerLoad

friend class FLinkerLoad
friend

◆ FScopedAsyncPackageEvent

Member Data Documentation

◆ AsyncPackageLoadingState

EAsyncPackageLoadingState FAsyncPackage::AsyncPackageLoadingState

[EDL] Begin Event driven loader specific stuff

◆ bAllExportsSerialized

bool FAsyncPackage::bAllExportsSerialized

◆ bProcessImportsAndExportsInFlight

bool FAsyncPackage::bProcessImportsAndExportsInFlight

◆ bProcessPostloadWaitInFlight

bool FAsyncPackage::bProcessPostloadWaitInFlight

◆ CurrentBlockBytes

int64 FAsyncPackage::CurrentBlockBytes

◆ CurrentBlockOffset

int64 FAsyncPackage::CurrentBlockOffset

◆ EventNodeArray

FEventLoadNodeArray FAsyncPackage::EventNodeArray

◆ ExportAddNodeIndex

int32 FAsyncPackage::ExportAddNodeIndex

◆ ExportIndexToPrecacheRequest

TMap<int32, IAsyncReadRequest*> FAsyncPackage::ExportIndexToPrecacheRequest

◆ ExportsInThisBlock

TSet<int32> FAsyncPackage::ExportsInThisBlock

◆ ExportsThatCanBeCreated

FImportOrImportIndexArray FAsyncPackage::ExportsThatCanBeCreated

◆ ExportsThatCanBeSerialized

FImportOrImportIndexArray FAsyncPackage::ExportsThatCanBeSerialized

◆ ExportsThatCanHaveIOStarted

FImportOrImportIndexArray FAsyncPackage::ExportsThatCanHaveIOStarted

◆ ImportAddNodeIndex

int32 FAsyncPackage::ImportAddNodeIndex

◆ ImportsThatAreNowCreated

FImportOrImportIndexArray FAsyncPackage::ImportsThatAreNowCreated

◆ ImportsThatAreNowSerialized

FImportOrImportIndexArray FAsyncPackage::ImportsThatAreNowSerialized

◆ ObjectNameWithOuterToExport

TMap<TPair<FName, FPackageIndex>, FPackageIndex> FAsyncPackage::ObjectNameWithOuterToExport

◆ OtherPackagesWaitingForMeBeforePostload

TSet<FWeakAsyncPackagePtr> FAsyncPackage::OtherPackagesWaitingForMeBeforePostload

◆ PackagesIAmWaitingForBeforePostload

TSet<FWeakAsyncPackagePtr> FAsyncPackage::PackagesIAmWaitingForBeforePostload

◆ PackagesIMayBeWaitingForBeforePostload

TSet<FWeakAsyncPackagePtr> FAsyncPackage::PackagesIMayBeWaitingForBeforePostload

◆ PackagesWaitingToLinkImports

TArray<FCheckedWeakAsyncPackagePtr> FAsyncPackage::PackagesWaitingToLinkImports

◆ PrecacheRequests

TMap<IAsyncReadRequest*, FAsyncPackage::FExportIORequest> FAsyncPackage::PrecacheRequests

◆ ReadyPrecacheRequests

TArray<IAsyncReadRequest*> FAsyncPackage::ReadyPrecacheRequests

◆ SerialNumber

int32 FAsyncPackage::SerialNumber

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