Core assertion facility for the Ethereal framework.
Declares the data model and the dispatch entry points through which every Ethereal assertion failure is reported and resolved. This header does not define the assert macros themselves, see AssertMacros.hpp for those.
Model:
- SAssertSite: the immutable, per call site description of an assertion. One instance exists per assert in the binary, is constant initialized and lives in read only storage. It is the stable identity of a call site, which is what allows the system to offer "ignore this site" and per site hit counting.
- SAssertSiteState: the mutable counterpart of a site. Holds the ignore latch and the hit counter. Mutated through atomics by the implementation, never by the caller.
- SAssertData: the full description of a single failure, built by the implementation and handed to listeners and to the policy. Plain old data, versioned through
uStructSize so the layout can grow without breaking an already shipped integration.
Dispatch is split in two, deliberately:
- Listeners observe. Any number can be installed, they return nothing, and they exist to log, to feed telemetry or to write a crash dump. Registration order is honoured through priority.
- The policy decides. Exactly one is installed at a time and it returns the EAssertAction that resolves the failure. Splitting the two removes the ambiguity of a reporting callback that also gets to control program flow.
ABI: The registration surface is a C ABI, a function pointer plus an opaque context pointer. This is intentional. The framework ships as both a static (.lib) and a dynamic (.dll) build and cannot place virtual table layout inside its contract, since the integrator may build with a different toolchain. The virtual interfaces below (IAssertListener, IAssertPolicy) are a convenience layer implemented on top of that C ABI through a trampoline, and are safe only when the listener object is compiled by the same toolchain that consumes it.
Callbacks are deliberately not declared noexcept. Under C++17 the exception specification is part of the function type, so marking the typedef would prevent a plain function from being installed and would change the type identity between language modes. The contract is enforced by documentation: an exception must never escape a callback.
Copyright (C) Typename Studios LLC. All Rights Reserved.