exception.h
Go to the documentation of this file.
00001 //
00002 // C++ Interface: exception
00003 //
00004 // Description:
00005 //
00006 //
00007 // Author: Jonas Haller
00008 //
00009 // Copyright: Neuronics AG, 2008
00010 //
00011 //
00012 
00013 #ifndef _EXCEPTION_H_
00014 #define _EXCEPTION_H_
00015 
00016 #include <string>
00017 
00018 namespace AnaGuess {
00019 
00024 
00025 class Exception : public std::exception {
00026     protected:
00027         const std::string mMessage;
00028         const int mErrorNumber;
00029 
00030     public:
00031         Exception(const std::string & aMessage, const int aErrorNumber) throw () :
00032             std::exception(),
00033             mMessage(aMessage), mErrorNumber(aErrorNumber) {
00034         }
00035 
00036         virtual ~Exception() throw () {
00037         }
00038 
00039         std::string message() const throw() {
00040             return mMessage;
00041         }
00042         const char* what() const throw() {
00043             return mMessage.c_str();
00044         }
00045 
00046         const int errorNumber() const throw() {
00047             return mErrorNumber;
00048         }
00049 };
00050 
00054 
00055 } // namespace
00056 
00057 #endif //_EXCEPTION_H_


kni
Author(s): Martin Günther
autogenerated on Thu Aug 27 2015 13:40:06