ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
#include <itkExceptionObject.h>
Classes | |
class | ReferenceCounterInterface |
Public Types | |
typedef std::exception | Superclass |
Public Member Functions | |
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 &orig) |
virtual bool | operator== (const ExceptionObject &orig) |
virtual void | Print (std::ostream &os) const |
virtual void | SetDescription (const std::string &s) |
virtual void | SetDescription (const char *s) |
virtual void | SetLocation (const std::string &s) |
virtual void | SetLocation (const char *s) |
virtual const char * | what () const throw ( ) |
virtual | ~ExceptionObject () throw ( ) |
ExceptionObject () | |
ExceptionObject (const char *file, unsigned int lineNumber=0, const char *desc="None", const char *loc="Unknown") | |
ExceptionObject (const std::string &file, unsigned int lineNumber=0, const std::string &desc="None", const std::string &loc="Unknown") | |
ExceptionObject (const ExceptionObject &orig) | |
Private Member Functions | |
const ExceptionData * | GetExceptionData () const |
Private Attributes | |
SmartPointer< const ReferenceCounterInterface > | m_ExceptionData |
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 51 of file itkExceptionObject.h.
typedef std::exception itk::ExceptionObject::Superclass |
Definition at line 54 of file itkExceptionObject.h.
Various types of constructors. Note that these functions will be called when children are instantiated. The default constructor and the copy constructor of ExceptionObject never throw an exception.
itk::ExceptionObject::ExceptionObject | ( | const char * | file, |
unsigned int | lineNumber = 0 , |
||
const char * | desc = "None" , |
||
const char * | loc = "Unknown" |
||
) | [explicit] |
Various types of constructors. Note that these functions will be called when children are instantiated. The default constructor and the copy constructor of ExceptionObject never throw an exception.
itk::ExceptionObject::ExceptionObject | ( | const std::string & | file, |
unsigned int | lineNumber = 0 , |
||
const std::string & | desc = "None" , |
||
const std::string & | loc = "Unknown" |
||
) | [explicit] |
Various types of constructors. Note that these functions will be called when children are instantiated. The default constructor and the copy constructor of ExceptionObject never throw an exception.
itk::ExceptionObject::ExceptionObject | ( | const ExceptionObject & | orig | ) |
Various types of constructors. Note that these functions will be called when children are instantiated. The default constructor and the copy constructor of ExceptionObject never throw an exception.
virtual itk::ExceptionObject::~ExceptionObject | ( | ) | throw ( ) [virtual] |
Virtual destructor needed for subclasses. Has to have empty throw().
virtual const char* itk::ExceptionObject::GetDescription | ( | ) | const [virtual] |
Referenced by ComputeHash(), and RegressionTestImage().
const ExceptionData* itk::ExceptionObject::GetExceptionData | ( | ) | const [private] |
virtual const char* itk::ExceptionObject::GetFile | ( | ) | const [virtual] |
What file did the exception occur in?
virtual unsigned int itk::ExceptionObject::GetLine | ( | ) | const [virtual] |
What line did the exception occur in?
virtual const char* itk::ExceptionObject::GetLocation | ( | ) | const [virtual] |
virtual const char* itk::ExceptionObject::GetNameOfClass | ( | ) | const [inline, virtual] |
Reimplemented in itk::fem::FEMExceptionItpackSolver, itk::fem::FEMExceptionLinearSystemBounds, itk::fem::FEMExceptionLinearSystem, itk::fem::FEMExceptionItpackSparseMatrixSbsij, itk::ProcessAborted, itk::fem::FEMExceptionItpackSparseMatrixSbagn, itk::IncompatibleOperandsError, itk::InvalidArgumentError, itk::RangeError, itk::MemoryAllocationError, itk::fem::FEMExceptionSolution, itk::fem::FEMExceptionObjectNotFound, itk::fem::FEMExceptionWrongClass, itk::InvalidRequestedRegionError, itk::fem::FEMExceptionIO, itk::DataObjectError, itk::fem::FEMException, itk::MeshFileReaderException, itk::ImageFileReaderException, itk::ImageFileWriterException, itk::ImageSeriesWriterException, and itk::MeshFileWriterException.
Definition at line 77 of file itkExceptionObject.h.
ExceptionObject& itk::ExceptionObject::operator= | ( | const ExceptionObject & | orig | ) |
Assignment operator.
virtual bool itk::ExceptionObject::operator== | ( | const ExceptionObject & | orig | ) | [virtual] |
Equivalence operator.
virtual void itk::ExceptionObject::Print | ( | std::ostream & | os | ) | const [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''.
virtual void itk::ExceptionObject::SetDescription | ( | const std::string & | s | ) | [virtual] |
virtual void itk::ExceptionObject::SetDescription | ( | const char * | s | ) | [virtual] |
virtual void itk::ExceptionObject::SetLocation | ( | const std::string & | s | ) | [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().
virtual void itk::ExceptionObject::SetLocation | ( | const char * | s | ) | [virtual] |
virtual const char* itk::ExceptionObject::what | ( | ) | const throw ( ) [virtual] |
Provide std::exception::what() implementation.
SmartPointer< const ReferenceCounterInterface > itk::ExceptionObject::m_ExceptionData [private] |
Definition at line 148 of file itkExceptionObject.h.