00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __NL_EXCEPTION
00023 #define __NL_EXCEPTION
00024
00025 #include "netlink/core.h"
00026
00027 NL_NAMESPACE
00028
00036 class Exception {
00037
00038 public:
00039
00040 enum CODE {
00041 #include "netlink/exception.code.inc"
00042 };
00043
00044 private:
00045
00046 CODE _code;
00047 string _msg;
00048 int _nativeErrorCode;
00049
00050 public:
00051
00052 Exception(CODE code, const string& msg, int nativeErrorCode = 0): _code(code), _msg(msg), _nativeErrorCode(nativeErrorCode) {}
00053
00081 CODE code() const { return _code; }
00082
00083
00090 const string& msg() const { return _msg; }
00091
00098 const char* what() const { return _msg.c_str(); }
00099
00100
00108 int nativeErrorCode() const { return _nativeErrorCode; }
00109 };
00110
00111 NL_NAMESPACE_END
00112
00113 #endif