![]() |
ImFusion C++ SDK 4.4.0
|
Assertion library. More...
Assertion library.
More powerful and flexible alternative to the basic assert() of the C standard library. The assertion macro takes a condition to check and an optional message to display on failure.
Assertions are only checked if IMFUSION_ENABLE_ASSERTIONS is defined.
As a library developer you can register a custom HanderFunction that should be called in case an assertion fails. The default handler function will print an error message to std::cout and offer the user the choice of ignoring once, ignoring always, debug trap, or quitting the application.
Macros | |
| #define | IMFUSION_ASSERT(...) |
| ImFusion assertion macro, supports two overloads: | |
Typedefs | |
| using | ImFusion::Assert::HandlerFunction |
| Alias for a function pointer that can be used to handle trapped assertions. | |
Functions | |
| HandlerFunction | ImFusion::Assert::handler () |
| Returns the currently set assertion handler function. | |
| void | ImFusion::Assert::setHandler (HandlerFunction handler) |
| Sets the assertion handler function to use. | |
| void | ImFusion::Assert::defaultHandler (const char *condition, const char *message, const char *fileName, const char *functionName, int line) |
| Handler function that is used by default to handle trapped assertions. | |
| #define IMFUSION_ASSERT | ( | ... | ) |
#include <ImFusion/Core/Assert.h>
ImFusion assertion macro, supports two overloads:
Assertions are only checked if IMFUSION_ENABLE_ASSERTIONS is defined.
#include <ImFusion/Core/Assert.h>
Alias for a function pointer that can be used to handle trapped assertions.
| condition | Verbatim code of the assertion condition that trapped. |
| message | Message that was attached to the assertion. |
| fileName | Filename in which the assertion trapped. |
| functionName | Function name where the assertion trapped. |
| line | Line number in fileName where the assertion trapped. |
| HandlerFunction ImFusion::Assert::handler | ( | ) |
#include <ImFusion/Core/Assert.h>
Returns the currently set assertion handler function.
| void ImFusion::Assert::setHandler | ( | HandlerFunction | handler | ) |
#include <ImFusion/Core/Assert.h>
Sets the assertion handler function to use.
| void ImFusion::Assert::defaultHandler | ( | const char * | condition, |
| const char * | message, | ||
| const char * | fileName, | ||
| const char * | functionName, | ||
| int | line ) |
#include <ImFusion/Core/Assert.h>
Handler function that is used by default to handle trapped assertions.
Will offer the user the choice of ignoring once, ignoring always, debug trap, or quitting the application.