Helios Engine
A modular ECS based data-oriented C++23 game engine framework
Loading...
Searching...
No Matches
helios::details Namespace Reference

Classes

struct  TupleToFunctionSignature
struct  TupleToFunctionSignature< std::tuple< R, Args... > >
struct  FreeFunctionTraits
struct  FreeFunctionTraits< R(*)(Args...)>
struct  MemberFunctionTraits
 Traits for member function pointers (non-const and const). More...
struct  MemberFunctionTraits< R(C::*)(Args...)>
struct  MemberFunctionTraits< R(C::*)(Args...) const >

Functions

std::string FormatAssertionMessage (std::string_view condition, const std::source_location &loc, std::string_view message)
 Formats a complete assertion failure message with source location and stack trace.
void DefaultAssertionHandler (std::string_view condition, const std::source_location &loc, std::string_view message) noexcept
 Default assertion handler that prints to stderr.
bool HasLogPluginHandler () noexcept
 Log plugin assertion handler (weak symbol).
void LogPluginAssertionHandler (std::string_view condition, const std::source_location &loc, std::string_view message) noexcept
 Weak symbol for log plugin assertion handler.
void HandleAssertion (std::string_view condition, const std::source_location &loc, std::string_view message) noexcept
 Unified assertion handling function.

Variables

constexpr bool kEnableAssert = false
AssertionHandler g_custom_assertion_handler = nullptr
 Storage for the custom assertion handler.

Function Documentation

◆ DefaultAssertionHandler()

void helios::details::DefaultAssertionHandler ( std::string_view condition,
const std::source_location & loc,
std::string_view message )
inlinenoexcept

Default assertion handler that prints to stderr.

Parameters
conditionThe failed condition as a string
locSource location of the assertion
messageAdditional message

Definition at line 68 of file assert.hpp.

◆ FormatAssertionMessage()

std::string helios::details::FormatAssertionMessage ( std::string_view condition,
const std::source_location & loc,
std::string_view message )
nodiscard

Formats a complete assertion failure message with source location and stack trace.

Parameters
conditionThe failed condition as a string
locSource location of the assertion
messageAdditional message (may be empty)
Returns
Formatted assertion message

Definition at line 37 of file assert.cpp.

◆ HandleAssertion()

void helios::details::HandleAssertion ( std::string_view condition,
const std::source_location & loc,
std::string_view message )
inlinenoexcept

Unified assertion handling function.

Priority order:

  1. Custom handler (if set by user via SetAssertionHandler)
  2. Log plugin handler (if log module/plugin is available and linked)
  3. Default handler (prints to stderr)
Parameters
conditionThe failed condition as a string
locSource location of the assertion
messageAdditional message

Definition at line 147 of file assert.hpp.

◆ HasLogPluginHandler()

bool helios::details::HasLogPluginHandler ( )
noexcept

Log plugin assertion handler (weak symbol).

Override weak symbol to indicate log plugin is available.

This is defined as a weak symbol that defaults to nullptr. When the log plugin is linked, it will provide the real implementation. The implementation should log via the logger system with critical level.

Parameters
conditionThe failed condition as a string
locSource location of the assertion
messageAdditional message

Weak symbol for log plugin handler check.

The log plugin provides the real implementation.

Returns
true if the log plugin handler is available

Definition at line 116 of file assert.cpp.

◆ LogPluginAssertionHandler()

void helios::details::LogPluginAssertionHandler ( std::string_view condition,
const std::source_location & loc,
std::string_view message )
noexcept

Weak symbol for log plugin assertion handler.

Override weak symbol to provide log plugin assertion handling.

The log plugin provides the real implementation.

Definition at line 123 of file assert.cpp.

Variable Documentation

◆ g_custom_assertion_handler

AssertionHandler helios::details::g_custom_assertion_handler = nullptr
inline

Storage for the custom assertion handler.

When set, this handler is called instead of the default behavior. The handler can be set by calling SetAssertionHandler().

Definition at line 60 of file assert.hpp.

◆ kEnableAssert

bool helios::details::kEnableAssert = false
inlineconstexpr

Definition at line 40 of file assert.hpp.