Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Data Structures | Public Types | Public Member Functions | Static Public Member Functions
Standard_ErrorHandler Class Reference

Class implementing mechanics of conversion of signals to exceptions. More...

#include <Standard_ErrorHandler.hxx>

Data Structures

class  Callback
 Defines a base class for callback objects that can be registered in the OCC error handler (the class simulating C++ exceptions) so as to be correctly destroyed when error handler is activated. More...
 

Public Types

using SignalException
 Variant type holding all possible signal exceptions. Used to store exception across longjmp without heap allocation.
 

Public Member Functions

 Standard_ErrorHandler ()
 Create a ErrorHandler (to be used with try{}catch(){}). It uses the "setjmp" and "longjmp" routines.
 
void Destroy ()
 Unlinks and checks if there is a raised exception.
 
 ~Standard_ErrorHandler ()
 Destructor.
 
void Raise ()
 Throws C++ exception if exception object set, otherwise prints error and terminates program.
 
jmp_bufLabel ()
 Returns label for jump.
 
const SignalExceptionError () const
 Returns the current Error variant.
 

Static Public Member Functions

static bool IsInTryBlock ()
 Test if the code is currently running in a try block.
 
template<typename T >
static void Abort (const T &theError)
 Abort with specific exception type. Finds nearest error handler, stores exception, and performs longjmp.
 

Detailed Description

Class implementing mechanics of conversion of signals to exceptions.

Each instance of it stores data for jump placement, and callbacks to be called during jump (for proper resource release).

The active handlers are stored in the global stack, which is used to find appropriate handler when signal is raised.

Member Typedef Documentation

◆ SignalException

Constructor & Destructor Documentation

◆ Standard_ErrorHandler()

Standard_ErrorHandler::Standard_ErrorHandler ( )

Create a ErrorHandler (to be used with try{}catch(){}). It uses the "setjmp" and "longjmp" routines.

◆ ~Standard_ErrorHandler()

Standard_ErrorHandler::~Standard_ErrorHandler ( )
inline

Destructor.

Member Function Documentation

◆ Abort()

template<typename T >
void Standard_ErrorHandler::Abort ( const T & theError)
static

Abort with specific exception type. Finds nearest error handler, stores exception, and performs longjmp.

Template implementation of Abort - stores exception and performs longjmp.

Template Parameters
TException type (must be one of Standard_SignalException variant types)
Parameters
theErrorException to store and throw after longjmp

◆ Destroy()

void Standard_ErrorHandler::Destroy ( )

Unlinks and checks if there is a raised exception.

◆ Error()

const SignalException & Standard_ErrorHandler::Error ( ) const
inline

Returns the current Error variant.

◆ IsInTryBlock()

static bool Standard_ErrorHandler::IsInTryBlock ( )
static

Test if the code is currently running in a try block.

◆ Label()

jmp_buf & Standard_ErrorHandler::Label ( )
inline

Returns label for jump.

◆ Raise()

void Standard_ErrorHandler::Raise ( )

Throws C++ exception if exception object set, otherwise prints error and terminates program.


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