16 #ifndef SURGSIM_FRAMEWORK_ASSERTMESSAGE_H
17 #define SURGSIM_FRAMEWORK_ASSERTMESSAGE_H
124 #endif // SURGSIM_FRAMEWORK_ASSERTMESSAGE_H
Definition: DriveElementFromInputBehavior.cpp:27
AssertMessage(const std::shared_ptr< Logger > &logger)
Constructor.
Definition: AssertMessage.h:65
void(* DeathCallback)(const std::string &message)
The type used for the callback function that is triggered after an assertion has failed.
Definition: AssertMessage.h:49
static void setFailureCallback(DeathCallback callback)
After an assertion has failed, call some arbitrary function.
Definition: AssertMessage.cpp:31
static DeathCallback getFailureCallback()
Get the callback that will currently be called after an assertion has failed.
Definition: AssertMessage.cpp:36
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
static void killApplication(const std::string &errorMessage)
Enter the debugger or kill the application in a system-dependent way.
Definition: AssertMessage.cpp:46
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
void flush()
write the current message to the logger
Definition: LogMessageBase.h:89
static void throwException(const std::string &errorMessage)
Kill the application by throwing an exception.
Definition: AssertMessage.cpp:41
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
std::string getMessage()
Definition: LogMessageBase.h:83
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