tizen 2.4 release
[framework/web/wrt-plugins-common.git] / src / Commons / Exception.h
similarity index 70%
rename from src_mobile/Commons/Exception.h
rename to src/Commons/Exception.h
index 0f1db99..78eba65 100644 (file)
 #ifndef WRTDEVICEAPIS_COMMONS_EXCEPTION_H_
 #define WRTDEVICEAPIS_COMMONS_EXCEPTION_H_
 
+#include <string>
 #include <dpl/exception.h>
 
 namespace WrtDeviceApis {
 namespace Commons {
-#define PLUGINS_DECLARE_EXCEPTION_TYPE(BaseClass, Class) \
-    class Class :       \
-        public BaseClass \
-    { \
-        ExceptionCodes::Enumeration m_code; \
-      public: \
-        virtual ExceptionCodes::Enumeration getCode() const { return m_code; } \
-        Class(const char *path, \
-              const char *function, \
-              int line, \
-              const std::string & message = std::string()) :                                                                                               \
-            BaseClass(path, function, line, message) \
-        { \
-            BaseClass::m_className = #Class; \
-            m_code = ExceptionCodes::Class; \
-        } \
- \
-        Class(const char *path, \
-              const char *function, \
-              int line, \
-              const DPL::Exception & reason, \
-              const std::string & message = std::string()) :                                                                                                                             \
-            BaseClass(path, function, line, reason, message) \
-        { \
-            BaseClass::m_className = #Class; \
-            m_code = ExceptionCodes::Class; \
-        } \
+#define PLUGINS_DECLARE_EXCEPTION_TYPE(BaseClass, Class)                       \
+    class Class : public BaseClass                                             \
+    {                                                                          \
+    public:                                                                    \
+        Class() = default;                                                     \
+                                                                               \
+        Class(const char *path,                                                \
+              const char *function,                                            \
+              int line,                                                        \
+              const std::string & message = std::string()) :                   \
+            BaseClass(path, function, line, message)                           \
+        { }                                                                    \
+                                                                               \
+        Class(const char *path,                                                \
+              const char *function,                                            \
+              int line,                                                        \
+              const DPL::Exception & reason,                                   \
+              const std::string & message = std::string()) :                   \
+            BaseClass(path, function, line, reason, message)                   \
+        { }                                                                    \
+                                                                               \
+        virtual ::WrtDeviceApis::Commons::ExceptionCodes::Enumeration getCode() const  \
+        {                                                                      \
+            return ::WrtDeviceApis::Commons::ExceptionCodes::Class;            \
+        }                                                                      \
     };
 
 class ExceptionCodes