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");
77 virtual const
char * GetNameOfClass()
const
78 {
return "ExceptionObject"; }
84 virtual void Print(std::ostream & os)
const;
89 virtual void SetLocation(
const std::string & s);
91 virtual void SetDescription(
const std::string & s);
93 virtual void SetLocation(
const char *s);
95 virtual void SetDescription(
const char *s);
97 virtual const char * GetLocation()
const;
99 virtual const char * GetDescription()
const;
102 virtual const char * GetFile()
const;
105 virtual unsigned int GetLine()
const;
108 virtual const char * what() const ITK_NOEXCEPT ITK_OVERRIDE;
139 virtual void Register()
const = 0;
141 virtual void UnRegister()
const = 0;
143 ReferenceCounterInterface();
144 virtual ~ReferenceCounterInterface();
147 class ReferenceCountedExceptionData;
149 const ExceptionData * GetExceptionData()
const;
184 unsigned int lineNumber,
185 const std::string & desc,
186 const std::string & loc):
ExceptionObject(file, lineNumber, desc, loc) {}
191 virtual const
char * GetNameOfClass() const ITK_OVERRIDE
192 {
return "MemoryAllocationError"; }
216 virtual const
char * GetNameOfClass() const ITK_OVERRIDE
217 {
return "RangeError"; }
248 virtual const
char * GetNameOfClass() const ITK_OVERRIDE
249 {
return "InvalidArgumentError"; }
273 virtual const
char * GetNameOfClass() const ITK_OVERRIDE
274 {
return "IncompatibleOperandsError"; }
289 this->SetDescription(
"Filter execution was aborted by an external request");
295 this->SetDescription(
"Filter execution was aborted by an external request");
301 this->SetDescription(
"Filter execution was aborted by an external request");
307 virtual const
char * GetNameOfClass() const ITK_OVERRIDE
308 {
return "ProcessAborted"; }
312 #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)
static const double e
The base of the natural logarithm or Euler's number
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)
std::exception Superclass