felipealmeida pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=c1e8918b88dd2b069b62c8b2798df72a2c8c0a29

commit c1e8918b88dd2b069b62c8b2798df72a2c8c0a29
Author: Felipe Magno de Almeida <[email protected]>
Date:   Fri Jul 18 17:57:04 2014 -0300

    eolian-cxx: Fixed inheritance feature with callbacks
    
    The addition of callbacks was making the inheritance to fail. Fixed
    generation by using the C types, instead of the abstracted callback
    types for the wrapper functions.
---
 .../eolian_cxx/grammar/inheritance_base_generator.hh | 16 +++++++---------
 src/lib/eolian_cxx/grammar/parameters_generator.hh   | 20 +++++++++++++++++---
 2 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/src/lib/eolian_cxx/grammar/inheritance_base_generator.hh 
b/src/lib/eolian_cxx/grammar/inheritance_base_generator.hh
index 8fe6e09..c7aaa8d 100644
--- a/src/lib/eolian_cxx/grammar/inheritance_base_generator.hh
+++ b/src/lib/eolian_cxx/grammar/inheritance_base_generator.hh
@@ -188,7 +188,7 @@ operator<<(std::ostream& out, 
inheritance_base_operations_function const& x)
 
    out << tab(2) << "virtual " << reinterpret_type(func.ret) << " "
        << func.name << "("
-       << parameters_declaration(func.params) << ")" << endl
+       << parameters_c_declaration(func.params) << ")" << endl
        << tab(2) << "{" << endl;
    if (!is_void)
      {
@@ -196,9 +196,12 @@ operator<<(std::ostream& out, 
inheritance_base_operations_function const& x)
      }
    out << tab(3)
        << "eo_do_super(static_cast<T*>(this)->_eo_ptr()" << endl
-       << tab(4) << ", static_cast<T*>(this)->_eo_class()" << endl
-       << tab(4) << ", " << function_call(func)
-       << ");" << endl;
+       << tab(4) << ", static_cast<T*>(this)->_eo_class()," << endl
+       << tab(4) << (!is_void ? "_tmp_ret = " : "")
+       << "::" << x._func.impl
+       << "(";
+   parameter_names_enumerate(out, func.params)
+       << "));" << endl;
    if (!is_void)
      {
         out << tab(3) << "return _tmp_ret;" << endl;
@@ -399,17 +402,12 @@ operator<<(std::ostream& out, inheritance_eo_class_getter 
const& x)
 inline void
 eo_inheritance_detail_generator(std::ostream& out, eo_class const& cls)
 {
-#if 0 // Will be fixed ASAP
    out << inheritance_wrappers(cls)
-#endif
-   out
        << "namespace efl { namespace eo { namespace detail {" << endl << endl
-#if 0 // Will be fixed ASAP
        << inheritance_base_operations(cls) << endl
        << inheritance_base_operations_size(cls)
        << inheritance_operations_description(cls)
        << inheritance_call_constructors(cls)
-#endif
        << inheritance_extension(cls)
        << inheritance_eo_class_getter(cls)
        <<  "} } }" << endl;
diff --git a/src/lib/eolian_cxx/grammar/parameters_generator.hh 
b/src/lib/eolian_cxx/grammar/parameters_generator.hh
index a94eda6..053cef6 100644
--- a/src/lib/eolian_cxx/grammar/parameters_generator.hh
+++ b/src/lib/eolian_cxx/grammar/parameters_generator.hh
@@ -86,6 +86,21 @@ operator<<(std::ostream& out, parameters_types const& x)
    return out;
 }
 
+inline
+std::ostream& parameter_names_enumerate(std::ostream& out
+                                        , parameters_container_type const& 
params)
+{
+   for (auto first = params.begin()
+          , iterator = first
+          , last = params.end()
+          ; iterator != last; ++iterator)
+     {
+        if(iterator != first) out << ", ";
+        out << iterator->name;
+     }
+   return out;
+}
+
 struct
 parameters_list
 {
@@ -160,10 +175,9 @@ operator<<(std::ostream& out, parameters_cxx_list const& x)
      {
         if (it != first)
           out << ", ";
-        if (type_is_callback((*it).type))
+        if (type_is_callback((*it).type) && it + 1 != last)
           {
-             out << "std::move(" << (*it).name << ")";
-             assert(it+1 != last);
+             out << "std::forward<F>(" << (*it).name << ")";
              ++it; // skip next.
           }
         else

-- 


Reply via email to