ITK  4.6.0
Insight Segmentation and Registration Toolkit
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
itk::ExceptionObject Class Reference

#include <itkExceptionObject.h>

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

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:
DataRepresentation/Image/Image5.cxx, DataRepresentation/Image/ImageAdaptor2.cxx, DataRepresentation/Mesh/ImageToPointSet.cxx, DataRepresentation/Path/PolyLineParametricPath1.cxx, Examples/Filtering/DiffusionTensor3DReconstructionImageFilter.cxx, Filtering/AntiAliasBinaryImageFilter.cxx, Filtering/CannyEdgeDetectionImageFilter.cxx, Filtering/CompositeFilterExample.cxx, Filtering/DanielssonDistanceMapImageFilter.cxx, Filtering/DiffusionTensor3DReconstructionImageFilter.cxx, Filtering/DigitallyReconstructedRadiograph1.cxx, Filtering/FFTImageFilter.cxx, Filtering/FFTImageFilterFourierDomainFiltering.cxx, Filtering/GrayscaleFunctionDilateImageFilter.cxx, Filtering/LaplacianImageFilter.cxx, Filtering/LaplacianRecursiveGaussianImageFilter1.cxx, Filtering/LaplacianRecursiveGaussianImageFilter2.cxx, Filtering/LaplacianSharpeningImageFilter.cxx, Filtering/MorphologicalImageEnhancement.cxx, Filtering/OtsuMultipleThresholdImageFilter.cxx, Filtering/ResampleImageFilter3.cxx, Filtering/ResampleImageFilter4.cxx, Filtering/ResampleImageFilter5.cxx, Filtering/ResampleImageFilter6.cxx, Filtering/ResampleImageFilter7.cxx, Filtering/ResampleImageFilter8.cxx, Filtering/ResampleImageFilter9.cxx, Filtering/ResampleVolumesToBeIsotropic.cxx, Filtering/RGBToGrayscale.cxx, Filtering/SecondDerivativeRecursiveGaussianImageFilter.cxx, Filtering/SignedDanielssonDistanceMapImageFilter.cxx, Filtering/SpatialObjectToImage1.cxx, Filtering/SpatialObjectToImage2.cxx, Filtering/SpatialObjectToImage3.cxx, Filtering/SubsampleVolume.cxx, Filtering/SurfaceExtraction.cxx, Filtering/VectorIndexSelection.cxx, Filtering/WarpImageFilter1.cxx, Filtering/ZeroCrossingBasedEdgeDetectionImageFilter.cxx, IO/ComplexImageReadWrite.cxx, IO/CovariantVectorImageExtractComponent.cxx, IO/CovariantVectorImageRead.cxx, IO/CovariantVectorImageWrite.cxx, IO/DicomImageReadChangeHeaderWrite.cxx, IO/DicomImageReadPrintTags.cxx, IO/DicomImageReadWrite.cxx, IO/DicomPrintPatientInformation.cxx, IO/DicomSeriesReadGaussianImageWrite.cxx, IO/DicomSeriesReadImageWrite.cxx, IO/DicomSeriesReadImageWrite2.cxx, IO/DicomSeriesReadPrintTags.cxx, IO/DicomSeriesReadSeriesWrite.cxx, IO/ImageReadCastWrite.cxx, IO/ImageReadDicomSeriesWrite.cxx, IO/ImageReadExportVTK.cxx, IO/ImageReadExtractFilterInsertWrite.cxx, IO/ImageReadExtractWrite.cxx, IO/ImageReadImageSeriesWrite.cxx, IO/ImageReadRegionOfInterestWrite.cxx, IO/ImageReadWrite.cxx, IO/ImageSeriesReadWrite.cxx, IO/ImageSeriesReadWrite2.cxx, IO/IOPlugin.cxx, IO/RGBImageSeriesReadWrite.cxx, IO/TransformReadWrite.cxx, IO/VectorImageReadWrite.cxx, IO/VisibleHumanPasteWrite.cxx, IO/VisibleHumanStreamReadWrite.cxx, IO/XML/DOMFindDemo.cxx, IO/XML/ParticleSwarmOptimizerReadWrite.cxx, Iterators/ImageLinearIteratorWithIndex.cxx, Iterators/ImageLinearIteratorWithIndex2.cxx, Iterators/ImageRandomConstIteratorWithIndex.cxx, Iterators/ImageRegionIterator.cxx, Iterators/ImageRegionIteratorWithIndex.cxx, Iterators/ImageSliceIteratorWithIndex.cxx, Iterators/NeighborhoodIterators1.cxx, Iterators/NeighborhoodIterators2.cxx, Iterators/NeighborhoodIterators3.cxx, Iterators/NeighborhoodIterators4.cxx, Iterators/NeighborhoodIterators5.cxx, Iterators/NeighborhoodIterators6.cxx, Iterators/ShapedNeighborhoodIterators1.cxx, Iterators/ShapedNeighborhoodIterators2.cxx, RegistrationITKv3/BSplineWarping1.cxx, RegistrationITKv3/BSplineWarping2.cxx, RegistrationITKv3/ChangeInformationImageFilter.cxx, RegistrationITKv3/DeformableRegistration1.cxx, RegistrationITKv3/DeformableRegistration10.cxx, RegistrationITKv3/DeformableRegistration11.cxx, RegistrationITKv3/DeformableRegistration12.cxx, RegistrationITKv3/DeformableRegistration13.cxx, RegistrationITKv3/DeformableRegistration14.cxx, RegistrationITKv3/DeformableRegistration15.cxx, RegistrationITKv3/DeformableRegistration16.cxx, RegistrationITKv3/DeformableRegistration17.cxx, RegistrationITKv3/DeformableRegistration2.cxx, RegistrationITKv3/DeformableRegistration4.cxx, RegistrationITKv3/DeformableRegistration5.cxx, RegistrationITKv3/DeformableRegistration6.cxx, RegistrationITKv3/DeformableRegistration7.cxx, RegistrationITKv3/DeformableRegistration8.cxx, RegistrationITKv3/DeformableRegistration9.cxx, RegistrationITKv3/DeformationFieldJacobian.cxx, RegistrationITKv3/DisplacementFieldInitialization.cxx, RegistrationITKv3/ImageRegistration1.cxx, RegistrationITKv3/ImageRegistration10.cxx, RegistrationITKv3/ImageRegistration11.cxx, RegistrationITKv3/ImageRegistration12.cxx, RegistrationITKv3/ImageRegistration13.cxx, RegistrationITKv3/ImageRegistration14.cxx, RegistrationITKv3/ImageRegistration15.cxx, RegistrationITKv3/ImageRegistration16.cxx, RegistrationITKv3/ImageRegistration17.cxx, RegistrationITKv3/ImageRegistration18.cxx, RegistrationITKv3/ImageRegistration19.cxx, RegistrationITKv3/ImageRegistration2.cxx, RegistrationITKv3/ImageRegistration20.cxx, RegistrationITKv3/ImageRegistration3.cxx, RegistrationITKv3/ImageRegistration4.cxx, RegistrationITKv3/ImageRegistration5.cxx, RegistrationITKv3/ImageRegistration6.cxx, RegistrationITKv3/ImageRegistration7.cxx, RegistrationITKv3/ImageRegistration8.cxx, RegistrationITKv3/ImageRegistration9.cxx, RegistrationITKv3/ImageRegistrationHistogramPlotter.cxx, RegistrationITKv3/IterativeClosestPoint1.cxx, RegistrationITKv3/IterativeClosestPoint2.cxx, RegistrationITKv3/IterativeClosestPoint3.cxx, RegistrationITKv3/LandmarkWarping2.cxx, RegistrationITKv3/MeanSquaresImageMetric1.cxx, RegistrationITKv3/ModelToImageRegistration1.cxx, RegistrationITKv3/ModelToImageRegistration2.cxx, RegistrationITKv3/MultiResImageRegistration1.cxx, RegistrationITKv3/MultiResImageRegistration2.cxx, RegistrationITKv3/MultiResImageRegistration3.cxx, RegistrationITKv3/ThinPlateSplineWarp.cxx, RegistrationITKv4/BSplineWarping1.cxx, RegistrationITKv4/BSplineWarping2.cxx, RegistrationITKv4/ChangeInformationImageFilter.cxx, RegistrationITKv4/DeformableRegistration1.cxx, RegistrationITKv4/DeformableRegistration10.cxx, RegistrationITKv4/DeformableRegistration11.cxx, RegistrationITKv4/DeformableRegistration12.cxx, RegistrationITKv4/DeformableRegistration13.cxx, RegistrationITKv4/DeformableRegistration14.cxx, RegistrationITKv4/DeformableRegistration15.cxx, RegistrationITKv4/DeformableRegistration16.cxx, RegistrationITKv4/DeformableRegistration17.cxx, RegistrationITKv4/DeformableRegistration2.cxx, RegistrationITKv4/DeformableRegistration4.cxx, RegistrationITKv4/DeformableRegistration5.cxx, RegistrationITKv4/DeformableRegistration6.cxx, RegistrationITKv4/DeformableRegistration7.cxx, RegistrationITKv4/DeformableRegistration8.cxx, RegistrationITKv4/DeformableRegistration9.cxx, RegistrationITKv4/DisplacementFieldInitialization.cxx, RegistrationITKv4/ImageRegistration1.cxx, RegistrationITKv4/ImageRegistration10.cxx, RegistrationITKv4/ImageRegistration11.cxx, RegistrationITKv4/ImageRegistration12.cxx, RegistrationITKv4/ImageRegistration13.cxx, RegistrationITKv4/ImageRegistration14.cxx, RegistrationITKv4/ImageRegistration15.cxx, RegistrationITKv4/ImageRegistration16.cxx, RegistrationITKv4/ImageRegistration17.cxx, RegistrationITKv4/ImageRegistration18.cxx, RegistrationITKv4/ImageRegistration19.cxx, RegistrationITKv4/ImageRegistration2.cxx, RegistrationITKv4/ImageRegistration20.cxx, RegistrationITKv4/ImageRegistration3.cxx, RegistrationITKv4/ImageRegistration4.cxx, RegistrationITKv4/ImageRegistration5.cxx, RegistrationITKv4/ImageRegistration6.cxx, RegistrationITKv4/ImageRegistration7.cxx, RegistrationITKv4/ImageRegistration8.cxx, RegistrationITKv4/ImageRegistration9.cxx, RegistrationITKv4/ImageRegistrationHistogramPlotter.cxx, RegistrationITKv4/LandmarkWarping2.cxx, RegistrationITKv4/ModelToImageRegistration1.cxx, RegistrationITKv4/ModelToImageRegistration2.cxx, RegistrationITKv4/MultiResImageRegistration1.cxx, RegistrationITKv4/MultiResImageRegistration2.cxx, RegistrationITKv4/MultiResImageRegistration3.cxx, RegistrationITKv4/ThinPlateSplineWarp.cxx, Segmentation/CannySegmentationLevelSetImageFilter.cxx, Segmentation/CellularSegmentation1.cxx, Segmentation/CellularSegmentation2.cxx, Segmentation/ConfidenceConnected.cxx, Segmentation/ConfidenceConnected3D.cxx, Segmentation/ConnectedThresholdImageFilter.cxx, Segmentation/CurvesLevelSetImageFilter.cxx, Segmentation/FastMarchingImageFilter.cxx, Segmentation/GeodesicActiveContourImageFilter.cxx, Segmentation/GeodesicActiveContourShapePriorLevelSetImageFilter.cxx, Segmentation/HoughTransform2DCirclesImageFilter.cxx, Segmentation/HoughTransform2DLinesImageFilter.cxx, Segmentation/IsolatedConnectedImageFilter.cxx, Segmentation/LaplacianSegmentationLevelSetImageFilter.cxx, Segmentation/NeighborhoodConnectedImageFilter.cxx, Segmentation/ShapeDetectionLevelSetFilter.cxx, Segmentation/ThresholdSegmentationLevelSetImageFilter.cxx, Segmentation/VectorConfidenceConnected.cxx, Segmentation/WatershedSegmentation1.cxx, Segmentation/WatershedSegmentation2.cxx, SpatialObjects/BoundingBoxFromImageMaskSpatialObject.cxx, Statistics/BayesianClassifier.cxx, Statistics/BayesianClassifierInitializer.cxx, Statistics/ImageEntropy1.cxx, Statistics/ImageHistogram1.cxx, Statistics/ImageHistogram2.cxx, Statistics/ImageHistogram3.cxx, Statistics/ImageHistogram4.cxx, Statistics/ImageMutualInformation1.cxx, Statistics/ScalarImageKmeansClassifier.cxx, Statistics/ScalarImageKmeansModelEstimator.cxx, and Statistics/ScalarImageMarkovRandomField1.cxx.

Definition at line 51 of file 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
 
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 ITK_OVERRIDE 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
 

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

Examples:
Filtering/DigitallyReconstructedRadiograph1.cxx, IO/XML/DOMFindDemo.cxx, IO/XML/ParticleSwarmOptimizerReadWrite.cxx, RegistrationITKv3/DeformableRegistration10.cxx, RegistrationITKv3/DeformableRegistration9.cxx, RegistrationITKv4/DeformableRegistration10.cxx, RegistrationITKv4/DeformableRegistration9.cxx, and Statistics/BayesianClassifier.cxx.
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 147 of file itkExceptionObject.h.


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