#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.
- Examples
- Examples/DataRepresentation/Image/Image5.cxx, Examples/DataRepresentation/Image/ImageAdaptor2.cxx, Examples/DataRepresentation/Mesh/ImageToPointSet.cxx, Examples/DataRepresentation/Path/PolyLineParametricPath1.cxx, Examples/Filtering/AntiAliasBinaryImageFilter.cxx, Examples/Filtering/CannyEdgeDetectionImageFilter.cxx, Examples/Filtering/CompositeFilterExample.cxx, Examples/Filtering/DanielssonDistanceMapImageFilter.cxx, Examples/Filtering/DiffusionTensor3DReconstructionImageFilter.cxx, Examples/Filtering/DigitallyReconstructedRadiograph1.cxx, Examples/Filtering/FFTImageFilter.cxx, Examples/Filtering/FFTImageFilterFourierDomainFiltering.cxx, Examples/Filtering/GrayscaleFunctionDilateImageFilter.cxx, Examples/Filtering/LaplacianImageFilter.cxx, Examples/Filtering/LaplacianRecursiveGaussianImageFilter1.cxx, Examples/Filtering/LaplacianRecursiveGaussianImageFilter2.cxx, Examples/Filtering/LaplacianSharpeningImageFilter.cxx, Examples/Filtering/MorphologicalImageEnhancement.cxx, Examples/Filtering/OtsuMultipleThresholdImageFilter.cxx, Examples/Filtering/OtsuThresholdImageFilter.cxx, Examples/Filtering/RGBToGrayscale.cxx, Examples/Filtering/ResampleImageFilter3.cxx, Examples/Filtering/ResampleImageFilter4.cxx, Examples/Filtering/ResampleImageFilter5.cxx, Examples/Filtering/ResampleImageFilter6.cxx, Examples/Filtering/ResampleImageFilter7.cxx, Examples/Filtering/ResampleImageFilter8.cxx, Examples/Filtering/ResampleImageFilter9.cxx, Examples/Filtering/ResampleVolumesToBeIsotropic.cxx, Examples/Filtering/SecondDerivativeRecursiveGaussianImageFilter.cxx, Examples/Filtering/SignedDanielssonDistanceMapImageFilter.cxx, Examples/Filtering/SpatialObjectToImage1.cxx, Examples/Filtering/SpatialObjectToImage2.cxx, Examples/Filtering/SpatialObjectToImage3.cxx, Examples/Filtering/SubsampleVolume.cxx, Examples/Filtering/SurfaceExtraction.cxx, Examples/Filtering/VectorIndexSelection.cxx, Examples/Filtering/WarpImageFilter1.cxx, Examples/Filtering/ZeroCrossingBasedEdgeDetectionImageFilter.cxx, Examples/IO/ComplexImageReadWrite.cxx, Examples/IO/CovariantVectorImageExtractComponent.cxx, Examples/IO/CovariantVectorImageRead.cxx, Examples/IO/CovariantVectorImageWrite.cxx, Examples/IO/DicomImageReadChangeHeaderWrite.cxx, Examples/IO/DicomImageReadPrintTags.cxx, Examples/IO/DicomImageReadWrite.cxx, Examples/IO/DicomPrintPatientInformation.cxx, Examples/IO/DicomSeriesReadGaussianImageWrite.cxx, Examples/IO/DicomSeriesReadImageWrite.cxx, Examples/IO/DicomSeriesReadImageWrite2.cxx, Examples/IO/DicomSeriesReadPrintTags.cxx, Examples/IO/DicomSeriesReadSeriesWrite.cxx, Examples/IO/IOPlugin.cxx, Examples/IO/ImageReadCastWrite.cxx, Examples/IO/ImageReadDicomSeriesWrite.cxx, Examples/IO/ImageReadExportVTK.cxx, Examples/IO/ImageReadExtractFilterInsertWrite.cxx, Examples/IO/ImageReadExtractWrite.cxx, Examples/IO/ImageReadImageSeriesWrite.cxx, Examples/IO/ImageReadRegionOfInterestWrite.cxx, Examples/IO/ImageReadWrite.cxx, Examples/IO/ImageSeriesReadWrite.cxx, Examples/IO/ImageSeriesReadWrite2.cxx, Examples/IO/RGBImageSeriesReadWrite.cxx, Examples/IO/TransformReadWrite.cxx, Examples/IO/VectorImageReadWrite.cxx, Examples/IO/VisibleHumanPasteWrite.cxx, Examples/IO/VisibleHumanStreamReadWrite.cxx, Examples/IO/XML/DOMFindDemo.cxx, Examples/IO/XML/ParticleSwarmOptimizerReadWrite.cxx, Examples/Iterators/ImageLinearIteratorWithIndex.cxx, Examples/Iterators/ImageLinearIteratorWithIndex2.cxx, Examples/Iterators/ImageRandomConstIteratorWithIndex.cxx, Examples/Iterators/ImageRegionIterator.cxx, Examples/Iterators/ImageRegionIteratorWithIndex.cxx, Examples/Iterators/ImageSliceIteratorWithIndex.cxx, Examples/Iterators/NeighborhoodIterators1.cxx, Examples/Iterators/NeighborhoodIterators2.cxx, Examples/Iterators/NeighborhoodIterators3.cxx, Examples/Iterators/NeighborhoodIterators4.cxx, Examples/Iterators/NeighborhoodIterators5.cxx, Examples/Iterators/NeighborhoodIterators6.cxx, Examples/Iterators/ShapedNeighborhoodIterators1.cxx, Examples/Iterators/ShapedNeighborhoodIterators2.cxx, Examples/RegistrationITKv4/BSplineWarping1.cxx, Examples/RegistrationITKv4/BSplineWarping2.cxx, Examples/RegistrationITKv4/ChangeInformationImageFilter.cxx, Examples/RegistrationITKv4/DeformableRegistration1.cxx, Examples/RegistrationITKv4/DeformableRegistration10.cxx, Examples/RegistrationITKv4/DeformableRegistration11.cxx, Examples/RegistrationITKv4/DeformableRegistration12.cxx, Examples/RegistrationITKv4/DeformableRegistration13.cxx, Examples/RegistrationITKv4/DeformableRegistration14.cxx, Examples/RegistrationITKv4/DeformableRegistration15.cxx, Examples/RegistrationITKv4/DeformableRegistration16.cxx, Examples/RegistrationITKv4/DeformableRegistration17.cxx, Examples/RegistrationITKv4/DeformableRegistration2.cxx, Examples/RegistrationITKv4/DeformableRegistration4.cxx, Examples/RegistrationITKv4/DeformableRegistration5.cxx, Examples/RegistrationITKv4/DeformableRegistration6.cxx, Examples/RegistrationITKv4/DeformableRegistration7.cxx, Examples/RegistrationITKv4/DeformableRegistration8.cxx, Examples/RegistrationITKv4/DeformableRegistration9.cxx, Examples/RegistrationITKv4/DisplacementFieldInitialization.cxx, Examples/RegistrationITKv4/ImageRegistration1.cxx, Examples/RegistrationITKv4/ImageRegistration10.cxx, Examples/RegistrationITKv4/ImageRegistration11.cxx, Examples/RegistrationITKv4/ImageRegistration12.cxx, Examples/RegistrationITKv4/ImageRegistration13.cxx, Examples/RegistrationITKv4/ImageRegistration14.cxx, Examples/RegistrationITKv4/ImageRegistration15.cxx, Examples/RegistrationITKv4/ImageRegistration16.cxx, Examples/RegistrationITKv4/ImageRegistration17.cxx, Examples/RegistrationITKv4/ImageRegistration18.cxx, Examples/RegistrationITKv4/ImageRegistration19.cxx, Examples/RegistrationITKv4/ImageRegistration2.cxx, Examples/RegistrationITKv4/ImageRegistration20.cxx, Examples/RegistrationITKv4/ImageRegistration3.cxx, Examples/RegistrationITKv4/ImageRegistration4.cxx, Examples/RegistrationITKv4/ImageRegistration5.cxx, Examples/RegistrationITKv4/ImageRegistration6.cxx, Examples/RegistrationITKv4/ImageRegistration7.cxx, Examples/RegistrationITKv4/ImageRegistration8.cxx, Examples/RegistrationITKv4/ImageRegistration9.cxx, Examples/RegistrationITKv4/ImageRegistrationHistogramPlotter.cxx, Examples/RegistrationITKv4/IterativeClosestPoint1.cxx, Examples/RegistrationITKv4/IterativeClosestPoint2.cxx, Examples/RegistrationITKv4/IterativeClosestPoint3.cxx, Examples/RegistrationITKv4/LandmarkWarping2.cxx, Examples/RegistrationITKv4/MeanSquaresImageMetric1.cxx, Examples/RegistrationITKv4/ModelToImageRegistration1.cxx, Examples/RegistrationITKv4/ModelToImageRegistration2.cxx, Examples/RegistrationITKv4/MultiResImageRegistration1.cxx, Examples/RegistrationITKv4/MultiResImageRegistration2.cxx, Examples/RegistrationITKv4/MultiResImageRegistration3.cxx, Examples/RegistrationITKv4/MultiStageImageRegistration1.cxx, Examples/RegistrationITKv4/MultiStageImageRegistration2.cxx, Examples/RegistrationITKv4/ThinPlateSplineWarp.cxx, Examples/Segmentation/CannySegmentationLevelSetImageFilter.cxx, Examples/Segmentation/ConfidenceConnected.cxx, Examples/Segmentation/ConfidenceConnected3D.cxx, Examples/Segmentation/ConnectedThresholdImageFilter.cxx, Examples/Segmentation/CurvesLevelSetImageFilter.cxx, Examples/Segmentation/FastMarchingImageFilter.cxx, Examples/Segmentation/GeodesicActiveContourImageFilter.cxx, Examples/Segmentation/GeodesicActiveContourShapePriorLevelSetImageFilter.cxx, Examples/Segmentation/HoughTransform2DCirclesImageFilter.cxx, Examples/Segmentation/HoughTransform2DLinesImageFilter.cxx, Examples/Segmentation/IsolatedConnectedImageFilter.cxx, Examples/Segmentation/LaplacianSegmentationLevelSetImageFilter.cxx, Examples/Segmentation/NeighborhoodConnectedImageFilter.cxx, Examples/Segmentation/ShapeDetectionLevelSetFilter.cxx, Examples/Segmentation/ThresholdSegmentationLevelSetImageFilter.cxx, Examples/Segmentation/VectorConfidenceConnected.cxx, Examples/Segmentation/WatershedSegmentation1.cxx, Examples/Segmentation/WatershedSegmentation2.cxx, Examples/SpatialObjects/BoundingBoxFromImageMaskSpatialObject.cxx, Examples/Statistics/BayesianClassifier.cxx, Examples/Statistics/BayesianClassifierInitializer.cxx, Examples/Statistics/ImageEntropy1.cxx, Examples/Statistics/ImageHistogram1.cxx, Examples/Statistics/ImageHistogram2.cxx, Examples/Statistics/ImageHistogram3.cxx, Examples/Statistics/ImageHistogram4.cxx, Examples/Statistics/ImageMutualInformation1.cxx, Examples/Statistics/ScalarImageKmeansClassifier.cxx, Examples/Statistics/ScalarImageKmeansModelEstimator.cxx, and Examples/Statistics/ScalarImageMarkovRandomField1.cxx.
Definition at line 50 of file itkExceptionObject.h.
◆ Superclass
◆ ExceptionObject() [1/5]
itk::ExceptionObject::ExceptionObject |
( |
| ) |
|
|
defaultnoexcept |
Explicitly-defaulted default-constructor. Creates an empty exception object.
◆ ExceptionObject() [2/5]
itk::ExceptionObject::ExceptionObject |
( |
const char * |
file, |
|
|
unsigned int |
lineNumber = 0 , |
|
|
const char * |
desc = "None" , |
|
|
const char * |
loc = "Unknown" |
|
) |
| |
|
explicit |
◆ ExceptionObject() [3/5]
itk::ExceptionObject::ExceptionObject |
( |
std::string |
file, |
|
|
unsigned int |
lineNumber = 0 , |
|
|
std::string |
desc = "None" , |
|
|
std::string |
loc = "Unknown" |
|
) |
| |
|
explicit |
◆ ExceptionObject() [4/5]
◆ ExceptionObject() [5/5]
◆ ~ExceptionObject()
itk::ExceptionObject::~ExceptionObject |
( |
| ) |
|
|
override |
Destructor.
- Note
- It appears necessary to define the destructor "out-of-line" for external linkage.
◆ GetDescription()
virtual const char * itk::ExceptionObject::GetDescription |
( |
| ) |
const |
|
virtual |
◆ GetFile()
virtual const char * itk::ExceptionObject::GetFile |
( |
| ) |
const |
|
virtual |
What file did the exception occur in?
◆ GetLine()
virtual unsigned int itk::ExceptionObject::GetLine |
( |
| ) |
const |
|
virtual |
What line did the exception occur in?
◆ GetLocation()
virtual const char * itk::ExceptionObject::GetLocation |
( |
| ) |
const |
|
virtual |
◆ GetNameOfClass()
virtual const char * itk::ExceptionObject::GetNameOfClass |
( |
| ) |
const |
|
virtual |
- See also
- LightObject::GetNameOfClass()
Reimplemented in itk::DataObjectError, itk::InvalidRequestedRegionError, itk::DerefError, itk::MemoryAllocationError, itk::RangeError, itk::InvalidArgumentError, itk::IncompatibleOperandsError, itk::ProcessAborted, itk::ImageFileWriterException, itk::ImageSeriesWriterException, itk::MeshFileReaderException, and itk::MeshFileWriterException.
◆ operator=() [1/2]
Copy-assignment operator.
◆ operator=() [2/2]
Move-assignment operator.
◆ operator==()
virtual bool itk::ExceptionObject::operator== |
( |
const ExceptionObject & |
orig | ) |
const |
|
virtual |
◆ Print()
virtual void itk::ExceptionObject::Print |
( |
std::ostream & |
os | ) |
const |
|
virtual |
◆ SetDescription() [1/2]
virtual void itk::ExceptionObject::SetDescription |
( |
const char * |
s | ) |
|
|
virtual |
◆ SetDescription() [2/2]
virtual void itk::ExceptionObject::SetDescription |
( |
const std::string & |
s | ) |
|
|
virtual |
◆ SetLocation() [1/2]
virtual void itk::ExceptionObject::SetLocation |
( |
const char * |
s | ) |
|
|
virtual |
◆ SetLocation() [2/2]
virtual void itk::ExceptionObject::SetLocation |
( |
const std::string & |
s | ) |
|
|
virtual |
◆ what()
const char * itk::ExceptionObject::what |
( |
| ) |
const |
|
overridenoexcept |
Provide std::exception::what() implementation.
◆ default_exception_message
constexpr const char* const itk::ExceptionObject::default_exception_message = "Generic ExceptionObject" |
|
staticconstexpr |
◆ m_ExceptionData
std::shared_ptr<const ExceptionData> itk::ExceptionObject::m_ExceptionData {} |
|
private |
The documentation for this class was generated from the following file: