summaryrefslogtreecommitdiff
path: root/src/bin/eolian_cxx
diff options
context:
space:
mode:
authorSavio Sena <savio.sena@acm.org>2014-07-17 04:14:22 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2014-07-18 18:57:13 -0300
commite807421f602c1adab47c3fcadbc508155d0d1136 (patch)
tree13311b651e483446d5886849ff4bd813131f8237 /src/bin/eolian_cxx
parentf60394c1af82daf8f38918a678081168940df340 (diff)
eolian-cxx: Fixed complex-types.
Diffstat (limited to 'src/bin/eolian_cxx')
-rw-r--r--src/bin/eolian_cxx/type_lookup.hh33
-rw-r--r--src/bin/eolian_cxx/type_lookup_table.cc2
2 files changed, 29 insertions, 6 deletions
diff --git a/src/bin/eolian_cxx/type_lookup.hh b/src/bin/eolian_cxx/type_lookup.hh
index 8465ef960d..b26fff91c6 100644
--- a/src/bin/eolian_cxx/type_lookup.hh
+++ b/src/bin/eolian_cxx/type_lookup.hh
@@ -51,13 +51,36 @@ type_lookup(const Eolian_Type* type,
51 lookup_table_type const& lut = type_lookup_table) 51 lookup_table_type const& lut = type_lookup_table)
52{ 52{
53 if (type == NULL) return { efl::eolian::void_type }; // XXX shouldn't 53 if (type == NULL) return { efl::eolian::void_type }; // XXX shouldn't
54 size_t n = ::eina_list_count(type->subtypes) + 1; 54
55 assert(n > 0); 55 Eina_List const* lt = NULL;
56 efl::eolian::eolian_type_instance v(n); 56 Eina_Iterator *it = NULL;
57 for (size_t i=0; i<n; i++) 57 unsigned int n_;
58 if ( (it = ::eolian_type_subtypes_list_get(type)) != NULL)
59 {
60 lt = static_cast<Eina_List const*>(::eina_iterator_container_get(it));
61 n_ = ::eina_list_count(lt) + 1;
62 ::eina_iterator_free(it);
63 }
64 else
65 {
66 n_ = 1;
67 }
68 // assert(n_ > 0);
69 efl::eolian::eolian_type_instance v(n_);
70 for (size_t i=0; i<n_; i++)
58 { 71 {
59 v[i] = type_find(lut.begin(), lut.end(), type_from_eolian(*type)); 72 v[i] = type_find(lut.begin(), lut.end(), type_from_eolian(*type));
60 assert (i == n-1 || type_is_complex(v[i])); 73 // XXX temporary workaround to allow incomplete complex-types until
74 // we don't have a full support.
75 if (type_is_complex(v[i]))
76 {
77 assert(i == 0);
78 efl::eolian::eolian_type tmp = v[i];
79 v.clear();
80 v.push_back(efl::eolian::type_to_native(tmp));
81 return v;
82 }
83 assert(i == n_-1 || type_is_complex(v[i]));
61 } 84 }
62 return v; 85 return v;
63} 86}
diff --git a/src/bin/eolian_cxx/type_lookup_table.cc b/src/bin/eolian_cxx/type_lookup_table.cc
index 072ef22748..19c84f49e8 100644
--- a/src/bin/eolian_cxx/type_lookup_table.cc
+++ b/src/bin/eolian_cxx/type_lookup_table.cc
@@ -21,7 +21,7 @@ type_lookup_table
21 {"Eina_List *", eolian_type::complex_, true, "efl::eina::ptr_list", {"eina-cxx/eina_ptrlist.hh"}}, 21 {"Eina_List *", eolian_type::complex_, true, "efl::eina::ptr_list", {"eina-cxx/eina_ptrlist.hh"}},
22 //{"Eina_List *", eolian_type::complex_, false, "efl::eina::ptr_list", {"eina-cxx/eina_ptrlist.hh"}}, 22 //{"Eina_List *", eolian_type::complex_, false, "efl::eina::ptr_list", {"eina-cxx/eina_ptrlist.hh"}},
23 {"Eo *", eolian_type::simple_, true, "efl::eo::base", {"eo_base.hh"}}, 23 {"Eo *", eolian_type::simple_, true, "efl::eo::base", {"eo_base.hh"}},
24 {"Evas_Object *", eolian_type::simple_, false, "evas_object", {"canvas/evas_object.eo.hh"}}, 24 //{"Evas_Object *", eolian_type::simple_, false, "evas::object", {"canvas/evas_object.eo.hh"}},
25 {"char *", eolian_type::simple_, true, "std::unique_ptr<char*>", {"memory"}}, 25 {"char *", eolian_type::simple_, true, "std::unique_ptr<char*>", {"memory"}},
26 {"const Eina_Inlist *", eolian_type::complex_, false, "efl::eina::range_inlist", {"eina-cxx/eina_inlist.hh"}}, 26 {"const Eina_Inlist *", eolian_type::complex_, false, "efl::eina::range_inlist", {"eina-cxx/eina_inlist.hh"}},
27 {"const Eina_List *", eolian_type::complex_, false, "efl::eina::range_ptr_list", {"eina-cxx/eina_ptrlist.hh"}}, 27 {"const Eina_List *", eolian_type::complex_, false, "efl::eina::range_ptr_list", {"eina-cxx/eina_ptrlist.hh"}},