ITK
6.0.0
Insight Toolkit
|
#include <itkExceptionObject.h>
Standard exception handling object.
ExceptionObject provides standard methods for throwing and managing exceptions in itk. Specific exceptions should be derived from this class. Note that this class is derived from std::exception, so an application can catch ITK exceptions as std::exception if desired.
ExceptionObject maintains two types of information: a location and description (both of which are strings). The location is the point in the code where the exception was thrown; the description is an error message that describes the exception. The ExceptionObject can be thrown explicitly in code, or more conveniently, the itkExceptionMacro (found in Common/itkMacro.h) can be used.
Definition at line 50 of file itkExceptionObject.h.
Public Types | |
using | Superclass = std::exception |
Public Member Functions | |
ExceptionObject () noexcept=default | |
ExceptionObject (const char *file, unsigned int lineNumber=0, const char *desc="None", const char *loc="Unknown") | |
ExceptionObject (const ExceptionObject &) noexcept=default | |
ExceptionObject (ExceptionObject &&) noexcept=default | |
ExceptionObject (std::string file, unsigned int lineNumber=0, std::string desc="None", std::string loc="Unknown") | |
virtual const char * | GetDescription () const |
virtual const char * | GetFile () const |
virtual unsigned int | GetLine () const |
virtual const char * | GetLocation () const |
virtual const char * | GetNameOfClass () const |
ExceptionObject & | operator= (const ExceptionObject &) noexcept=default |
ExceptionObject & | operator= (ExceptionObject &&) noexcept=default |
virtual bool | operator== (const ExceptionObject &orig) const |
virtual void | Print (std::ostream &os) const |
virtual void | SetDescription (const char *s) |
virtual void | SetDescription (const std::string &s) |
virtual void | SetLocation (const char *s) |
virtual void | SetLocation (const std::string &s) |
const char * | what () const noexcept override |
~ExceptionObject () override | |
Static Public Attributes | |
static constexpr const char *const | default_exception_message = "Generic ExceptionObject" |
Private Attributes | |
std::shared_ptr< const ExceptionData > | m_ExceptionData {} |
using itk::ExceptionObject::Superclass = std::exception |
Definition at line 54 of file itkExceptionObject.h.
|
defaultnoexcept |
Explicitly-defaulted default-constructor. Creates an empty exception object.
|
explicit |
|
explicit |
|
defaultnoexcept |
Copy-constructor.
|
defaultnoexcept |
Move-constructor.
|
override |
Destructor.
|
virtual |
|
virtual |
What file did the exception occur in?
|
virtual |
What line did the exception occur in?
|
virtual |
|
virtual |
Reimplemented in itk::ProcessAborted, itk::IncompatibleOperandsError, itk::InvalidArgumentError, itk::RangeError, itk::MemoryAllocationError, itk::InvalidRequestedRegionError, itk::DataObjectError, itk::MeshFileReaderException, itk::MeshFileWriterException, itk::ImageFileWriterException, itk::ImageSeriesWriterException, and itk::DerefError.
|
defaultnoexcept |
Copy-assignment operator.
|
defaultnoexcept |
Move-assignment operator.
|
virtual |
Equivalence operator.
|
virtual |
Print exception information. This method can be overridden by specific exception subtypes. The default is to print out the location where the exception was first thrown and any description provided by the "thrower".
Referenced by test().
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Methods to get and set the Location and Description fields. The Set methods are overloaded to support both std::string and const char array types. Get methods return const char arrays.
Referenced by itk::RegularStepGradientDescentBaseOptimizer::StepAlongGradient().
|
overridenoexcept |
Provide std::exception::what() implementation.
|
staticconstexpr |
Definition at line 53 of file itkExceptionObject.h.
|
private |
Definition at line 136 of file itkExceptionObject.h.