An internal message class used for assertion failures.
More...
#include <SurgSim/Framework/AssertMessage.h>
|
typedef void(* | DeathCallback) (const std::string &message) |
| The type used for the callback function that is triggered after an assertion has failed. More...
|
|
|
static void | throwException (const std::string &errorMessage) |
| Kill the application by throwing an exception. More...
|
|
static void | killApplication (const std::string &errorMessage) |
| Enter the debugger or kill the application in a system-dependent way. More...
|
|
An internal message class used for assertion failures.
Dies after logging.
typedef void(* SurgSim::Framework::AssertMessage::DeathCallback) (const std::string &message) |
The type used for the callback function that is triggered after an assertion has failed.
SurgSim::Framework::AssertMessage::AssertMessage |
( |
Logger * |
logger | ) |
|
|
inlineexplicit |
Constructor.
- Parameters
-
logger | Logger used to log this message. |
SurgSim::Framework::AssertMessage::AssertMessage |
( |
const std::unique_ptr< Logger > & |
logger | ) |
|
|
inlineexplicit |
Constructor.
- Parameters
-
logger | Logger used to log this message. |
SurgSim::Framework::AssertMessage::AssertMessage |
( |
const std::shared_ptr< Logger > & |
logger | ) |
|
|
inlineexplicit |
Constructor.
- Parameters
-
logger | Logger used to log this message. |
SurgSim::Framework::AssertMessage::~AssertMessage |
( |
| ) |
|
|
inlinenoexcept |
Destructor, which may throw an exception if the failure behavior does.
C++11 introduced noexcept
Get the callback that will currently be called after an assertion has failed.
Thread-unsafe if called concurrently from multiple threads, or concurrently with a failing assertion.
- Returns
- The callback.
void SurgSim::Framework::AssertMessage::killApplication |
( |
const std::string & |
errorMessage | ) |
|
|
staticprivate |
Enter the debugger or kill the application in a system-dependent way.
- Parameters
-
errorMessage | Message describing the error (which will be ignored). |
static void SurgSim::Framework::AssertMessage::setFailureBehaviorToDeath |
( |
| ) |
|
|
inlinestatic |
After an assertion has failed, enter the debugger or kill the application in a system-dependent way.
Thread-unsafe if called concurrently from multiple threads, or concurrently with a failing assertion.
static void SurgSim::Framework::AssertMessage::setFailureBehaviorToThrow |
( |
| ) |
|
|
inlinestatic |
After an assertion has failed, throw a C++ exception.
Thread-unsafe if called concurrently from multiple threads, or concurrently with a failing assertion.
After an assertion has failed, call some arbitrary function.
The callback function should cause the application (or at least the current thread) to terminate.
Thread-unsafe if called concurrently from multiple threads, or concurrently with a failing assertion.
void SurgSim::Framework::AssertMessage::throwException |
( |
const std::string & |
errorMessage | ) |
|
|
staticprivate |
Kill the application by throwing an exception.
- Parameters
-
errorMessage | Message describing the error. |
The callback function that is triggered after an assertion has failed.
Thread-unsafe if called concurrently from multiple threads.
The documentation for this class was generated from the following files: