16 #ifndef SURGSIM_FRAMEWORK_ASSERTMESSAGE_H 17 #define SURGSIM_FRAMEWORK_ASSERTMESSAGE_H 49 typedef void (*DeathCallback)(
const std::string& message);
77 m_killMeNow(getMessage());
84 static void setFailureCallback(DeathCallback callback);
89 static DeathCallback getFailureCallback();
95 setFailureCallback(throwException);
102 setFailureCallback(killApplication);
108 static void throwException(
const std::string& errorMessage);
112 static void killApplication(
const std::string& errorMessage);
124 #endif // SURGSIM_FRAMEWORK_ASSERTMESSAGE_H Definition: CompoundShapeToGraphics.cpp:29
AssertMessage(const std::shared_ptr< Logger > &logger)
Constructor.
Definition: AssertMessage.h:65
static DeathCallback m_killMeNow
The callback function that is triggered after an assertion has failed.
Definition: AssertMessage.h:117
static void setFailureBehaviorToDeath()
After an assertion has failed, enter the debugger or kill the application in a system-dependent way...
Definition: AssertMessage.h:100
AssertionFailure(const std::string &message)
Constructor.
Definition: AssertMessage.h:37
An exception class thrown by SURGSIM_ASSERT() failures and SURGSIM_FAILURE().
Definition: AssertMessage.h:32
~AssertMessage() noexcept(false)
Destructor, which may throw an exception if the failure behavior does.
Definition: AssertMessage.h:73
AssertMessage(Logger *logger)
Constructor.
Definition: AssertMessage.h:53
An object that can be used to control logging parameters, such as verbosity and log output destinatio...
Definition: Logger.h:51
Used by assertion, after using this level the program will not be functional at all.
Definition: Logger.h:47
An internal message class used for assertion failures.
Definition: AssertMessage.h:45
AssertMessage(const std::unique_ptr< Logger > &logger)
Constructor.
Definition: AssertMessage.h:59
static void setFailureBehaviorToThrow()
After an assertion has failed, throw a C++ exception.
Definition: AssertMessage.h:93
LogMessageBase is a base class to be used to customize messages for logging textual information can b...
Definition: LogMessageBase.h:40