![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <StructScriptLoader.h>
Inheritance diagram for FStructScriptLoader:Public Member Functions | |
| FStructScriptLoader (UStruct *TargetScriptContainer, FArchive &Loader) | |
| bool | IsPrimed () |
| bool | LoadStructWithScript (UStruct *DestScriptContainer, FArchive &Loader, bool bAllowDeferredSerialization=true) |
Static Public Member Functions | |
| static bool | ShouldDeferScriptSerialization (FArchive &Ar) |
| static int32 | ResolveDeferredScriptLoads (FLinkerLoad *Linker) |
Utility class to aid in struct (UFunction) script serialization. Will defer or skip script loading (if deemed necessary).
Caches data regarding the script's serialized form (archiver offset, serialized size, etc.), so that given the same archiver later (in LoadStructWithScript) it can seek and serialize the target's bytecode.
NOTE: This expects that the supplied archiver is already positioned to read the start of the script's "header" (the script's BytecodeBufferSize).
| TargetScriptContainer | The target struct (will have its current script cleared). |
| Loader | The archiver that holds serialized script data (expected to be seeked to the proper place). |
| bool FStructScriptLoader::IsPrimed | ( | ) |
Checks to see if this was created from a valid archiver with script code to serialize in.
| bool FStructScriptLoader::LoadStructWithScript | ( | UStruct * | DestScriptContainer, |
| FArchive & | Loader, | ||
| bool | bAllowDeferredSerialization = true |
||
| ) |
Attempts to load the specified target struct with bytecode contained in the supplied archiver (expects the archiver to be the same one that this was created from).
NOTE: Serialization could be skipped if: 1) this isn't properly "primed", 2) we've opted to skip bytecode serialization (for editor builds), or 3) the Loader wishes to have dependency link points deferred (unless bAllowDeferredSerialization is set false)
| DestScriptContainer | The target struct that you want script code loaded in to. |
| Loader | The archiver that holds the serialized script code meant for the target. |
| bAllowDeferredSerialization | If false, then serialization will be forced through regardless of ShouldDeferScriptSerialization(). |
|
static |
Looks for any struct scripts that were deferred as part of a LoadStructWithScript() call, and attempts to serialize the original targets with the deferred load.
| Linker | The linker/archiver that the structs were originally meant to be loaded by. |
Can be used to determine if the specified archiver wants possible dependency load points (such as bytecode) deferred (until after class serialization).
| Ar | The archiver to check. |