19 enum class assert_type
40 std::function<void(
const category&
category, assert_type eAssertType)> onExit =
47 std::function<verbosity(assert_type eAssertType)> getVerbosity = [](assert_type eAssertType)
51 case assert_type::assert:
52 case assert_type::verify:
53 return verbosity::critical;
55 case assert_type::expect:
56 case assert_type::ensure:
58 return verbosity::error;
63 string_view svCondition,
65 assert_type eAssertType,
66 string_view svUserMessage,
67 string_view svFunction,
72 bool bLogAssertion =
true;
88 string_view svCondition,
90 assert_type eAssertType,
92 string_view svFunction,
122 #define _QX_DEBUG_BREAK() __debugbreak()
124 #define _QX_DEBUG_BREAK() __builtin_debugtrap()
127 #define _QX_DEBUG_BREAK() raise(SIGTRAP)
129 #define _QX_DEBUG_BREAK() QX_EMPTY_MACRO
132 #ifndef QX_DEBUG_BREAK
133 #define QX_DEBUG_BREAK() _QX_DEBUG_BREAK()
136 #define _QX_COMMON_ASSERT(condition, category, assert_type, after_debug_break, result_t, ...) \
137 static_cast<result_t>( \
138 qx::predicates::is_valid(condition) \
139 || (qx::asserts_manager::get_instance().do_assert( \
143 _QX_MACRO_USER_MESSAGE(static_cast<qx::string_pool<>*>(nullptr), ##__VA_ARGS__).sValue, \
144 qx::convert_string_literal<qx::char_type, __FUNCTION__>(), \
149 after_debug_break(category, assert_type), \
152 #ifndef _QX_ASSERT_AFTER_DEBUG_BREAK_FATAL
153 #define _QX_ASSERT_AFTER_DEBUG_BREAK_FATAL(category, assert_type) \
154 qx::asserts_manager::get_instance().exit(category, assert_type)
157 #ifndef _QX_ASSERT_AFTER_DEBUG_BREAK_NON_FATAL
158 #define _QX_ASSERT_AFTER_DEBUG_BREAK_NON_FATAL(category, assert_type) false
161 #ifndef QX_WITH_DEBUG_ASSERTS
162 #define QX_WITH_DEBUG_ASSERTS QX_WITH_DEBUG_INFO
Determines assertions behavior.
void set_config(config config)
Set config.
void exit(const category &category, assert_type eAssertType)
Called in fatal assertions to exit the application.
bool do_assert(string_view svCondition, const category &category, assert_type eAssertType, string sUserMessage, string_view svFunction, string_view svFile, i32 nLine)
An entry point for all assertions.
const config & get_config() const
Get config.
A category is a class that identifies a particular piece of code. This code can be located in differe...
Inherit the necessary singleton class from this.
std::int32_t i32
− 9 223 372 036 854 775 808 .. 9 223 372 036 854 775 807