UnrealModFramework
Mod framework API
Loading...
Searching...
No Matches
ModAPIObject.h
Go to the documentation of this file.
1// Copyright (c) 2026 Nelaric Contributors
3#pragma once
4
5#include "ModAPIResult.h"
6
7namespace Mod::API
8{
9struct FBindingState;
10struct FHostAccess;
11struct FNativeAccess;
12struct FViewFactory;
14template <class T> struct TBindingTraits;
15
17class MODAPI_API FObjectBinding
18{
19public:
25 TModResult<const void*> ResolveCalls(FName TypeId, const TCHAR* Signature) const;
27 TModResult<FObjectBinding> Borrow(TWeakPtr<const uint8> Lifetime) const;
28
29private:
30 friend class FRegistry;
31 friend struct FHostAccess;
32 friend struct FNativeAccess;
33 friend struct FViewFactory;
34 TSharedPtr<FBindingState> State;
35};
36
39{
45 template <class T> static auto Make(FObjectBinding Binding);
46};
47} // namespace Mod::API
48
50template <class T> class FModRuntimeObject;
51
52template <class T> auto Mod::API::FViewFactory::Make(FObjectBinding Binding)
53{
54 return FModRuntimeObject<T>(MoveTemp(Binding));
55}
The primary template has no API; MHT supplies closed specializations.
Definition ModAPIObject.h:50
An opaque, non-owning object binding with a cached typed calling table.
Definition ModAPIObject.h:18
TModResult< const void * > ResolveCalls(FName TypeId, const TCHAR *Signature) const
Validates and reads the cached calling table on the game thread.
TModResult< FObjectBinding > Borrow(TWeakPtr< const uint8 > Lifetime) const
Gets a read-only binding with a callback-owned lifetime.
A synchronous API result containing either a value or a stable error.
Definition ModAPIResult.h:47
Host-only operations used by concrete generated calling bridges.
Definition ModAPIHost.h:66
Host-only token access for generated fixed-signature C ABI bridges.
Definition ModAPINative.h:20
Constructs the generated specialization without exposing an object pointer.
Definition ModAPIObject.h:39
static auto Make(FObjectBinding Binding)
Constructs a typed view from an already authorized binding.
Definition ModAPIObject.h:52
Specialized by MHT with stable type and calling-table identities.
Definition ModAPIObject.h:14