Move catch exception macro to common.h 58/262358/2
authorSeungho Baek <sbsh.baek@samsung.com>
Mon, 9 Aug 2021 04:59:27 +0000 (13:59 +0900)
committerSeungho Baek <sbsh.baek@samsung.com>
Mon, 9 Aug 2021 05:17:19 +0000 (14:17 +0900)
Change-Id: I195d0ca70e71608f5f8604cab1e350beb22fa8e2
Signed-off-by: Seungho Baek <sbsh.baek@samsung.com>
14 files changed:
dali-csharp-binder/src/canvas-view-wrap.cpp
dali-csharp-binder/src/common.h
dali-csharp-binder/src/constraint-wrap.cpp
dali-csharp-binder/src/dali-wrap.cpp
dali-csharp-binder/src/encoded-image-buffer-wrap.cpp
dali-csharp-binder/src/fade-wrap.cpp
dali-csharp-binder/src/input-options-wrap.cpp
dali-csharp-binder/src/processor-controller.cpp
dali-csharp-binder/src/rive-animation-view-wrap.cpp
dali-csharp-binder/src/rotation-wrap.cpp
dali-csharp-binder/src/transition-base-wrap.cpp
dali-csharp-binder/src/transition-set-wrap.cpp
dali-csharp-binder/src/transition-wrap.cpp
dali-csharp-binder/src/web-view-wrap.cpp

index 2bd2aff..ea83df4 100644 (file)
@@ -8,24 +8,6 @@
 using namespace Dali;
 using namespace Dali::Toolkit;
 
