ITK  4.2.0
Insight Segmentation and Registration Toolkit
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes
itk::ExceptionObject Class Reference

#include <itkExceptionObject.h>

+ Inheritance diagram for itk::ExceptionObject:
+ Collaboration diagram for itk::ExceptionObject:

List of all members.

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
ExceptionObjectoperator= (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

Detailed Description

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.

Examples:
Examples/Filtering/DiffusionTensor3DReconstructionImageFilter.cxx, ImageLinearIteratorWithIndex.cxx, ImageRegionIterator.cxx, and ImageRegionIteratorWithIndex.cxx.

Definition at line 51 of file itkExceptionObject.h.


Member Typedef Documentation

typedef std::exception itk::ExceptionObject::Superclass

Definition at line 54 of file itkExceptionObject.h.


Constructor & Destructor Documentation

itk::ExceptionObject::ExceptionObject ( )

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


Member Function Documentation

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
inlinevirtual
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.


Member Data Documentation

SmartPointer< const ReferenceCounterInterface > itk::ExceptionObject::m_ExceptionData
private

Definition at line 148 of file itkExceptionObject.h.


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