Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
Loading...
Searching...
No Matches
aria::abi Namespace Reference

Classes

class  SignalErased
 Type-erased multi-cast signal. More...
class  SlotErased
 Type-erased callback wrapper. More...
struct  SlotId
 Opaque slot identifier returned when a callback is registered with a Signal. More...

Typedefs

using SlotInvokeFailureHook = void (*)(std::exception_ptr)
 Hook invoked when the slot trampoline catches an exception escaping the user callable.

Functions

SlotInvokeFailureHook set_slot_invoke_failure_hook (SlotInvokeFailureHook hook) noexcept
 Install (or replace) the slot-invoke failure hook.
template<class Fn>
SlotErased make_slot_erased (Fn &&fn)
 Build a SlotErased from a callable that takes a raw void* args.
template<class Bag, class Fn>
SlotErased make_slot_for (Fn &&fn)
 Build a SlotErased from a callable that takes const Bag&.
int runtime_abi_version () noexcept
 ABI version of the loaded aria library.
const char * runtime_version_string () noexcept
 Release version string of the loaded aria library ("2.0.0").
bool abi_matches_headers () noexcept
 True iff the loaded library's ABI version matches the headers this translation unit was compiled against.

Variables

constexpr int version_major = ARIA_VERSION_MAJOR
constexpr int version_minor = ARIA_VERSION_MINOR
constexpr int version_patch = ARIA_VERSION_PATCH
constexpr int abi_version = ARIA_ABI_VERSION
constexpr const char * version_string = ARIA_VERSION_STRING

Typedef Documentation

◆ SlotInvokeFailureHook

using aria::abi::SlotInvokeFailureHook = void (*)(std::exception_ptr)

Hook invoked when the slot trampoline catches an exception escaping the user callable.

The implementation is provided by upper layers (core's callback_boundary) at process startup. Installing nullptr uses the unified callback-failure reporter. Hooks should avoid throwing; exceptions from a hook fall back to the unified reporter.

Function Documentation

◆ set_slot_invoke_failure_hook()

SlotInvokeFailureHook aria::abi::set_slot_invoke_failure_hook ( SlotInvokeFailureHook hook)
inlinenoexcept

Install (or replace) the slot-invoke failure hook.

Returns the previously installed hook (nullptr if none).

◆ make_slot_erased()

template<class Fn>
SlotErased aria::abi::make_slot_erased ( Fn && fn)
nodiscard

Build a SlotErased from a callable that takes a raw void* args.

The callable is heap-allocated and owned by the returned slot.

◆ make_slot_for()

template<class Bag, class Fn>
SlotErased aria::abi::make_slot_for ( Fn && fn)
nodiscard

Build a SlotErased from a callable that takes const Bag&.

The cast from the wire void* happens inside the trampoline.

◆ runtime_abi_version()

int aria::abi::runtime_abi_version ( )
nodiscardnoexcept

ABI version of the loaded aria library.

Compare against the ARIA_ABI_VERSION your translation unit was compiled with.

◆ runtime_version_string()

const char * aria::abi::runtime_version_string ( )
nodiscardnoexcept

Release version string of the loaded aria library ("2.0.0").

◆ abi_matches_headers()

bool aria::abi::abi_matches_headers ( )
inlinenodiscardnoexcept

True iff the loaded library's ABI version matches the headers this translation unit was compiled against.

Intended for a startup assertion in hosts that load aria dynamically:

if (!aria::abi::abi_matches_headers()) {
    std::fprintf(stderr, "aria ABI mismatch: headers %d, library %d\n",
                 aria::abi::abi_version,
                 aria::abi::runtime_abi_version());
    return 1;
} 

Variable Documentation

◆ version_major

int aria::abi::version_major = ARIA_VERSION_MAJOR
constexpr

◆ version_minor

int aria::abi::version_minor = ARIA_VERSION_MINOR
constexpr

◆ version_patch

int aria::abi::version_patch = ARIA_VERSION_PATCH
constexpr

◆ abi_version

int aria::abi::abi_version = ARIA_ABI_VERSION
constexpr

◆ version_string

const char* aria::abi::version_string = ARIA_VERSION_STRING
constexpr