52 #ifndef __PCL_UnixSignalException_h
53 #define __PCL_UnixSignalException_h
57 #if defined( __PCL_WINDOWS ) || !defined( __PCL_LINUX ) && !defined( __PCL_FREEBSD ) && !defined( __PCL_MACOSX )
58 # error UnixSignalException can only be used on Linux, FreeBSD and macOS platforms.
102 , m_details( details )
139 return "Undefined signal";
148 String info =
String().
Format(
"Critical signal caught (%d): ", SignalNumber() ) + Message();
149 if ( !m_details.IsEmpty() )
152 info.Append( m_details );
164 return "PCL Unix Signal Handler";
197 #define DECLARE_UNIX_SIGNAL_EXCEPTION( className, sigNum, message ) \
198 class PCL_CLASS className : public pcl::UnixSignalException \
201 className( const IsoString& details = IsoString() ) : \
202 pcl::UnixSignalException( sigNum, details ) \
205 className( const className& ) = default; \
206 String Message() const override \
214 DECLARE_UNIX_SIGNAL_EXCEPTION( EUnixSegmentationViolation, SIGSEGV,
215 "Segmentation violation" );
217 DECLARE_UNIX_SIGNAL_EXCEPTION( EUnixBusError, SIGBUS,
220 DECLARE_UNIX_SIGNAL_EXCEPTION( EUnixFloatingPointException, SIGFPE,
221 "Floating point exception" );
223 DECLARE_UNIX_SIGNAL_EXCEPTION( EUnixIllegalInstructionException, SIGILL,
224 "Illegal instruction" );
226 DECLARE_UNIX_SIGNAL_EXCEPTION( EUnixIBrokenPipeException, SIGPIPE,
231 #undef DECLARE_UNIX_SIGNAL_EXCEPTION
Root base class for all PCL exception classes.
Eight-bit string (ISO/IEC-8859-1 or UTF-8 string)
String & Format(const_c_string8 fmt,...)
A UNIX synchronous signal handler that throws C++ exceptions.
UnixSignalException(const UnixSignalException &)=default
const IsoString & Details() const
String Caption() const override
String FormatInfo() const override
void Show() const override
String Message() const override
UnixSignalException(int signal, const IsoString &details=IsoString())