Mercurial > dedupe
view Exception/Exception.hpp @ 81:69a30d9f126e
Make the DBLink reusable.
| author | Tom Fredrik Blenning Klaussen <bfg@bfgconsult.no> |
|---|---|
| date | Thu, 10 Oct 2013 14:12:17 +0200 |
| parents | 19d8825ec501 |
| children |
line wrap: on
line source
#ifndef EXCEPTION_HPP #define EXCEPTION_HPP #define NORETURN __attribute__ ((noreturn)) #define UNREACHABLE() abort() #include <QtCore/QString> class Exception { public: typedef QString string_t; virtual const string_t& toString() const { return errorMsg_; } virtual void raise() const NORETURN = 0; protected: Exception(const string_t& errorMsg = string_t()) : errorMsg_(errorMsg) {} virtual ~Exception() {} void setErrorMsg(string_t& errorMsg); const string_t& errorMsg(string_t& errorMsg); private: string_t errorMsg_; }; #endif //EXCEPTION_HPP
