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 const char * what() const noexcept 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 const
char * GetNameOfClass()
const override
191 {
return "MemoryAllocationError"; }
215 const
char * GetNameOfClass()
const override
216 {
return "RangeError"; }
247 const
char * GetNameOfClass()
const override
248 {
return "InvalidArgumentError"; }
272 const
char * GetNameOfClass()
const 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 const
char * GetNameOfClass()
const override
307 {
return "ProcessAborted"; }
311 #endif //itkExceptionObject_h
ProcessAborted(const std::string &file, unsigned int lineNumber)
InvalidArgumentError(const char *file, unsigned int lineNumber)
std::exception Superclass
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)
InvalidArgumentError() noexcept
IncompatibleOperandsError() noexcept
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)
static constexpr double e
The base of the natural logarithm or Euler's number
Implements transparent reference counting.
RangeError(const char *file, unsigned int lineNumber)
MemoryAllocationError() noexcept
IncompatibleOperandsError(const std::string &file, unsigned int lineNumber)
MemoryAllocationError(const char *file, unsigned int lineNumber)