22 enum class assert_type
43 std::function<void(
const category&
category, assert_type eAssertType)> onExit =
50 std::function<verbosity(assert_type eAssertType)> getVerbosity = [](assert_type eAssertType)
54 case assert_type::assert:
55 case assert_type::verify:
56 return verbosity::critical;
58 case assert_type::expect:
59 case assert_type::ensure:
61 return verbosity::error;
66 string_view svCondition,
68 assert_type eAssertType,
69 string_view svUserMessage,
70 string_view svFunction,
75 bool bLogAssertion =
true;
91 string_view svCondition,
93 assert_type eAssertType,
94 string_view svUserMessage,
95 string_view svFunction,
125 #define _QX_DEBUG_BREAK() __debugbreak()
127 #define _QX_DEBUG_BREAK() __builtin_debugtrap()
130 #define _QX_DEBUG_BREAK() raise(SIGTRAP)
132 #define _QX_DEBUG_BREAK() QX_EMPTY_MACRO
135 #ifndef QX_DEBUG_BREAK
136 #define QX_DEBUG_BREAK() _QX_DEBUG_BREAK()
140 #define _QX_COMMON_ASSERT(condition, category, assert_type, after_debug_break, result_t, ...) \
141 static_cast<result_t>( \
142 qx::predicates::is_valid(condition) \
143 || (qx::asserts_manager::get_instance().do_assert( \
147 _QX_ASSERT_USER_MESSAGE(__VA_ARGS__), \
148 qx::to_string(__FUNCTION__), \
153 after_debug_break(category, assert_type), \
156 #ifndef _QX_ASSERT_AFTER_DEBUG_BREAK_FATAL
157 #define _QX_ASSERT_AFTER_DEBUG_BREAK_FATAL(category, assert_type) \
158 qx::asserts_manager::get_instance().exit(category, assert_type)
161 #ifndef _QX_ASSERT_AFTER_DEBUG_BREAK_NON_FATAL
162 #define _QX_ASSERT_AFTER_DEBUG_BREAK_NON_FATAL(category, assert_type) false
165 #ifndef QX_WITH_DEBUG_ASSERTS
166 #define QX_WITH_DEBUG_ASSERTS QX_WITH_DEBUG_INFO
Determines assertions behavior.
bool do_assert(string_view svCondition, const category &category, assert_type eAssertType, string_view svUserMessage, string_view svFunction, string_view svFile, i32 nLine)
An entry point for all assertions.
void set_config(config config)
Set config.
void exit(const category &category, assert_type eAssertType)
Called in fatal assertions to exit the application.
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