-#define CALL_CATCH_EXCEPTION(ret)                                              \
-  catch (std::out_of_range & e) {                                              \
-    SWIG_CSharpException(SWIG_IndexError, const_cast<char *>(e.what()));       \
-    return ret;                                                                \
-  }                                                                            \
-  catch (std::exception & e) {                                                 \
-    SWIG_CSharpException(SWIG_RuntimeError, const_cast<char *>(e.what()));     \
-    return ret;                                                                \
-  }                                                                            \
-  catch (Dali::DaliException e) {                                              \
-    SWIG_CSharpException(SWIG_UnknownError, e.condition);                      \
-    return ret;                                                                \
-  }                                                                            \
-  catch (...) {                                                                \
-    SWIG_CSharpException(SWIG_UnknownError, "unknown error");                  \
-    return ret;                                                                \
-  }
-
 #ifdef __cplusplus
 extern "C" {
 #endif
index 1a277ff..41e4e34 100755 (executable)
@@ -168,4 +168,29 @@ extern void SWIG_CSharpException(int code, const char *msg);
 #include <dali-toolkit/devel-api/controls/control-wrapper-impl.h>
 #include <dali-toolkit/devel-api/controls/control-devel.h>
 
+
+
+// Define Catch exception
+#define CALL_CATCH_EXCEPTION(ret)                                          \
+  catch (std::out_of_range & e)                                            \
+  {                                                                        \
+    SWIG_CSharpException(SWIG_IndexError, const_cast<char *>(e.what()));   \
+    return ret;                                                            \
+  }                                                                        \
+  catch (std::exception & e)                                               \
+  {                                                                        \
+    SWIG_CSharpException(SWIG_RuntimeError, const_cast<char *>(e.what())); \
+    return ret;                                                            \
+  }                                                                        \
+  catch (Dali::DaliException e)                                            \
+  {                                                                        \
+    SWIG_CSharpException(SWIG_UnknownError, e.condition);                  \
+    return ret;                                                            \
+  }                                                                        \
+  catch (...)                                                              \
+  {                                                                        \
+    SWIG_CSharpException(SWIG_UnknownError, "unknown error");              \
+    return ret;                                                            \
+  }
+
 #endif // CSHARP_COMMON_H
index 030156f..5711257 100755 (executable)
@@ -23,28 +23,6 @@ extern "C"
 {
 #endif
 
-#define CALL_CATCH_EXCEPTION(ret)                                          \
-  catch (std::out_of_range & e)                                            \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_IndexError, const_cast<char *>(e.what()));   \
-    return ret;                                                            \
-  }                                                                        \
-  catch (std::exception & e)                                               \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_RuntimeError, const_cast<char *>(e.what())); \
-    return ret;                                                            \
-  }                                                                        \
-  catch (Dali::DaliException e)                                            \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_UnknownError, e.condition);                  \
-    return ret;                                                            \
-  }                                                                        \
-  catch (...)                                                              \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_UnknownError, "unknown error");              \
-    return ret;                                                            \
-  }
-
 SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_EqualConstraintWithParentFloat_New(void * nuiHandle, int nuiTargetIndex, int nuiParentIndex)
 {
   Dali::Handle *handle = (Dali::Handle *) 0;
index 3f94047..d500584 100755 (executable)
@@ -646,30 +646,27 @@ unsigned int int_to_uint(int x) {
    return (unsigned int) x;
 }
 
-
-#define CALL_CATCH_EXCEPTION(ret)          \
-        catch (std::out_of_range& e)            \
-         {                                                                                                                                  \
-             SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what()));   \
-             return ret;\
-          }                                                                                                                                 \
-          catch (std::exception& e)                                                                                         \
-          {                                                                                                                                 \
-            SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what()));\
-            return ret;\
-          }                                                                                                                                 \
-          catch (DaliException e)                                                                                            \
-          {                                                                                                                                 \
-            SWIG_CSharpException(SWIG_UnknownError, e.condition);                            \
-            return ret;\
-          }                                                                                                                                 \
-          catch (...)                                                                                                                  \
-          {                                                                                                                                 \
-            SWIG_CSharpException(SWIG_UnknownError, "unknown error");                  \
-            return ret;\
-          }
-
-
+#define CALL_CATCH_EXCEPTION(ret)                                          \
+  catch (std::out_of_range & e)                                            \
+  {                                                                        \
+    SWIG_CSharpException(SWIG_IndexError, const_cast<char *>(e.what()));   \
+    return ret;                                                            \
+  }                                                                        \
+  catch (std::exception & e)                                               \
+  {                                                                        \
+    SWIG_CSharpException(SWIG_RuntimeError, const_cast<char *>(e.what())); \
+    return ret;                                                            \
+  }                                                                        \
+  catch (DaliException e)                                                  \
+  {                                                                        \
+    SWIG_CSharpException(SWIG_UnknownError, e.condition);                  \
+    return ret;                                                            \
+  }                                                                        \
+  catch (...)                                                              \
+  {                                                                        \
+    SWIG_CSharpException(SWIG_UnknownError, "unknown error");              \
+    return ret;                                                            \
+  }
 
 using namespace Dali;
 using namespace Dali::Toolkit;
