![]() |
Open CASCADE Technology Reference Manual 8.0.0
|
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_buf & | Label () |
| Returns label for jump. | |
| const SignalException & | Error () 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. | |
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.
Variant type holding all possible signal exceptions. Used to store exception across longjmp without heap allocation.
| Standard_ErrorHandler::Standard_ErrorHandler | ( | ) |
Create a ErrorHandler (to be used with try{}catch(){}). It uses the "setjmp" and "longjmp" routines.
|
inline |
Destructor.
Abort with specific exception type. Finds nearest error handler, stores exception, and performs longjmp.
Template implementation of Abort - stores exception and performs longjmp.
| T | Exception type (must be one of Standard_SignalException variant types) |
| theError | Exception to store and throw after longjmp |
| void Standard_ErrorHandler::Destroy | ( | ) |
Unlinks and checks if there is a raised exception.
|
inline |
Returns the current Error variant.
Test if the code is currently running in a try block.
|
inline |
Returns label for jump.
| void Standard_ErrorHandler::Raise | ( | ) |
Throws C++ exception if exception object set, otherwise prints error and terminates program.