19 #error "Do not include itkExceptionObject.h directly, include itkMacro.h instead."
22 #ifndef itkExceptionObject_h
23 #define itkExceptionObject_h
60 const char *desc =
"None",
const char *loc =
"Unknown");
61 explicit ExceptionObject(
const std::string & file,
unsigned int lineNumber = 0,
62 const std::string & desc =
"None",
63 const std::string & loc =
"Unknown");
76 virtual const
char * GetNameOfClass()
const
77 {
return "ExceptionObject"; }
83 virtual void Print(std::ostream & os)
const;
88 virtual void SetLocation(
const std::string & s);
90 virtual void SetDescription(
const std::string & s);
92 virtual void SetLocation(
const char *s);
94 virtual void SetDescription(
const char *s);
96 virtual const char * GetLocation()
const;
98 virtual const char * GetDescription()
const;
101 virtual const char * GetFile()
const;
104 virtual unsigned int GetLine()
const;
107 virtual const char * what() const ITK_NOEXCEPT ITK_OVERRIDE;
138 virtual void Register()
const = 0;
140 virtual void UnRegister()
const = 0;
142 ReferenceCounterInterface();
143 virtual ~ReferenceCounterInterface();
146 class ReferenceCountedExceptionData;
148 const ExceptionData * GetExceptionData()
const;
183 unsigned int lineNumber,
184 const std::string & desc,
185 const std::string & loc):
ExceptionObject(file, lineNumber, desc, loc) {}
190 virtual const
char * GetNameOfClass() const ITK_OVERRIDE
191 {
return "MemoryAllocationError"; }
213 virtual ~
RangeError() ITK_NOEXCEPT ITK_OVERRIDE;
215 virtual const
char * GetNameOfClass() const ITK_OVERRIDE
216 {
return "RangeError"; }
247 virtual const
char * GetNameOfClass() const ITK_OVERRIDE
248 {
return "InvalidArgumentError"; }
272 virtual const
char * GetNameOfClass() const ITK_OVERRIDE
273 {
return "IncompatibleOperandsError"; }
288 this->SetDescription(
"Filter execution was aborted by an external request");
294 this->SetDescription(
"Filter execution was aborted by an external request");
300 this->SetDescription(
"Filter execution was aborted by an external request");
306 virtual const
char * GetNameOfClass() const ITK_OVERRIDE
307 {
return "ProcessAborted"; }
311 #endif //itkExceptionObject_h
IncompatibleOperandsError()
ProcessAborted(const std::string &file, unsigned int lineNumber)
InvalidArgumentError(const char *file, unsigned int lineNumber)
IncompatibleOperandsError(const char *file, unsigned int lineNumber)
RangeError(const std::string &file, unsigned int lineNumber)
std::ostream & operator<<(std::ostream &os, const Array< TValue > &arr)
ProcessAborted(const char *file, unsigned int lineNumber)
Standard exception handling object.
SmartPointer< const ReferenceCounterInterface > m_ExceptionData
InvalidArgumentError(const std::string &file, unsigned int lineNumber)
MemoryAllocationError(const std::string &file, unsigned int lineNumber, const std::string &desc, const std::string &loc)
MemoryAllocationError(const std::string &file, unsigned int lineNumber)
Implements transparent reference counting.
RangeError(const char *file, unsigned int lineNumber)
IncompatibleOperandsError(const std::string &file, unsigned int lineNumber)
MemoryAllocationError(const char *file, unsigned int lineNumber)
static ITK_CONSTEXPR_VAR double e
The base of the natural logarithm or Euler's number
std::exception Superclass