Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itk::ExceptionObject Class Reference
[ITK System Objects]

Standard exception handling object. More...

#include <itkExceptionObject.h>

Inheritance diagram for itk::ExceptionObject:

Inheritance graph
[legend]
List of all members.

Public Methods

virtual ~ExceptionObject () throw ()
ExceptionObject & operator= (const ExceptionObject &orig)
virtual const char * GetNameOfClass () const
virtual void Print (std::ostream &os) const
virtual const char * GetFile () const
virtual unsigned int GetLine () const
virtual const char * what () const throw ()
 ExceptionObject (const char *file="Unknown", unsigned int lineNumber=0, const char *desc="None", const char *loc="Unknown")
 ExceptionObject (const std::string &file, unsigned int lineNumber, const std::string &desc="None", const std::string &loc="Unknown")
 ExceptionObject (const ExceptionObject &orig)
virtual bool operator== (const ExceptionObject &orig)
virtual void SetLocation (const std::string &s)
virtual void SetDescription (const std::string &s)
virtual void SetLocation (const char *s)
virtual void SetDescription (const char *s)
virtual const char * GetLocation () const
virtual const char * GetDescription () const

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.

Definition at line 47 of file itkExceptionObject.h.


Constructor & Destructor Documentation

itk::ExceptionObject::ExceptionObject const char *    file = "Unknown",
unsigned int    lineNumber = 0,
const char *    desc = "None",
const char *    loc = "Unknown"
[inline]
 

Various types of constructors. Note that these functions will be called when children are instantiated.

Definition at line 52 of file itkExceptionObject.h.

Referenced by itk::RangeError::GetNameOfClass().

itk::ExceptionObject::ExceptionObject const std::string &    file,
unsigned int    lineNumber,
const std::string &    desc = "None",
const std::string &    loc = "Unknown"
[inline]
 

Various types of constructors. Note that these functions will be called when children are instantiated.

Definition at line 60 of file itkExceptionObject.h.

itk::ExceptionObject::ExceptionObject const ExceptionObject &    orig [inline]
 

Various types of constructors. Note that these functions will be called when children are instantiated.

Definition at line 69 of file itkExceptionObject.h.

References m_Description, m_File, m_Line, and m_Location.

virtual itk::ExceptionObject::~ExceptionObject   throw () [inline, virtual]
 

Virtual destructor needed for subclasses. Has to have empty throw().

Definition at line 79 of file itkExceptionObject.h.


Member Function Documentation

virtual const char* itk::ExceptionObject::GetDescription   const [inline, 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.

Definition at line 130 of file itkExceptionObject.h.

virtual const char* itk::ExceptionObject::GetFile   const [inline, virtual]
 

What file did the exception occur in?

Definition at line 135 of file itkExceptionObject.h.

virtual unsigned int itk::ExceptionObject::GetLine   const [inline, virtual]
 

What line did the exception occur in?

Definition at line 139 of file itkExceptionObject.h.

virtual const char* itk::ExceptionObject::GetLocation   const [inline, 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.

Definition at line 128 of file itkExceptionObject.h.

virtual const char* itk::ExceptionObject::GetNameOfClass   const [inline, virtual]
 

Reimplemented in itk::RangeError, itk::InvalidArgumentError, and itk::IncompatibleOperandsError.

Definition at line 108 of file itkExceptionObject.h.

ExceptionObject& itk::ExceptionObject::operator= const ExceptionObject &    orig [inline]
 

Assignment operator.

Definition at line 82 of file itkExceptionObject.h.

References m_Description, m_File, m_Line, and m_Location.

virtual bool itk::ExceptionObject::operator== const ExceptionObject &    orig [inline, virtual]
 

Equivalence operator.

Definition at line 92 of file itkExceptionObject.h.

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 char *    s [inline, 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.

Definition at line 126 of file itkExceptionObject.h.

virtual void itk::ExceptionObject::SetDescription const std::string &    s [inline, 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.

Definition at line 122 of file itkExceptionObject.h.

Referenced by itk::ImageFileReaderException::ImageFileReaderException(), itk::ImageFileWriterException::ImageFileWriterException(), itk::ConstNeighborhoodIterator< FixedImageType >::IsAtEnd(), and itk::RegularStepGradientDescentBaseOptimizer::StepAlongGradient().

virtual void itk::ExceptionObject::SetLocation const char *    s [inline, 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.

Definition at line 124 of file itkExceptionObject.h.

virtual void itk::ExceptionObject::SetLocation const std::string &    s [inline, 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.

Definition at line 120 of file itkExceptionObject.h.

Referenced by itk::RegularStepGradientDescentBaseOptimizer::StepAlongGradient().

virtual const char* itk::ExceptionObject::what   const throw () [inline, virtual]
 

Provide std::exception::what() implementation.

Definition at line 143 of file itkExceptionObject.h.


The documentation for this class was generated from the following file:
Generated at Wed Mar 12 01:15:55 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000