UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Linker.h File Reference
#include "Containers/Array.h"
#include "Containers/ArrayView.h"
#include "Containers/Map.h"
#include "Containers/Set.h"
#include "Containers/UnrealString.h"
#include "CoreMinimal.h"
#include "CoreTypes.h"
#include "Internationalization/GatherableTextData.h"
#include "Logging/LogMacros.h"
#include "Misc/AssertionMacros.h"
#include "Serialization/StructuredArchive.h"
#include "Serialization/StructuredArchiveSlots.h"
#include "Serialization/ImportTypeHierarchy.h"
#include "Templates/RefCounting.h"
#include "UObject/LinkerInstancingContext.h"
#include "UObject/NameTypes.h"
#include "UObject/ObjectMacros.h"
#include "UObject/ObjectResource.h"
#include "UObject/PackageFileSummary.h"

Go to the source code of this file.

Classes

struct  FCompressedChunk
 
class  FLinkerTables
 
class  FLinker
 

Namespaces

namespace  ELinkerType
 

Macros

#define LLF_None   0x00000000
 
#define LLF_PayloadInSeparateFile   0x00000001
 
#define LLF_SerializeCompressed   0x00000002
 
#define LLF_AllFlags   0xFFFFFFFF
 

Typedefs

typedef uint32 ELazyLoaderFlags
 

Enumerations

enum  ELinkerType::Type { ELinkerType::None , ELinkerType::Load , ELinkerType::Save }
 

Functions

 DECLARE_LOG_CATEGORY_EXTERN (LogLinker, Log, All)
 
template<typename T >
UE_FORCEINLINE_HINT T * Cast (FLinker *Src)
 
template<typename T >
T * CastChecked (FLinker *Src)
 
COREUOBJECT_API FLinkerLoadLoadPackageLinker (UPackage *InOuter, const FPackagePath &PackagePath, uint32 LoadFlags, UPackageMap *Sandbox, FArchive *InReaderOverride, TFunctionRef< void(FLinkerLoad *LoadedLinker)> LinkerLoadedCallback)
 
COREUOBJECT_API FLinkerLoadLoadPackageLinker (UPackage *InOuter, const FPackagePath &PackagePath, uint32 LoadFlags=LOAD_None, UPackageMap *Sandbox=nullptr, FArchive *InReaderOverride=nullptr)
 
COREUOBJECT_API FLinkerLoadGetPackageLinker (UPackage *InOuter, const FPackagePath &PackagePath, uint32 LoadFlags, UPackageMap *Sandbox, FArchive *InReaderOverride=nullptr, FUObjectSerializeContext **InOutLoadContext=nullptr, FLinkerLoad *ImportLinker=nullptr, const FLinkerInstancingContext *InstancingContext=nullptr)
 
COREUOBJECT_API FString GetPrestreamPackageLinkerName (const TCHAR *InLongPackageName, bool bSkipIfExists=true)
 
COREUOBJECT_API void ResetLinkerExports (UPackage *InPackage)
 
COREUOBJECT_API void ResetLoaders (UObject *InOuter)
 
COREUOBJECT_API void ResetLoaders (TConstArrayView< UObject * > InOuters)
 
COREUOBJECT_API void ConditionalFlushAsyncLoadingForSave (UPackage *InPackage)
 
COREUOBJECT_API void ResetLoadersForSave (UPackage *Package, const TCHAR *Filename)
 
COREUOBJECT_API void ResetLoadersForSave (TConstArrayView< FPackageSaveInfo > InPackages)
 
COREUOBJECT_API void DeleteLoaders ()
 
COREUOBJECT_API void DeleteLoader (FLinkerLoad *Loader)
 
COREUOBJECT_API void EnsureLoadingComplete (UPackage *Package)
 

Macro Definition Documentation

◆ LLF_AllFlags

#define LLF_AllFlags   0xFFFFFFFF

Mask of all flags

◆ LLF_None

#define LLF_None   0x00000000

Empty flag set.

◆ LLF_PayloadInSeparateFile

#define LLF_PayloadInSeparateFile   0x00000001

If set, payload is [going to be] stored in separate file

◆ LLF_SerializeCompressed

#define LLF_SerializeCompressed   0x00000002

If set, payload should be [un]compressed during serialization. Only bulk data that doesn't require any special serialization or endian conversion can be compressed! The code will simply serialize a block from disk and use the byte order agnostic Serialize( Data, Length ) function to fill the memory.

Typedef Documentation

◆ ELazyLoaderFlags

Flags serialized with the lazy loader.

Function Documentation

◆ Cast()

template<typename T >
UE_FORCEINLINE_HINT T * Cast ( FLinker Src)

