![]() |
IRSOL
C++ code implementing socket server for interacting with Baumer camera.
|
Assertion macros, types, and functions for the irsol library. More...
Files | |
file | assert.hpp |
Assertion macros and utilities based on the PPK_ASSERT library. | |
Macros | |
#define | IRSOL_ASSERT_DEBUG PPK_ASSERT_DEBUG |
Debug-level assertion macro. | |
#define | IRSOL_ASSERT_ERROR PPK_ASSERT_ERROR |
Error-level assertion macro. | |
#define | IRSOL_ASSERT_FATAL PPK_ASSERT_FATAL |
Fatal-level assertion macro. | |
#define | IRSOL_ASSERT_FALSE(message) IRSOL_ASSERT_FATAL(false, message) |
Assertion macro that always fails fatally. | |
#define | IRSOL_STATIC_ASSERT PPK_STATIC_ASSERT |
Compile-time static assertion macro. | |
Functions | |
void | irsol::setAssertHandler (AssertHandler handler) |
Sets a custom assertion handler function. | |
void | irsol::initAssertHandler () |
Initializes the assertion handler system. | |
ppk::assert::implementation::AssertAction::AssertAction | irsol::internal::assertHandler (const char *file, int line, const char *function, const char *expression, int level, const char *message) |
Internal default assertion handler implementation. | |
Assertion macros, types, and functions for the irsol library.
Provides compile-time and runtime assertion mechanisms using the PPK_ASSERT library.
#define IRSOL_ASSERT_DEBUG PPK_ASSERT_DEBUG |
Debug-level assertion macro.
Prints assertion failure details to the console and allows interactive user action (e.g., ignore, retry, abort). Typically used for non-critical conditions during development.
Usage:
Definition at line 133 of file assert.hpp.
#define IRSOL_ASSERT_ERROR PPK_ASSERT_ERROR |
Error-level assertion macro.
Prints assertion failure details to the console and throws an exception of type irsol::AssertionException
. Use for recoverable error conditions that should be handled via exception handling.
Usage:
Definition at line 134 of file assert.hpp.
#define IRSOL_ASSERT_FALSE | ( | message | ) | IRSOL_ASSERT_FATAL(false, message) |
Assertion macro that always fails fatally.
Prints the provided message and terminates the program immediately. Useful for marking code paths that should never be reached.
Usage:
Definition at line 136 of file assert.hpp.
#define IRSOL_ASSERT_FATAL PPK_ASSERT_FATAL |
Fatal-level assertion macro.
Prints assertion failure details to the console and immediately terminates the program. Use for unrecoverable conditions that require aborting execution.
Usage:
Definition at line 135 of file assert.hpp.
#define IRSOL_STATIC_ASSERT PPK_STATIC_ASSERT |
Compile-time static assertion macro.
Evaluates the condition at compile time and terminates compilation if the condition is false, printing the provided message.
Usage:
Definition at line 138 of file assert.hpp.
ppk::assert::implementation::AssertAction::AssertAction irsol::internal::assertHandler | ( | const char * | file, |
int | line, | ||
const char * | function, | ||
const char * | expression, | ||
int | level, | ||
const char * | message | ||
) |
Internal default assertion handler implementation.
Handles assertion failures by processing and dispatching them according to the current assertion policy.
This function should not be called directly; it is called by the PPK_ASSERT framework internally.
file | The source file of the assertion failure. |
line | The line number of the failure. |
function | The function containing the assertion. |
expression | The asserted expression. |
level | The assertion severity level. |
message | Optional descriptive message. |
Definition at line 22 of file assert.cpp.
void irsol::initAssertHandler | ( | ) |
Initializes the assertion handler system.
Call this to configure any required internal state before assertions are used. Typically called at program startup.
Sets a custom assertion handler that captures assertions, and based on the build type reacts to them.
Definition at line 14 of file assert.cpp.
void irsol::setAssertHandler | ( | AssertHandler | handler | ) |
Sets a custom assertion handler function.
This function installs a user-defined callback that is invoked whenever an assertion fails. The handler controls the response behavior.
handler | The user-defined assertion handler to set. |