16 #ifndef SURGSIM_FRAMEWORK_ASSERTMESSAGE_H 17 #define SURGSIM_FRAMEWORK_ASSERTMESSAGE_H 21 #include "SurgSim/Framework/LogMessageBase.h" 49 typedef void (*DeathCallback)(
const std::string& message);
72 #if defined(_MSC_VER) && _MSC_VER < 1912 79 m_killMeNow(getMessage());
86 static void setFailureCallback(DeathCallback callback);
91 static DeathCallback getFailureCallback();
97 setFailureCallback(throwException);
104 setFailureCallback(killApplication);
110 static void throwException(
const std::string& errorMessage);
114 static void killApplication(
const std::string& errorMessage);
119 static DeathCallback m_killMeNow;
126 #endif // SURGSIM_FRAMEWORK_ASSERTMESSAGE_H Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
AssertMessage(const std::shared_ptr< Logger > &logger)
Constructor.
Definition: AssertMessage.h:65
Definition: MockObjects.h:47
static void setFailureBehaviorToDeath()
After an assertion has failed, enter the debugger or kill the application in a system-dependent way...
Definition: AssertMessage.h:102
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:75
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:95
LogMessageBase is a base class to be used to customize messages for logging textual information can b...
Definition: LogMessageBase.h:40