PCL
|
A UNIX synchronous signal handler that throws C++ exceptions. More...
#include <UnixSignalException.h>
Public Member Functions | |
UnixSignalException (const UnixSignalException &)=default | |
UnixSignalException (int signal, const IsoString &details=IsoString()) | |
String | Caption () const override |
const IsoString & | Details () const |
String | FormatInfo () const override |
String | Message () const override |
void | Show () const override |
int | SignalNumber () const |
Public Member Functions inherited from pcl::Exception | |
Exception ()=default | |
Exception (const pcl::Exception &)=default | |
virtual | ~Exception () |
virtual String | ExceptionClass () const |
PCL_FORCE_INLINE void | ShowOnConsole () const |
Static Public Member Functions | |
static void | Initialize () |
Static Public Member Functions inherited from pcl::Exception | |
static void | DisableConsoleOutput (bool disable=true) |
static void | DisableGUIOutput (bool disable=true) |
static void | EnableConsoleOutput (bool=true) |
static void | EnableGUIOutput (bool=true) |
static bool | IsConsoleOutputEnabled () |
static bool | IsGUIOutputEnabled () |
This class can only be used on Linux, FreeBSD and macOS platforms. On Windows platforms, including this header file from compilable code raises a compilation error.
For this handler to work properly, all code that may raise synchronous signals (SIGSEGV and the like) must be compiled with GCC's '-fnon-call-exceptions' flag. Otherwise the exceptions will be thrown but terminate() will be called, which is the default critical signal management behavior.
To generate a backtrace report (see the UnixSignalException::Details() member function), the code must be compiled with the '-rdynamic' GCC flag, which instructs the linker to add all symbols to the dynamic symbol table. In addition, the generated binaries should not be stripped with the '-s' linker flag.
Definition at line 92 of file UnixSignalException.h.
|
inline |
Constructs a new UnixSignalException object with the specified signal number and optional backtrace details.
Definition at line 100 of file UnixSignalException.h.
|
default |
Copy constructor.
|
inlineoverridevirtual |
Returns the type of this exception, intended to be used as a caption for a message box. As reimplemented in this class, this member function returns the string "PCL Unix Signal Handler".
Reimplemented from pcl::Exception.
Definition at line 162 of file UnixSignalException.h.
|
inline |
Returns the backtrace information associated with this exception.
The returned string will be empty if no backtrace data were available at the time this signal exception was generated. This happens when the code has not been compiled and linked with the appropriate options (see the -rdynamic compiler flag).
Definition at line 127 of file UnixSignalException.h.
|
inlineoverridevirtual |
Returns a formatted error message with information on this signal exception.
Reimplemented from pcl::Exception.
Definition at line 146 of file UnixSignalException.h.
|
static |
Initializes the UNIX synchronous signal handler. This static member function must be called before the calling process can raise any synchronous signal.
|
inlineoverridevirtual |
Returns an error or warning message corresponding to this signal exception. Typical messages are "segmentation violation", "bus error" and "floating point exception", returned by specific derived classes.
Reimplemented from pcl::Exception.
Definition at line 137 of file UnixSignalException.h.
|
overridevirtual |
Writes a formatted representation of this exception on the platform console. A plain text version of the same textual representation will also be written on stdout.
Reimplemented from pcl::Exception.
|
inline |
Returns the signal number associated with this object.
Definition at line 114 of file UnixSignalException.h.