#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.
Referenced by ExceptionObject(), ExceptionObject(), ExceptionObject(), ExceptionObject(), GetNameOfClass(), itk::ImageFileWriterException::ImageFileWriterException(), itk::ImageFileWriterException::ImageFileWriterException(), itk::ImageSeriesWriterException::ImageSeriesWriterException(), itk::ImageSeriesWriterException::ImageSeriesWriterException(), operator=(), operator=(), operator==(), itk::ProcessAborted::ProcessAborted(), itk::ProcessAborted::ProcessAborted(), itk::ProcessAborted::ProcessAborted(), and ~ExceptionObject().
|
explicit |
References ExceptionObject().
|
explicit |
References ExceptionObject().
|
defaultnoexcept |
Copy-constructor.
References ExceptionObject().
|
defaultnoexcept |
Move-constructor.
References ExceptionObject().
|
override |
Destructor.
References ExceptionObject().
|
virtual |
References GetDescription().
Referenced by GetDescription().
|
virtual |
|
virtual |
|
virtual |
References GetLocation().
Referenced by GetLocation().
|
virtual |
Reimplemented in itk::DataObjectError, itk::DerefError, itk::HistogramWrongNumberOfComponents, itk::ImageFileWriterException, itk::ImageSeriesWriterException, itk::IncompatibleOperandsError, itk::InvalidArgumentError, itk::InvalidRequestedRegionError, itk::MemoryAllocationError, itk::MeshFileReaderException, itk::MeshFileWriterException, itk::MissingHistogramBinMaximumInput, itk::MissingHistogramBinMinimumInput, itk::MissingHistogramMarginalScaleInput, itk::MissingHistogramSizeInput, itk::NullSizeHistogramInputMeasurementVectorSize, itk::ProcessAborted, itk::RangeError, and itk::SampleToHistogramFilterException.
References ExceptionObject().
|
defaultnoexcept |
Copy-assignment operator.
References ExceptionObject().
|
defaultnoexcept |
Move-assignment operator.
References ExceptionObject().
|
virtual |
Equivalence operator.
References ExceptionObject().
|
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".
References Print().
Referenced by itk::operator<<(), and Print().
|
virtual |
References SetDescription().
|
virtual |
References SetDescription().
Referenced by itk::ProgressReporter::CheckAbortGenerateData(), itk::TotalProgressReporter::CheckAbortGenerateData(), itk::ImageSeriesWriterException::ImageSeriesWriterException(), itk::ImageSeriesWriterException::ImageSeriesWriterException(), itk::ConstNeighborhoodIterator< TImage, TBoundaryCondition >::IsAtEnd(), itk::ProcessAborted::ProcessAborted(), itk::ProcessAborted::ProcessAborted(), itk::ProcessAborted::ProcessAborted(), SetDescription(), SetDescription(), and itk::RegularStepGradientDescentBaseOptimizer::StepAlongGradient().
|
virtual |
References SetLocation().
|
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.
References SetLocation().
Referenced by SetLocation(), SetLocation(), and itk::RegularStepGradientDescentBaseOptimizer::StepAlongGradient().
|
overridenoexcept |
|
staticconstexpr |
Definition at line 53 of file itkExceptionObject.h.
|
private |
Definition at line 136 of file itkExceptionObject.h.