index 82802e6..a478816 100755 (executable)
@@ -25,28 +25,6 @@ extern "C"
 {
 #endif
 
-#define CALL_CATCH_EXCEPTION(ret)                                          \
-  catch (std::out_of_range & e)                                            \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_IndexError, const_cast<char *>(e.what()));   \
-    return ret;                                                            \
-  }                                                                        \
-  catch (std::exception & e)                                               \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_RuntimeError, const_cast<char *>(e.what())); \
-    return ret;                                                            \
-  }                                                                        \
-  catch (Dali::DaliException e)                                            \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_UnknownError, e.condition);                  \
-    return ret;                                                            \
-  }                                                                        \
-  catch (...)                                                              \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_UnknownError, "unknown error");              \
-    return ret;                                                            \
-  }
-
 SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_new_EncodedImageBuffer__SWIG_0()
 {
   void *jresult;
index b90aabd..15af66d 100755 (executable)
@@ -24,28 +24,6 @@ extern "C"
 {
 #endif
 
-#define CALL_CATCH_EXCEPTION(ret)                                          \
-  catch (std::out_of_range & e)                                            \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_IndexError, const_cast<char *>(e.what()));   \
-    return ret;                                                            \
-  }                                                                        \
-  catch (std::exception & e)                                               \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_RuntimeError, const_cast<char *>(e.what())); \
-    return ret;                                                            \
-  }                                                                        \
-  catch (Dali::DaliException e)                                            \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_UnknownError, e.condition);                  \
-    return ret;                                                            \
-  }                                                                        \
-  catch (...)                                                              \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_UnknownError, "unknown error");              \
-    return ret;                                                            \
-  }
-
   SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_new_Fade()
   {
     void *jresult;
index bd5a19c..c164706 100644 (file)
@@ -24,28 +24,6 @@ extern "C"
 {\r
 #endif\r
 \r
-#define CALL_CATCH_EXCEPTION(ret)                                          \\r
-  catch (std::out_of_range & e)                                            \\r
-  {                                                                        \\r
-    SWIG_CSharpException(SWIG_IndexError, const_cast<char *>(e.what()));   \\r
-    return ret;                                                            \\r
-  }                                                                        \\r
-  catch (std::exception & e)                                               \\r
-  {                                                                        \\r
-    SWIG_CSharpException(SWIG_RuntimeError, const_cast<char *>(e.what())); \\r
-    return ret;                                                            \\r
-  }                                                                        \\r
-  catch (Dali::DaliException e)                                            \\r
-  {                                                                        \\r
-    SWIG_CSharpException(SWIG_UnknownError, e.condition);                  \\r
-    return ret;                                                            \\r
-  }                                                                        \\r
-  catch (...)                                                              \\r
-  {                                                                        \\r
-    SWIG_CSharpException(SWIG_UnknownError, "unknown error");              \\r
-    return ret;                                                            \\r
-  }\r
-\r
 using namespace Dali;\r
 \r
 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_GestureOptions_SetPanGesturePredictionMode(int mode) {\r
index 444c1bb..c9c9abc 100644 (file)
 extern "C" {
 #endif
 
-#define CALL_CATCH_EXCEPTION(ret)                                          \
-  catch (std::out_of_range & e)                                            \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_IndexError, const_cast<char *>(e.what()));   \
-    return ret;                                                            \
-  }                                                                        \
-  catch (std::exception & e)                                               \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_RuntimeError, const_cast<char *>(e.what())); \
-    return ret;                                                            \
-  }                                                                        \
-  catch (Dali::DaliException e)                                            \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_UnknownError, e.condition);                  \
-    return ret;                                                            \
-  }                                                                        \
-  catch (...)                                                              \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_UnknownError, "unknown error");              \
-    return ret;                                                            \
-  }
-
 ProcessorController::ProcessorController()
 : mHandler(nullptr)
 {
index 75ae1c6..e4e0362 100644 (file)
@@ -8,24 +8,6 @@ using namespace Dali;
 using namespace Dali::Toolkit;
 using namespace Dali::Extension;
 
-#define CALL_CATCH_EXCEPTION(ret)                                              \
-  catch (std::out_of_range & e) {                                              \
-    SWIG_CSharpException(SWIG_IndexError, const_cast<char *>(e.what()));       \
-    return ret;                                                                \
-  }                                                                            \
-  catch (std::exception & e) {                                                 \
-    SWIG_CSharpException(SWIG_RuntimeError, const_cast<char *>(e.what()));     \
-    return ret;                                                                \
-  }                                                                            \
-  catch (Dali::DaliException e) {                                              \
-    SWIG_CSharpException(SWIG_UnknownError, e.condition);                      \
-    return ret;                                                                \
-  }                                                                            \
-  catch (...) {                                                                \
-    SWIG_CSharpException(SWIG_UnknownError, "unknown error");                  \
-    return ret;                                                                \
-  }
-
 #ifdef __cplusplus
 extern "C" {
 #endif
index a1b91a1..b6a883f 100644 (file)
@@ -24,28 +24,6 @@ extern "C"
 {
 #endif
 
-#define CALL_CATCH_EXCEPTION(ret)                                          \
-  catch (std::out_of_range & e)                                            \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_IndexError, const_cast<char *>(e.what()));   \
-    return ret;                                                            \
-  }                                                                        \
-  catch (std::exception & e)                                               \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_RuntimeError, const_cast<char *>(e.what())); \
-    return ret;                                                            \
-  }                                                                        \
-  catch (Dali::DaliException e)                                            \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_UnknownError, e.condition);                  \
-    return ret;                                                            \
-  }                                                                        \
-  catch (...)                                                              \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_UnknownError, "unknown error");              \
-    return ret;                                                            \
-  }
-
   SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_new_Rotation_0()
   {
     void *jresult;
index 4015b68..89bec7a 100755 (executable)
@@ -25,28 +25,6 @@ extern "C"
 {
 #endif
 
-#define CALL_CATCH_EXCEPTION(ret)                                          \
-  catch (std::out_of_range & e)                                            \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_IndexError, const_cast<char *>(e.what()));   \
-    return ret;                                                            \
-  }                                                                        \
-  catch (std::exception & e)                                               \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_RuntimeError, const_cast<char *>(e.what())); \
-    return ret;                                                            \
-  }                                                                        \
-  catch (Dali::DaliException e)                                            \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_UnknownError, e.condition);                  \
-    return ret;                                                            \
-  }                                                                        \
-  catch (...)                                                              \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_UnknownError, "unknown error");              \
-    return ret;                                                            \
-  }
-
   SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_new_TransitionBase()
   {
     void *jresult;
index fcdac54..2e5da38 100755 (executable)
@@ -45,28 +45,6 @@ extern "C"
 {
 #endif
 
-#define CALL_CATCH_EXCEPTION(ret)                                          \
-  catch (std::out_of_range & e)                                            \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_IndexError, const_cast<char *>(e.what()));   \
-    return ret;                                                            \
-  }                                                                        \
-  catch (std::exception & e)                                               \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_RuntimeError, const_cast<char *>(e.what())); \
-    return ret;                                                            \
-  }                                                                        \
-  catch (Dali::DaliException e)                                            \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_UnknownError, e.condition);                  \
-    return ret;                                                            \
-  }                                                                        \
-  catch (...)                                                              \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_UnknownError, "unknown error");              \
-    return ret;                                                            \
-  }
-
   SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_new_TransitionSet()
   {
     void *jresult;
index ca76ef1..85cb15c 100755 (executable)
@@ -24,28 +24,6 @@ extern "C"
 {
 #endif
 
-#define CALL_CATCH_EXCEPTION(ret)                                          \
-  catch (std::out_of_range & e)                                            \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_IndexError, const_cast<char *>(e.what()));   \
-    return ret;                                                            \
-  }                                                                        \
-  catch (std::exception & e)                                               \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_RuntimeError, const_cast<char *>(e.what())); \
-    return ret;                                                            \
-  }                                                                        \
-  catch (Dali::DaliException e)                                            \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_UnknownError, e.condition);                  \
-    return ret;                                                            \
-  }                                                                        \
-  catch (...)                                                              \
-  {                                                                        \
-    SWIG_CSharpException(SWIG_UnknownError, "unknown error");              \
-    return ret;                                                            \
-  }
-
   SWIGEXPORT void *SWIGSTDCALL CSharp_Dali_new_Transition()
   {
     void *jresult;
index f12074b..aa463a1 100755 (executable)
 #include <dali/devel-api/adaptor-framework/web-engine-back-forward-list-item.h>
 #include <dali/public-api/common/dali-common.h>
 
-#define CALL_CATCH_EXCEPTION(ret)                                              \
-  catch (std::out_of_range & e) {                                              \
-    SWIG_CSharpException(SWIG_IndexError, const_cast<char *>(e.what()));       \
-    return ret;                                                                \
-  }                                                                            \
-  catch (std::exception & e) {                                                 \
-    SWIG_CSharpException(SWIG_RuntimeError, const_cast<char *>(e.what()));     \
-    return ret;                                                                \
-  }                                                                            \
-  catch (Dali::DaliException e) {                                              \
-    SWIG_CSharpException(SWIG_UnknownError, e.condition);                      \
-    return ret;                                                                \
-  }                                                                            \
-  catch (...) {                                                                \
-    SWIG_CSharpException(SWIG_UnknownError, "unknown error");                  \
-    return ret;                                                                \
-  }
-
 /* Callback for returning strings to C# without leaking memory */
 typedef char *(SWIGSTDCALL *SWIG_CSharpStringHelperCallback)(const char*);
 extern SWIG_CSharpStringHelperCallback SWIG_csharp_string_callback;