Go to the documentation of this file.
52 #ifndef __PCL_Exception_h
53 #define __PCL_Exception_h
122 virtual String FormatInfo()
const;
128 virtual String Caption()
const;
139 virtual void Show()
const;
148 PCL_FORCE_INLINE
void ShowOnConsole()
const
155 bool wasConsoleOutput = IsConsoleOutputEnabled();
156 bool wasGUIOutput = IsGUIOutputEnabled();
157 EnableConsoleOutput();
162 EnableConsoleOutput( wasConsoleOutput );
163 EnableGUIOutput( wasGUIOutput );
175 static bool IsConsoleOutputEnabled();
183 static void EnableConsoleOutput(
bool =
true );
193 EnableConsoleOutput( !disable );
205 static bool IsGUIOutputEnabled();
213 static void EnableGUIOutput(
bool =
true );
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 )
428 String Message()
const override;
432 void Show()
const override;
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 ) );
571 String Message()
const override;
575 void Show()
const override;
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 \
668 #endif // __PCL_Exception_h
static void DisableGUIOutput(bool disable=true)
constexpr const T & Range(const T &x, const T &a, const T &b) noexcept
virtual String Message() const
String Caption() const override
virtual String ExceptionClass() const
Eight-bit string (ISO/IEC-8859-1 or UTF-8 string)
Error(const String &message)
An exception that indicates an unsupported feature.
SourceCodeError(const String &message, T1 line=-1, T1 column=-1)
A simple exception with an associated error message.
FatalError(const String &message)
String Caption() const override
Root base class for all PCL exception classes.
Base class for exceptions thrown by parsing routines.
ParseError(const String &message, const String &beingParsed=String(), int errorPosition=-1)
Errors that cause immediate program termination.
FatalError(const pcl::Exception &x)
An exception that has already been handled.
virtual void Show() const
String Message() const override
NotImplemented(const T &object, const String ¬Implemented)
static void DisableConsoleOutput(bool disable=true)
An exception class signaling the interruption of a process.
void SetPosition(T1 line, T1 column=-1)
Base class for exceptions thrown by source code interpreters.
void AddToPosition(T1 lines, T1 columns=0)
#define PCL_DECLARE_EXCEPTION_CLASS(className, exceptionClass, message)
A macro to implement simple exception classes derived from Exception.