iMSTK
Interactive Medical Simulation Toolkit
Public Types | Public Member Functions | Static Public Member Functions | List of all members
imstk::AssertMessage Class Reference
Inheritance diagram for imstk::AssertMessage:
Inheritance graph
[legend]
Collaboration diagram for imstk::AssertMessage:
Collaboration graph
[legend]

Public Types

typedef void(* DeathCallback) (const std::string &message)
 The type used for the callback function that is triggered after an assertion has failed.
 

Public Member Functions

 AssertMessage (LoggerSynchronous *logger)
 
 AssertMessage (const std::unique_ptr< LoggerSynchronous > &logger)
 
 AssertMessage (const std::shared_ptr< LoggerSynchronous > &logger)
 
- Public Member Functions inherited from imstk::LogMessageBase
 LogMessageBase (LoggerSynchronous *logger, int level)
 
template<typename T >
LogMessageBaseoperator<< (T &&input)
 
LogMessageBaseoperator<< (std::ios_base &(*manipulator)(std::ios_base &))
 
LogMessageBaseoperator<< (std::ostream &(*manipulator)(std::ostream &))
 

Static Public Member Functions

static void setFailureCallback (DeathCallback callback)
 
static DeathCallback getFailureCallback ()
 
static void setFailureBehaviorToThrow ()
 
static void setFailureBehaviorToDeath ()
 

Additional Inherited Members

- Protected Member Functions inherited from imstk::LogMessageBase
std::string getMessage ()
 
void flush ()
 write the current message to the logger
 

Detailed Description

Definition at line 271 of file imstkLoggerSynchronous.h.

Constructor & Destructor Documentation

◆ AssertMessage() [1/3]

imstk::AssertMessage::AssertMessage ( LoggerSynchronous logger)
inlineexplicit

Constructor.

Parameters
loggerLogger used to log this message.

Definition at line 279 of file imstkLoggerSynchronous.h.

◆ AssertMessage() [2/3]

imstk::AssertMessage::AssertMessage ( const std::unique_ptr< LoggerSynchronous > &  logger)
inlineexplicit

Constructor.

Parameters
loggerLogger used to log this message.

Definition at line 285 of file imstkLoggerSynchronous.h.

◆ AssertMessage() [3/3]

imstk::AssertMessage::AssertMessage ( const std::shared_ptr< LoggerSynchronous > &  logger)
inlineexplicit

Constructor.

Parameters
loggerLogger used to log this message.

Definition at line 291 of file imstkLoggerSynchronous.h.

Member Function Documentation

◆ getFailureCallback()

AssertMessage::DeathCallback imstk::AssertMessage::getFailureCallback ( )
static

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.

Definition at line 124 of file imstkLoggerSynchronous.cpp.

◆ setFailureBehaviorToDeath()

static void imstk::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.

Definition at line 321 of file imstkLoggerSynchronous.h.

◆ setFailureBehaviorToThrow()

static void imstk::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.

Definition at line 314 of file imstkLoggerSynchronous.h.

◆ setFailureCallback()

void imstk::AssertMessage::setFailureCallback ( AssertMessage::DeathCallback  callback)
static

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.

Definition at line 118 of file imstkLoggerSynchronous.cpp.


The documentation for this class was generated from the following files: