52 #ifndef __PCL_Exception_h
53 #define __PCL_Exception_h
165 PCL_FORCE_INLINE
void ShowOnConsole()
const
172 bool wasConsoleOutput = IsConsoleOutputEnabled();
173 bool wasGUIOutput = IsGUIOutputEnabled();
174 EnableConsoleOutput();
179 EnableConsoleOutput( wasConsoleOutput );
180 EnableGUIOutput( wasGUIOutput );
210 EnableConsoleOutput( !disable );
240 EnableGUIOutput( !disable );
281 : m_message( message )
282 , m_unformatted( unformatted )
309 return m_unformatted;
315 bool m_unformatted =
false;
349 :
Error( message, unformatted )
357 :
Error( x.Message() )
370 return "Fatal Error";
396 template <
typename T>
404 ) +
": Not implemented: " + notImplemented )
462 , m_beingParsed( beingParsed )
463 , m_errorPosition( errorPosition )
478 int m_errorPosition = -1;
533 template <
typename T1>
536 , m_lineNumber(
Range( int( line ), -1, int_max ) )
537 , m_columnNumber(
Range( int( column ), -1, int_max ) )
568 return m_columnNumber;
584 template <
typename T1>
587 m_lineNumber =
Range(
int( line ), -1, int_max );
588 m_columnNumber =
Range(
int( column ), -1, int_max );
604 template <
typename T1>
607 SetPosition( m_lineNumber+
int( lines ), m_columnNumber+
int( columns ) );
620 int m_lineNumber = -1;
621 int m_columnNumber = -1;
675 #define PCL_DECLARE_EXCEPTION_CLASS( className, exceptionClass, message ) \
676 class PCL_CLASS className : public pcl::Exception \
679 className() = default; \
680 className( const className& ) = default; \
681 pcl::String ExceptionClass() const override \
683 return exceptionClass; \
685 pcl::String Message() const override \
An exception that has already been handled.
CaughtException()=default
CaughtException(const pcl::CaughtException &)=default
A simple exception with an associated error message.
String Caption() const override
bool ShowUnformatted() const override
String Message() const override
Error(const Error &)=default
Error(const String &message, bool unformatted=false)
Root base class for all PCL exception classes.
virtual String Caption() const
virtual bool ShowUnformatted() const
static void DisableConsoleOutput(bool disable=true)
static void EnableConsoleOutput(bool=true)
virtual String ExceptionClass() const
Exception(const pcl::Exception &)=default
virtual String FormatInfo() const
static void EnableGUIOutput(bool=true)
virtual void Show() const
static bool IsConsoleOutputEnabled()
virtual String Message() const
static bool IsGUIOutputEnabled()
static void DisableGUIOutput(bool disable=true)
Errors that cause immediate program termination.
String Caption() const override
FatalError(const pcl::Exception &x)
FatalError(const String &message, bool unformatted=false)
FatalError(const pcl::FatalError &)=default
Eight-bit string (ISO/IEC-8859-1 or UTF-8 string)
An exception that indicates an unsupported feature.
NotImplemented(const T &object, const String ¬Implemented)
NotImplemented(const NotImplemented &)=default
Base class for exceptions thrown by parsing routines.
ParseError(const ParseError &)=default
String Message() const override
void Show() const override
ParseError(const String &message, const String &beingParsed=String(), int errorPosition=-1)
An exception class signaling the interruption of a process.
Base class for exceptions thrown by source code interpreters.
SourceCodeError()=default
void Show() const override
void AddToPosition(T1 lines, T1 columns=0)
SourceCodeError(const String &message, T1 line=-1, T1 column=-1)
SourceCodeError(const SourceCodeError &)=default
String Message() const override
void SetPosition(T1 line, T1 column=-1)
#define PCL_DECLARE_EXCEPTION_CLASS(className, exceptionClass, message)
A macro to implement simple exception classes derived from Exception.
constexpr const T & Range(const T &x, const T &a, const T &b) noexcept