UnrealModFramework
Mod framework API
Loading...
Searching...
No Matches
ModNativeLibrary.h
Go to the documentation of this file.
1// Copyright (c) 2026 Nelaric Contributors
3#pragma once
4
5#include "Containers/UnrealString.h"
6#include "ModExtensionABI.h"
7
8namespace Mod::Loader
9{
10struct FMountedPackage;
11
14{
15 UMF_ExtensionEntryV1 V1 = nullptr;
16 UMF_ExtensionEntryV2 V2 = nullptr;
17};
18
20class MODLOADER_API FNativeLibrary final
21{
22public:
24 FNativeLibrary() = default;
31
37 FNativeEntries Open(const FMountedPackage& Package, FString& Error);
39 bool IsOpen() const
40 {
41 return Library != nullptr;
42 }
43
44 void Close();
45
46private:
47 void* Library = nullptr;
48};
49} // namespace Mod::Loader
uint32_t(UMF_EXTENSION_CALL *) UMF_ExtensionEntryV2(const UMF_ExtensionHostV2 *Host, uint64_t Session, UMF_ExtensionSessionV2 *Out)
Registers a native SDK World session against a compatible host table.
Definition ModExtensionABI.h:340
uint32_t(UMF_EXTENSION_CALL *) UMF_ExtensionEntryV1(const UMF_ExtensionHostV1 *Host, uint64_t Session, UMF_ExtensionSessionV1 *Out)
Registers the extension's World callbacks and returns its session teardown.
Definition ModExtensionABI.h:168
FNativeLibrary & operator=(const FNativeLibrary &)=delete
Library ownership cannot be reassigned by copying.
bool IsOpen() const
Whether the callbacks are resident.
Definition ModNativeLibrary.h:39
FNativeEntries Open(const FMountedPackage &Package, FString &Error)
Acquires the selected extension without registering callbacks.
~FNativeLibrary()
Releases any library still held by this session.
void Close()
Releases the extension after callback teardown.
FNativeLibrary(const FNativeLibrary &)=delete
Library ownership cannot be copied.
FNativeLibrary()=default
Starts without a loaded extension.
Content described by a mounted mod package.
Definition ModLoader.h:113
Registration entry points discovered in a verified native image.
Definition ModNativeLibrary.h:14