summaryrefslogtreecommitdiff
path: root/src/bin/eolian_cxx
diff options
context:
space:
mode:
authorVitor Sousa <vitorsousasilva@gmail.com>2014-12-30 21:18:40 -0200
committerVitor Sousa <vitorsousasilva@gmail.com>2015-01-05 15:52:27 -0200
commit4222cd3f50042452893bc24e85376f3c1b4ce748 (patch)
tree978fa3e6605e1c03bb33fcc21d1ad9e042a7e6bc /src/bin/eolian_cxx
parent2b12114777cc9e0b7db3894f37dd71f6b5b073b4 (diff)
eolian_cxx: Fix compilation of inheritance from Eolian generated classes
Updated the code for the "inheritance helper" functions and classes to be in conformance with the new wrapper architecture. Member variable "parents" of efl::eo::eo_class struct was split in two member variables, "ancestors" and "parents", the former containing all Eo class ancestors and the later only the direct bases. Changed all required files accordingly. Check to avoid using biding string when the parameter is @out now matches any variation of "char". Add default constructor to efl::eo::concrete in order to allow it to be NULL initialized in the "inheritance helper" classes. Removed conflicting parent_set member function in the efl::eo::inherit class. Removed the "inheritance_extension_function" generator since it is no longer used.
Diffstat (limited to 'src/bin/eolian_cxx')
-rw-r--r--src/bin/eolian_cxx/convert.cc14
-rw-r--r--src/bin/eolian_cxx/eolian_wrappers.hh2
2 files changed, 9 insertions, 7 deletions
diff --git a/src/bin/eolian_cxx/convert.cc b/src/bin/eolian_cxx/convert.cc
index 2fa45b569b..fab4c1608c 100644
--- a/src/bin/eolian_cxx/convert.cc
+++ b/src/bin/eolian_cxx/convert.cc
@@ -24,7 +24,7 @@ namespace eolian_cxx {
24extern efl::eina::log_domain domain; 24extern efl::eina::log_domain domain;
25 25
26void 26void
27add_parent_recursive(const char* klass_name, std::set<std::string>& parents) 27add_ancestor_recursive(const char* klass_name, std::set<std::string>& ancestor)
28{ 28{
29 if (!klass_name) 29 if (!klass_name)
30 return; 30 return;
@@ -36,14 +36,14 @@ add_parent_recursive(const char* klass_name, std::set<std::string>& parents)
36 return; 36 return;
37 } 37 }
38 38
39 parents.insert(class_format_cxx(safe_lower(klass_name))); 39 ancestor.insert(class_format_cxx(safe_lower(klass_name)));
40 40
41 Eina_Iterator* inheritances = ::eolian_class_inherits_get(klass); 41 Eina_Iterator* inheritances = ::eolian_class_inherits_get(klass);
42 void* curr = 0; 42 void* curr = 0;
43 43
44 EINA_ITERATOR_FOREACH(inheritances, curr) 44 EINA_ITERATOR_FOREACH(inheritances, curr)
45 { 45 {
46 add_parent_recursive(static_cast<const char*>(curr), parents); 46 add_ancestor_recursive(static_cast<const char*>(curr), ancestor);
47 } 47 }
48 eina_iterator_free(inheritances); 48 eina_iterator_free(inheritances);
49} 49}
@@ -182,15 +182,17 @@ convert_eolian_inheritances(efl::eolian::eo_class& cls, Eolian_Class const& klas
182 ::eolian_class_inherits_get(&klass); 182 ::eolian_class_inherits_get(&klass);
183 void *curr; 183 void *curr;
184 184
185 std::set<std::string> parents; 185 std::set<std::string> ancestors;
186 186
187 EINA_ITERATOR_FOREACH(inheritances, curr) 187 EINA_ITERATOR_FOREACH(inheritances, curr)
188 { 188 {
189 add_parent_recursive(static_cast<const char*>(curr), parents); 189 const char* klass_name = static_cast<const char*>(curr);
190 cls.parents.push_back(class_format_cxx(safe_lower(klass_name)));
191 add_ancestor_recursive(klass_name, ancestors);
190 } 192 }
191 eina_iterator_free(inheritances); 193 eina_iterator_free(inheritances);
192 194
193 cls.parents.assign(parents.begin(), parents.end()); 195 cls.ancestors.assign(ancestors.begin(), ancestors.end());
194} 196}
195 197
196void 198void
diff --git a/src/bin/eolian_cxx/eolian_wrappers.hh b/src/bin/eolian_cxx/eolian_wrappers.hh
index 6b0211e798..477173959b 100644
--- a/src/bin/eolian_cxx/eolian_wrappers.hh
+++ b/src/bin/eolian_cxx/eolian_wrappers.hh
@@ -348,7 +348,7 @@ parameter_type(Eolian_Function_Parameter const& parameter,
348 assert(!type.empty()); 348 assert(!type.empty());
349 if (parameter_is_out(parameter)) 349 if (parameter_is_out(parameter))
350 { 350 {
351 if (type.front().native == "char *") 351 if (type.front().native.find("char") != std::string::npos)
352 type = { efl::eolian::type_to_native(type) }; 352 type = { efl::eolian::type_to_native(type) };
353 type.is_out = true; 353 type.is_out = true;
354 type.front().native += "*"; 354 type.front().native += "*";