summaryrefslogtreecommitdiff
path: root/src/bin/eolian_cxx
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-05-23 17:34:50 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-05-23 17:34:50 -0300
commit6e23780bb13fdc16a2034d01bf3fc06a2355fbee (patch)
tree1d1a308ff088503f7bb8b23b65e429f2e830e2dd /src/bin/eolian_cxx
parent8fd1656898c26f547bb76ef86da2827e447ecb3b (diff)
eolian-cxx: Fix generation of complex types in C++ binding
Fixed generation of complex types in C++ binding, with tests. This problem came after the removal of the pointer types for top-level complex types.
Diffstat (limited to 'src/bin/eolian_cxx')
-rw-r--r--src/bin/eolian_cxx/type_lookup.hh12
-rw-r--r--src/bin/eolian_cxx/type_lookup_table.cc5
2 files changed, 12 insertions, 5 deletions
diff --git a/src/bin/eolian_cxx/type_lookup.hh b/src/bin/eolian_cxx/type_lookup.hh
index 57d7c940b6..37e4ff7b33 100644
--- a/src/bin/eolian_cxx/type_lookup.hh
+++ b/src/bin/eolian_cxx/type_lookup.hh
@@ -124,15 +124,21 @@ type_lookup(const Eolian_Type* type,
124 std::vector<Eolian_Type const*> types; 124 std::vector<Eolian_Type const*> types;
125 types.push_back(type); 125 types.push_back(type);
126 126
127 if (::eolian_type_type_get(type) == EOLIAN_TYPE_POINTER && type_is_complex(*eolian_type_base_type_get(type))) 127 if (::eolian_type_type_get(type) == EOLIAN_TYPE_COMPLEX/* && type_is_complex(*eolian_type_base_type_get(type))*/)
128 { 128 {
129 efl::eina::iterator<Eolian_Type const> end; 129 efl::eina::iterator<Eolian_Type const> end;
130 efl::eina::iterator<Eolian_Type const> it 130 efl::eina::iterator<Eolian_Type const> it
131 (::eolian_type_subtypes_get(eolian_type_base_type_get(type))); 131 (::eolian_type_subtypes_get(type));
132 while(it != end) 132 while(it != end)
133 { 133 {
134 if(Eolian_Type const* t = &*it) 134 if(Eolian_Type const* t = &*it)
135 types.push_back(t), ++it; 135 {
136 types.push_back
137 ( ::eolian_type_type_get(t) == EOLIAN_TYPE_POINTER ? ::eolian_type_base_type_get(t) /* remove this base type get when pointers are removed */
138 : t
139 );
140 ++it;
141 }
136 } 142 }
137 } 143 }
138 144
diff --git a/src/bin/eolian_cxx/type_lookup_table.cc b/src/bin/eolian_cxx/type_lookup_table.cc
index 55a8e6968a..046b8b8744 100644
--- a/src/bin/eolian_cxx/type_lookup_table.cc
+++ b/src/bin/eolian_cxx/type_lookup_table.cc
@@ -4,8 +4,6 @@ namespace eolian_cxx {
4 4
5using efl::eolian::eolian_type; 5using efl::eolian::eolian_type;
6 6
7// Keep the table sorted!
8// This can help: cat type_lookup_table | LC_ALL=C sort
9const lookup_table_type 7const lookup_table_type
10type_lookup_table 8type_lookup_table
11{ 9{
@@ -22,6 +20,9 @@ type_lookup_table
22 {"Eina_List *", eolian_type::complex_, false, false, true, true, "::efl::eina::range_list", {"eina_list.hh"}}, 20 {"Eina_List *", eolian_type::complex_, false, false, true, true, "::efl::eina::range_list", {"eina_list.hh"}},
23 {"Eina_List *", eolian_type::complex_, false, true, true, true, "::efl::eina::list", {"eina_list.hh"}}, 21 {"Eina_List *", eolian_type::complex_, false, true, true, true, "::efl::eina::list", {"eina_list.hh"}},
24 {"const Eina_List *", eolian_type::complex_, true, false, true, true, "::efl::eina::crange_list", {"eina_list.hh"}}, 22 {"const Eina_List *", eolian_type::complex_, true, false, true, true, "::efl::eina::crange_list", {"eina_list.hh"}},
23 {"Eina_Array *", eolian_type::complex_, false, false, true, true, "::efl::eina::range_array", {"eina_array.hh"}},
24 {"Eina_Array *", eolian_type::complex_, false, true, true, true, "::efl::eina::array", {"eina_array.hh"}},
25 {"const Eina_Array *", eolian_type::complex_, true, false, true, true, "::efl::eina::crange_array", {"eina_array.hh"}},
25 {"Eio_Filter_Direct_Cb", eolian_type::callback_, {"Eio.h"}}, 26 {"Eio_Filter_Direct_Cb", eolian_type::callback_, {"Eio.h"}},
26 {"Eo *", eolian_type::simple_, false, true, true, false, "::efl::eo::concrete", {"eo_concrete.hh"}}, 27 {"Eo *", eolian_type::simple_, false, true, true, false, "::efl::eo::concrete", {"eo_concrete.hh"}},
27 {"Eo *", eolian_type::simple_, false, false, true, false, "::efl::eo::concrete", {"eo_concrete.hh"}}, 28 {"Eo *", eolian_type::simple_, false, false, true, false, "::efl::eo::concrete", {"eo_concrete.hh"}},