UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IToolchainPlugin.inl
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
4#include "uLang/Toolchain/ModularFeatureManager.h" // for IModularFeatureRegistry
6
7namespace uLang
8{
9namespace Private
10{
25
26 template<typename DyLibClass>
28 {
29 DyLibClass* DyLibInstance = nullptr;
30 if (Params._SysParams._APIVersion == ULANG_API_VERSION)
31 {
33 {
34 ::uLang::Initialize(Params._SysParams);
35 CommandLine::Init(Params._CommandLine);
36 }
37 else
38 {
39 ULANG_ASSERTF(::uLang::GetSystemParams() == Params._SysParams, "Library (%s) already initialized w/ incompatible core settings.", LibName);
40 }
41 CModularFeatureRegistrar::SetRegistry(Params._PluginRegistry);
42
43 DyLibInstance = new (::uLang::CInstancedRawAllocator(&Params._Allocator))DyLibClass();
44 }
45 else
46 {
47 ULANG_ERRORF("Mismatched API version -- %s lib (v%d) needs to be rebuilt with an updated core version (expected: v%d).", LibName, ULANG_API_VERSION, Params._SysParams._APIVersion);
48 }
49 return DyLibInstance;
50 }
51
54
55} // namespace Private
56} // namespace uLang
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define ULANG_API_VERSION
To prevent API mismatch in dynamic linking situations.
Definition Common.h:63
#define ULANG_ERRORF(format,...)
Definition Common.h:289
#define ULANG_ASSERTF(expr, format,...)
Definition Common.h:290
Definition Allocator.h:35
Raw memory allocator that keeps a pointer to an allocator instance which is used for allocation.
Definition Allocator.h:92
Definition IToolchainPlugin.h:11
Definition ModularFeatureManager.inl:30
static VERSECOMPILER_API void SetRegistry(const TSRef< IModularFeatureRegistry > &NewRegistry)
Definition ModularFeatureManager.cpp:123
Definition SharedPointer.h:77
Definition OverriddenPropertySet.cpp:45
VERSECOMPILER_API void Init(int ArgC, char *ArgV[])
Definition CommandLine.cpp:49
DyLibClass * InitVToolchainPlugin(const SToolchainPluginParams &Params, const char *LibName)
Definition IToolchainPlugin.inl:27
int32_t(*)() ToolchainPluginGetVerPtr
Definition IToolchainPlugin.inl:52
::uLang::IToolchainPlugin *(*)(const SToolchainPluginParams &) ToolchainPluginInitPtr
Definition IToolchainPlugin.inl:53
Definition VVMEngineEnvironment.h:23
SSystemParams & GetSystemParams()
Global variable for efficient access.
Definition Common.cpp:9
bool IsInitialized()
Definition Common.cpp:39
EResult Initialize(const SSystemParams &Params)
Definition Common.cpp:30
Definition IToolchainPlugin.inl:12
CAllocatorInstance & _Allocator
Definition IToolchainPlugin.inl:21
SToolchainPluginParams(CAllocatorInstance &InAllocator)
Definition IToolchainPlugin.inl:13
const SSystemParams & _SysParams
Definition IToolchainPlugin.inl:20
const SCommandLine & _CommandLine
Definition IToolchainPlugin.inl:23
TSRef< IModularFeatureRegistry > _PluginRegistry
Definition IToolchainPlugin.inl:22
Definition CompilerTypes.h:93
Parameters to initialize the uLang module.
Definition Common.h:403