23 #ifndef __ctkException_h 24 #define __ctkException_h 31 #include <ctkCoreExport.h> 55 QDebug print(QDebug dbg)
const;
106 virtual const
char* name() const throw();
112 virtual const
char* className() const throw();
118 virtual const
char* what() const throw();
124 QString message() const throw();
150 virtual
void rethrow() const;
161 virtual QDebug printStackTrace(QDebug dbg) const;
166 mutable std::
string WhatMsg;
169 void printEnclosedStackTrace(QDebug dbg, const
QList<QString>& enclosingTrace,
170 const QString& caption, const QString& prefix,
179 CTK_CORE_EXPORT QDebug operator<<(QDebug dbg, const
ctkException& exc);
196 #define CTK_DECLARE_EXCEPTION(API, CLS, BASE) \ 197 class API CLS : public BASE \ 200 explicit CLS(const QString& msg); \ 201 CLS(const QString& msg, const ctkException& exc); \ 202 CLS(const CLS& exc); \ 204 CLS& operator = (const CLS& exc); \ 205 const char* name() const throw(); \ 206 CLS* clone() const; \ 207 void rethrow() const ; \ 219 #define CTK_IMPLEMENT_EXCEPTION(CLS, BASE, NAME) \ 220 CLS::CLS(const QString& msg) : BASE(msg) \ 222 CLS::CLS(const QString& msg, const ctkException& exc) : BASE(msg, exc) \ 224 CLS::CLS(const CLS& exc) : BASE(exc) \ 226 CLS::~CLS() throw() \ 228 CLS& CLS::operator = (const CLS& exc) \ 230 BASE::operator = (exc); \ 233 const char* CLS::name() const throw() \ 237 CLS* CLS::clone() const \ 239 return new CLS(*this); \ 241 void CLS::rethrow() const \ 251 #endif // __ctkException_h
#define CTK_DECLARE_EXCEPTION(API, CLS, BASE)
Quickly declare a ctkException sub-class.
Obtains a back trace from the current execution context.
The base class for all exceptions defined in CTK.