summaryrefslogtreecommitdiff
path: root/src/lib/eolian_cxx/grammar/inheritance_base_generator.hh
diff options
context:
space:
mode:
authorLarry Jr <larry.olj@gmail.com>2014-08-14 15:20:49 -0300
committerVitor Sousa <vitorsousasilva@gmail.com>2015-01-05 15:52:27 -0200
commitebebcf64389d4e362ee9efaaf8aad4a1e76149e4 (patch)
tree303085f9a4dcd190165e5d171b794389403cfe64 /src/lib/eolian_cxx/grammar/inheritance_base_generator.hh
parentd5ec6c41d9bbd9e028503fe98dc6679f8c754140 (diff)
catch exceptions in cxx wrappers and throw a eina_error
Diffstat (limited to 'src/lib/eolian_cxx/grammar/inheritance_base_generator.hh')
-rw-r--r--src/lib/eolian_cxx/grammar/inheritance_base_generator.hh24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/lib/eolian_cxx/grammar/inheritance_base_generator.hh b/src/lib/eolian_cxx/grammar/inheritance_base_generator.hh
index 36d0821826..31539c6ec2 100644
--- a/src/lib/eolian_cxx/grammar/inheritance_base_generator.hh
+++ b/src/lib/eolian_cxx/grammar/inheritance_base_generator.hh
@@ -107,12 +107,28 @@ operator<<(std::ostream& out, inheritance_wrappers const& x)
107 << (func.params.size() ? ", " : "") 107 << (func.params.size() ? ", " : "")
108 << parameters_c_declaration(func.params) 108 << parameters_c_declaration(func.params)
109 << ")" << endl 109 << ")" << endl
110 << "{" << endl 110 << "{" << endl;
111 << tab(1) 111
112 << (!function_is_void(func) ? "return ": "") 112 if (!function_is_void(func))
113 out << tab(1) << reinterpret_type(func.ret) << " _tmp_ret{};" << endl;
114
115 out << tab(1)
116 << "try" << endl
117 << tab(2) << "{" << endl
118 << tab(3)
119 << (!function_is_void(func) ? "_tmp_ret = ": "")
113 << "static_cast<T*>(self->this_)->" 120 << "static_cast<T*>(self->this_)->"
114 << func.name << "(" << parameters_cxx_list(func.params) << ");" << endl 121 << func.name << "(" << parameters_cxx_list(func.params) << ");" << endl
115 << "}" << endl << endl; 122 << tab(2) << "}" << endl
123 << tab(1) << "catch (...)" << endl
124 << tab(2) << "{" << endl
125 << tab(3) << "eina_error_set( efl::eina::unknown_error() );" << endl
126 << tab(2) << "}" << endl;
127
128 if (!function_is_void(func))
129 out << tab(1) << "return _tmp_ret;" << endl;
130
131 out << "}" << endl << endl;
116 } 132 }
117 return out; 133 return out;
118} 134}