UnrealModFramework
Mod framework API
Loading...
Searching...
No Matches
ModExportMacros.h File Reference

Source markers for Mod API, event, and hook declarations. More...

Go to the source code of this file.

Macros

#define MOD_EXPORT_API(...)
 Marks a function as a Mod API declaration.
#define MOD_EXPORT_EVENT(...)
 Marks an event source or signature as a Mod event declaration.
#define MOD_SOURCE_FAILURE(Name, Code, Value)
 Marks a business failure with its native return value.
#define MOD_EXPORT_HOOK(...)
 Marks a method for generated Pre, On and Post dispatch.

Functions

template<typename T>
constexpr T Mod::ExportMetadata::SourceFailure (const char *, unsigned int Code, T Value) noexcept
 Returns the native value and records the explicit business error.

Detailed Description

Source markers for Mod API, event, and hook declarations.

The export tools read API and Event metadata and generate Hook dispatch from the marked method. A source failure also reports its error to the active generated native call. Use explicit Unreal reflection macros when reflection is required.

Macro Definition Documentation

◆ MOD_EXPORT_API

#define MOD_EXPORT_API ( ...)

Marks a function as a Mod API declaration.

Parameters
...Metadata tokens reserved for the export generator.

◆ MOD_EXPORT_EVENT

#define MOD_EXPORT_EVENT ( ...)

Marks an event source or signature as a Mod event declaration.

Parameters
...Metadata tokens reserved for the export generator.

◆ MOD_EXPORT_HOOK

#define MOD_EXPORT_HOOK ( ...)
Value:
static_assert(::Mod::ExportMetadata::Private::HasValidHookFields("" #__VA_ARGS__), \
"MOD_EXPORT_HOOK accepts NoPre, NoOn, NoPost and CompatibleNames = (...) once each");

Marks a method for generated Pre, On and Post dispatch.

Parameters
...NoPre, NoOn, NoPost, or a CompatibleNames list.

◆ MOD_SOURCE_FAILURE

#define MOD_SOURCE_FAILURE ( Name,
Code,
Value )
Value:
constexpr T SourceFailure(const char *, unsigned int Code, T Value) noexcept
Returns the native value and records the explicit business error.
Definition ModExportMacros.h:51

Marks a business failure with its native return value.

Parameters
NameStable, uppercase MOD_ERROR_* name published in the SDK.
CodeFixed numeric code in the Business domain.
ValueNative failure value returned from the API.