7#include "UObject/SoftObjectPath.h"
12struct FModExtensionWorld;
19struct FRegistrationState;
55 TArray<FAPIDescriptor>
APIs;
92 friend class FRegistry;
93 friend class FGeneratedHostRegistration;
94 TSharedPtr<FRegistrationState> State;
101 friend class FRegistry;
102 TSharedPtr<FScopeState> State;
109 friend class FRegistry;
110 friend struct FHostAccess;
111 friend struct FNativeAccess;
112 TSharedPtr<FCallerState> State;
172 UObject* Instance, TWeakPtr<FModExtensionWorld> World = {});
174 const FScope& Scope, UObject* Instance,
175 TWeakPtr<FModExtensionWorld> World);
176 bool HasServiceType(FName TypeId,
const TCHAR* Signature)
const;
178 const TCHAR* Signature);
181 const TCHAR* Signature,
bool bReadOnly,
bool bWorldOwned =
false);
192 UObject* Instance,
bool bAllowBeforeBeginPlay =
false,
193 TWeakPtr<FModExtensionWorld> World = {});
199 friend class ::UModAPIHostSubsystem;
201 TSharedPtr<FRegistryState> State;
213 if (!Binding.IsSuccess())
auto BindView(FRegistry &Registry, const FCaller &Caller)
Binds a generated service view once for a host-issued caller.
Definition ModAPIRegistry.h:209
EScope
Supported scope kinds for the synchronous UObject backend.
Definition ModAPIRegistry.h:23
@ Player
A provider belonging to a particular local player and world.
Definition ModAPIRegistry.h:27
@ World
An object belonging to a live world.
Definition ModAPIRegistry.h:25
The primary template has no API; MHT supplies closed specializations.
Definition ModAPIObject.h:50
A host-issued caller identity and permission grant.
Definition ModAPIRegistry.h:107
FRegistration(FRegistration &&Other) noexcept
Transfers registration ownership.
~FRegistration()
Revokes the registration.
FRegistration()=default
Creates an empty registration.
FRegistration & operator=(FRegistration &&Other) noexcept
Transfers registration ownership and revokes the previous value.
void Reset()
Revokes all bindings derived from this registration on the game thread.
Owns a session's generated definitions, providers, scopes, and callers.
Definition ModAPIRegistry.h:117
TModResult< void > RevokeCaller(const FCaller &Caller)
Revokes a caller and all views issued to it.
TModResult< FCaller > CreateCaller(const FScope &Scope, TSet< FName > Permissions)
Issues a caller with explicit host-granted permissions.
FRegistry()
Creates a registry on the game thread.
TModResult< FRegistration > RegisterProvider(FName TypeId, const FScope &Scope, UObject *Instance)
Registers an explicit service instance in a scope.
~FRegistry()
Revokes all derived bindings on the game thread.
TModResult< FObjectBinding > BindProvider(FName TypeId, const TCHAR *Signature, const FCaller &Caller)
Binds a registered provider once for a caller.
FSoftClassPath FindBlueprintWorldType(FName TypeId, FString &OutSignature) const
Reads an exported Blueprint World type without loading its class.
TModResult< FObjectBinding > BindWorldObject(const FCaller &Caller, UObject &Object, FName TypeId, const TCHAR *Signature, bool bReadOnly, bool bWorldOwned=false)
Projects a host-approved object into the caller's World view.
TModResult< FScope > OpenWorldScope(UWorld *World)
Opens a scope for a live world.
UClass * FindWorldType(FName TypeId, FString &OutSignature) const
Returns the registered World projection class to host code.
TModResult< FRegistration > RegisterType(FTypeDescriptor Descriptor)
Registers one generated type and its concrete calling table.
TModResult< FScope > OpenPlayerScope(ULocalPlayer *Player, const FScope &WorldScope)
Opens a local player scope in a particular world.
TModResult< void > CloseScope(const FScope &Scope)
Closes a scope and invalidates its bindings.
const FString * FindLocalPlayerSignature(FName TypeId) const
Finds an explicitly exported local-player provider signature.
A host-issued scope; a player scope also references its world scope.
Definition ModAPIRegistry.h:99
A synchronous API result containing either a value or a stable error.
Definition ModAPIResult.h:47
static TModResult Failure(Mod::API::EError InError)
Constructs a failed result.
Definition ModAPIResult.h:64
static TModResult Success(T InValue)
Constructs a successful result.
Definition ModAPIResult.h:53
Owns the generated API registry for one game instance.
Definition ModAPIHostSubsystem.h:52
A generated definition for registration and compatibility checks.
Definition ModAPIRegistry.h:32
const TCHAR * ExportVersion
Declared export version.
Definition ModAPIRegistry.h:36
const TCHAR * ExportId
Stable export ID.
Definition ModAPIRegistry.h:34
const TCHAR * Signature
Normalized generated signature.
Definition ModAPIRegistry.h:38
Host-only token access for generated fixed-signature C ABI bridges.
Definition ModAPINative.h:20
One generated object type and its immutable calling table.
Definition ModAPIRegistry.h:43
bool bFullView
Preserves read-only authority when this full view is projected.
Definition ModAPIRegistry.h:59
bool bAllowWorldless
Permits non-actor objects with no world in a world-bound view.
Definition ModAPIRegistry.h:57
UClass * Class
Actual host class.
Definition ModAPIRegistry.h:47
FString Signature
Generated calling table signature.
Definition ModAPIRegistry.h:51
FName TypeId
Stable source type identity.
Definition ModAPIRegistry.h:45
FSoftClassPath BlueprintClass
Cooked class identity resolved when a Blueprint provider is registered.
Definition ModAPIRegistry.h:65
const void * Calls
Module-owned table; valid until registration is revoked.
Definition ModAPIRegistry.h:53
TArray< FAPIDescriptor > APIs
Definitions owned by this type.
Definition ModAPIRegistry.h:55
bool bLocalPlayerSubsystem
Resolves this player-scoped service from the chosen local player.
Definition ModAPIRegistry.h:61
TConstArrayView< FBlueprintFunction > BlueprintFunctions
Module-owned reflection descriptions for Blueprint methods.
Definition ModAPIRegistry.h:63
EScope Scope
Required object scope.
Definition ModAPIRegistry.h:49
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