PCL
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
pcl::Error Class Reference

A simple exception with an associated error message. More...

#include <Exception.h>

+ Inheritance diagram for pcl::Error:

Public Member Functions

 Error ()=default
 
 Error (const Error &)=default
 
 Error (const String &message, bool unformatted=false)
 
String Caption () const override
 
String Message () const override
 
bool ShowUnformatted () const override
 
- Public Member Functions inherited from pcl::Exception
 Exception ()=default
 
 Exception (const pcl::Exception &)=default
 
virtual ~Exception ()
 
virtual String ExceptionClass () const
 
virtual String FormatInfo () const
 
virtual void Show () const
 
PCL_FORCE_INLINE void ShowOnConsole () const
 

Additional Inherited Members

- 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 ()
 

Detailed Description

Error is a general exception message very frequently used by PCL classes and functions.

Definition at line 255 of file Exception.h.

Constructor & Destructor Documentation

◆ Error() [1/3]

pcl::Error::Error ( )
default

Constructs an Error object with an empty error message.

◆ Error() [2/3]

pcl::Error::Error ( const Error )
default

Copy constructor.

◆ Error() [3/3]

pcl::Error::Error ( const String message,
bool  unformatted = false 
)
inline

Constructs an Error object.

Parameters
messageThe error message that will be shown for this exception. See the Message() member function for more information.
unformattedIf true, the specified message will be shown verbatim on the console (when console output is enabled) without inserting any prefixes and captions. This parameter is false by default.

Definition at line 280 of file Exception.h.

Member Function Documentation

◆ Caption()

String pcl::Error::Caption ( ) const
inlineoverridevirtual

Returns a caption text suitable to represent the information in this Exception object.

Reimplemented from pcl::Exception.

Reimplemented in pcl::FatalError.

Definition at line 300 of file Exception.h.

◆ Message()

String pcl::Error::Message ( ) const
inlineoverridevirtual

Returns descriptive information for this Error object. The default implementation returns the message specified upon construction. A derived class can reimplement this function to provide additional information items such as file names, object identifiers, source code positions, date and time representations, etc.

Reimplemented from pcl::Exception.

Reimplemented in pcl::File::Error, pcl::SourceCodeError, and pcl::ParseError.

Definition at line 293 of file Exception.h.

◆ ShowUnformatted()

bool pcl::Error::ShowUnformatted ( ) const
inlineoverridevirtual

Returns true if the exception information must be represented verbatim on the console (when console output is enabled) without inserting any prefixes, captions, and indicators.

Derived classes can reimplement this function to prevent duplicate decorations on the console when the exception information already includes all the necessary formatting elements. For example, this happens with exceptions generated within running threads, which are already represented as formatted console text that can be retrieved using Thread::ConsoleOutputText() to write it to the Process Console interface.

Reimplemented from pcl::Exception.

Definition at line 307 of file Exception.h.


The documentation for this class was generated from the following file: