1 #ifndef __EXCEPTION_H__ 2 #define __EXCEPTION_H__ 22 #define THROW(exception) \ 25 myexcp.setDebugInformation(__FILE__, __LINE__, __FUNCSIG__); \ 28 #define THROWM(exception, message) \ 30 exception myexcp(message); \ 31 myexcp.setDebugInformation(__FILE__, __LINE__, __FUNCSIG__); \ 34 #define THROWMF_FILEEXCEPTION(message, filenameorfileinfo) \ 36 FileException myexcp(message, filenameorfileinfo); \ 37 myexcp.setDebugInformation(__FILE__, __LINE__, __FUNCSIG__); \ 41 #define THROWT(exception) \ 44 myexcp.setDebugInformation(__FILE__, __LINE__, __FUNCSIG__); \ 45 myexcp.setTranslatable(true); \ 48 #define THROWMT(exception, message) \ 50 exception myexcp(message); \ 51 myexcp.setDebugInformation(__FILE__, __LINE__, __FUNCSIG__); \ 52 myexcp.setTranslatable(true); \ 55 #define THROWMFT_FILEEXCEPTION(message, filenameorfileinfo) \ 57 FileException myexcp(message, filenameorfileinfo); \ 58 myexcp.setDebugInformation(__FILE__, __LINE__, __FUNCSIG__); \ 59 myexcp.setTranslatable(true); \ 63 #elif defined(__GNUC__) 65 #define THROW(exception) \ 68 myexcp.setDebugInformation(__FILE__, __LINE__, __PRETTY_FUNCTION__); \ 71 #define THROWM(exception, message) \ 73 exception myexcp(message); \ 74 myexcp.setDebugInformation(__FILE__, __LINE__, __PRETTY_FUNCTION__); \ 77 #define THROWMF_FILEEXCEPTION(message, filenameorfileinfo) \ 79 FileException myexcp(message, filenameorfileinfo); \ 80 myexcp.setDebugInformation(__FILE__, __LINE__, __PRETTY_FUNCTION__); \ 84 #define THROWT(exception) \ 87 myexcp.setDebugInformation(__FILE__, __LINE__, __PRETTY_FUNCTION__); \ 88 myexcp.setTranslatable(true); \ 91 #define THROWMT(exception, message) \ 93 exception myexcp(message); \ 94 myexcp.setDebugInformation(__FILE__, __LINE__, __PRETTY_FUNCTION__); \ 95 myexcp.setTranslatable(true); \ 98 #define THROWMFT_FILEEXCEPTION(message, filenameorfileinfo) \ 100 FileException myexcp(message, filenameorfileinfo); \ 101 myexcp.setDebugInformation(__FILE__, __LINE__, __PRETTY_FUNCTION__); \ 102 myexcp.setTranslatable(true); \ 108 #define THROW(exception) \ 111 myexcp.setDebugInformation(__FILE__, __LINE__, __func__); \ 114 #define THROWM(exception, message) \ 116 exception myexcp(message); \ 117 myexcp.setDebugInformation(__FILE__, __LINE__, __func__); \ 120 #define THROWMF_FILEEXCEPTION(message, filenameorfileinfo) \ 122 FileException myexcp(message, filenameorfileinfo); \ 123 myexcp.setDebugInformation(__FILE__, __LINE__, __func__); \ 127 #define THROWT(exception) \ 130 myexcp.setDebugInformation(__FILE__, __LINE__, __func__); \ 131 myexcp.setTranslatable(true); \ 134 #define THROWMT(exception, message) \ 136 exception myexcp(message); \ 137 myexcp.setDebugInformation(__FILE__, __LINE__, __func__); \ 138 myexcp.setTranslatable(true); \ 141 #define THROWMFT_FILEEXCEPTION(message, filenameorfileinfo) \ 143 FileException myexcp(message, filenameorfileinfo); \ 144 myexcp.setDebugInformation(__FILE__, __LINE__, __func__); \ 145 myexcp.setTranslatable(true); \ 152 #define FC_THROWM(_exception, _msg) \ 155 std::stringstream ss; \ 157 THROWM(_exception, ss.str().c_str()); \ 160 #define THROW_CON_ERR_IF(_condition_, _msg_) \ 162 throw Base::ConstructionError(_msg_); 164 #define THROW_FAIL_NDONE_IF(_condition_, _msg_) \ 166 throw Base::FailedNotDone(_msg_); 173 Exception(
const char* sMessage,
const char* detail);
180 virtual const char* what(
void)
const throw();
181 virtual const char* detail(
void)
const throw();
183 void ReportException(
void)
const;
185 inline void SetMessage(
const char* sMessage);
187 inline std::string getFile()
const;
188 inline int getLine()
const;
189 inline std::string getFunction()
const;
190 inline bool getTranslatable()
const;
195 inline void setDebugInformation(
const std::string& file,
const int line,
const std::string&
function);
196 inline void setTranslatable(
bool translatable);
197 inline void setReported(
bool reported) { _isReported = reported; }
201 #pragma warning(disable : 4251) 205 std::string _file{
"" };
207 std::string _function{
"" };
208 bool _isTranslatable{
false };
209 mutable bool _isReported{
false };
229 virtual const char* what()
const throw();
269 virtual const char* what()
const throw();
287 virtual const char* what()
const throw();
305 virtual const char* what()
const throw();
323 virtual const char* what()
const throw();
341 virtual const char* what()
const throw();
359 virtual const char* what()
const throw();
377 virtual const char* what()
const throw();
395 virtual const char* what()
const throw();
478 #if !defined No_Exception && !defined No_Standard_OutOfRange 479 #define OutOfRange_Raise_if(CONDITION, MESSAGE) \ 481 throw Base::OutOfRange(MESSAGE); 483 #define OutOfRange_Raise_if(CONDITION, MESSAGE) 486 #if !defined No_Exception && !defined No_Standard_ConstructionError 487 #define ConstructionError_Raise_if(CONDITION, MESSAGE) \ 489 throw Base::ConstructionError(MESSAGE); 491 #define ConstructionError_Raise_if(CONDITION, MESSAGE) 494 #if !defined No_Exception && !defined No_gp_VectorWithNullMagnitude 495 #define VectorWithNullMagnitude_Raise_if(CONDITION, MESSAGE) \ 497 throw Base::VectorWithNullMagnitude(MESSAGE); 499 #define VectorWithNullMagnitude_Raise_if(CONDITION, MESSAGE) 502 #if !defined No_Exception 503 #define NotaNumber_if(CONDITION, MESSAGE) \ 505 throw Base::NotaNumber(MESSAGE); 507 #define NotaNumber_if(CONDITION, MESSAGE) 511 #endif // __EXCEPTION_H__ Definition: Exception.h:217
Definition: Exception.h:257
Definition: Exception.h:329
virtual ~MemoryException()
Destruction.
Definition: Exception.h:244
virtual ~CADKernelError()
Destruction.
Definition: Exception.h:439
virtual ~Exception()
Definition: Exception.h:176
virtual ~NotaNumber()
Destruction.
Definition: Exception.h:339
void SetMessage(const char *sMessage)
Definition: Exception.h:248
virtual ~DivisionByZeroError()
Destruction.
Definition: Exception.h:473
bool getReported() const
Definition: Exception.h:191
Definition: Exception.h:398
Definition: Exception.h:442
virtual ~AbortException()
Destruction.
Definition: Exception.h:227
std::string _sErrDetail
Definition: Exception.h:204
virtual ~FailedNotDone()
Destruction.
Definition: Exception.h:285
Definition: Exception.h:383
virtual ~FileException()
Destruction.
Definition: Exception.h:357
virtual ~NotImplementedError()
Destruction.
Definition: Exception.h:461
virtual ~ItemNotFound()
Destruction.
Definition: Exception.h:303
virtual ~TypeError()
Destruction.
Definition: Exception.h:450
Definition: Exception.h:420
virtual ~BadArguments()
Destruction.
Definition: Exception.h:393
virtual ~ValueError()
Destruction.
Definition: Exception.h:428
Definition: Exception.h:293
std::string _sErrMsg
Definition: Exception.h:203
Definition: Exception.h:453
void setReported(bool reported)
Definition: Exception.h:197
virtual ~RuntimeError()
Destruction.
Definition: Exception.h:416
Definition: Exception.h:431
virtual ~VectorWithNullMagnitude()
Destruction.
Definition: Exception.h:375
Definition: AbstractXMLReader.h:5
Definition: Exception.h:408
Definition: Exception.h:236
Definition: Exception.h:170
Definition: Exception.h:311
GuidInUseException()
Definition: Exception.h:401
virtual ~OutOfRange()
Destruction.
Definition: Exception.h:321
Definition: Exception.h:275
Definition: Exception.h:365
virtual ~ConstructionError()
Destruction.
Definition: Exception.h:267
GuidInUseException(const char *sMessage)
Definition: Exception.h:403
Definition: Exception.h:465
Definition: Exception.h:347