52 #ifndef __PCL_Exception_h
53 #define __PCL_Exception_h
148 PCL_FORCE_INLINE
void ShowOnConsole()
const
155 bool wasConsoleOutput = IsConsoleOutputEnabled();
156 bool wasGUIOutput = IsGUIOutputEnabled();
157 EnableConsoleOutput();
162 EnableConsoleOutput( wasConsoleOutput );
163 EnableGUIOutput( wasGUIOutput );
193 EnableConsoleOutput( !disable );
223 EnableGUIOutput( !disable );
256 : m_message( message )
316 :
Error( x.Message() )
329 return "Fatal Error";
355 template <
typename T>
363 ) +
": Not implemented: " + notImplemented )
421 , m_beingParsed( beingParsed )
422 , m_errorPosition( errorPosition )
437 int m_errorPosition = -1;
492 template <
typename T1>
495 , m_lineNumber(
Range( int( line ), -1, int_max ) )
496 , m_columnNumber(
Range( int( column ), -1, int_max ) )
527 return m_columnNumber;
543 template <
typename T1>
546 m_lineNumber =
Range(
int( line ), -1, int_max );
547 m_columnNumber =
Range(
int( column ), -1, int_max );
563 template <
typename T1>
566 SetPosition( m_lineNumber+
int( lines ), m_columnNumber+
int( columns ) );
579 int m_lineNumber = -1;
580 int m_columnNumber = -1;
634 #define PCL_DECLARE_EXCEPTION_CLASS( className, exceptionClass, message ) \
635 class PCL_CLASS className : public pcl::Exception \
638 className() = default; \
639 className( const className& ) = default; \
640 pcl::String ExceptionClass() const override \
642 return exceptionClass; \
644 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.
Error(const String &message)
String Caption() const override
String Message() const override
Error(const Error &)=default
Root base class for all PCL exception classes.
virtual String Caption() 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 pcl::FatalError &)=default
FatalError(const String &message)
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