◆ CastChecked()

template<typename T >
T * CastChecked ( FLinker Src)
inline

◆ ConditionalFlushAsyncLoadingForSave()

COREUOBJECT_API void ConditionalFlushAsyncLoadingForSave ( UPackage InPackage)

Conditionally flush async loading for a specific package if there's any pending async requests

Parameters
InPackageThe package to flush for

◆ DECLARE_LOG_CATEGORY_EXTERN()

DECLARE_LOG_CATEGORY_EXTERN ( LogLinker  ,
Log  ,
All   
)

◆ DeleteLoader()

COREUOBJECT_API void DeleteLoader ( FLinkerLoad Loader)

Queues linker for deletion

◆ DeleteLoaders()

COREUOBJECT_API void DeleteLoaders ( )

Deletes all linkers that have finished loading

◆ EnsureLoadingComplete()

COREUOBJECT_API void EnsureLoadingComplete ( UPackage Package)

◆ GetPackageLinker()

COREUOBJECT_API FLinkerLoad * GetPackageLinker ( UPackage InOuter,
const FPackagePath PackagePath,
uint32  LoadFlags,
UPackageMap Sandbox,
FArchive InReaderOverride = nullptr,
FUObjectSerializeContext **  InOutLoadContext = nullptr,
FLinkerLoad ImportLinker = nullptr,
const FLinkerInstancingContext InstancingContext = nullptr 
)

Gets a linker for a package and returns it without loading any objects.

Parameters
InOuterPackage if known, can be null
PackagePathPackage resource to load, must not be empty
LoadFlagsFlags to pass to the new linker
SandboxAdditional sandbox for loading
CompatibleGuidNet GUID
InReaderOverrideOptional archive to use for reading package data
InOutLoadContextOptional load context. If the package linker is already associated with a context that's currently loading objects that context will be returned in this param
ImportLinkerOptional import linker that triggered the linker creation. it will pass in its instancing context if a linker is created, take precedence over the optional InstancingContext
InstancingContextOptional instancing context to pass in if a linker is created
Returns
Pointer to the loaded linker or null if the file didn't exist

◆ GetPrestreamPackageLinkerName()

COREUOBJECT_API FString GetPrestreamPackageLinkerName ( const TCHAR InLongPackageName,
bool  bSkipIfExists = true 
)

◆ LoadPackageLinker() [1/2]

COREUOBJECT_API FLinkerLoad * LoadPackageLinker ( UPackage InOuter,
const FPackagePath PackagePath,
uint32  LoadFlags,
UPackageMap Sandbox,
FArchive InReaderOverride,
TFunctionRef< void(FLinkerLoad *LoadedLinker)>  LinkerLoadedCallback 
)

Loads a linker for a package and returns it without loading any objects.

Parameters
InOuterPackage if known, can be null
PackagePathPackage resource to load, must not be empty
LoadFlagsFlags to pass to the new linker
SandboxAdditional sandbox for loading
CompatibleGuidNet GUID
InReaderOverrideOptional archive to use for reading package data
LinkerLoadedCallbackCallback when the linker is loaded (or not found)
Returns
Pointer to the loaded linker or null if the file didn't exist

◆ LoadPackageLinker() [2/2]

COREUOBJECT_API FLinkerLoad * LoadPackageLinker ( UPackage InOuter,
const FPackagePath PackagePath,
uint32  LoadFlags = LOAD_None,
UPackageMap Sandbox = nullptr,
FArchive InReaderOverride = nullptr 
)

◆ ResetLinkerExports()

COREUOBJECT_API void ResetLinkerExports ( UPackage InPackage)

Reset the linker exports associated with the package

Note
, this might flush async loading if the linker is owned by the loading thread

◆ ResetLoaders() [1/2]

COREUOBJECT_API void ResetLoaders ( TConstArrayView< UObject * >  InOuters)

◆ ResetLoaders() [2/2]

COREUOBJECT_API void ResetLoaders ( UObject InOuter)

Remove references to the linker for the given package and delete the linker. Can be called after the package has finished loading. Flushes async loading.

◆ ResetLoadersForSave() [1/2]

COREUOBJECT_API void ResetLoadersForSave ( TConstArrayView< FPackageSaveInfo InPackages)

Reset the loaders for the given packages if they are using the given filenames, so we can write to the files

Parameters
InPackageThe package we are saving along with their filename

◆ ResetLoadersForSave() [2/2]

COREUOBJECT_API void ResetLoadersForSave ( UPackage Package,
const TCHAR Filename 
)

Reset the loader for the given package if it is using the given filename, so we can write to the file

Parameters
PackageThe package we are saving
FilenameThe filename we are saving too