summaryrefslogtreecommitdiff
path: root/src/examples/eolian_cxx/eolian_cxx_simple_01_cxx_impl.cc
diff options
context:
space:
mode:
authorVitor Sousa <vitorsousasilva@gmail.com>2014-11-11 20:37:47 -0200
committerVitor Sousa <vitorsousasilva@gmail.com>2015-01-05 15:52:27 -0200
commit132abc353454a2653b5b2b40d6de5f1689323a37 (patch)
tree2184e0c8361e0da179cf72c1071d2e6be4af9af7 /src/examples/eolian_cxx/eolian_cxx_simple_01_cxx_impl.cc
parented8ce801cb56644c12b395797c3f9e22a508811f (diff)
eolian_cxx: Fix Eolian C++ generated wrapper inconsistencies
In convert.cc: Reading functions instead of implements to convert the Eolian_Class. It avoids creation of methods that do not belong to the class, in special it avoids calling the default constructor twice in the generated code. No longer generating one constructor in the C++ wrapper for each eolian class constructor, since the correct behavior demands that all constructor should be called. Now the wrappers have "constructor methods" that must be called when creating a new object. Updated test cases and examples to match the new interface. Some class constructors and some test cases have to be removed since they were based on the wrong assumption that constructors are mutually exclusive. Created new generators for forwarding parameters and for looping over the relevant parameters to the C++ wrapper executing a generic lambda. Added a TODO comment regarding the call of constructor methods of all base classes. Currently there is no base type with constructors, so this situation should be discussed more. Added a TODO comment regarding the way callback parameters are being processed.
Diffstat (limited to 'src/examples/eolian_cxx/eolian_cxx_simple_01_cxx_impl.cc')
-rw-r--r--src/examples/eolian_cxx/eolian_cxx_simple_01_cxx_impl.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/examples/eolian_cxx/eolian_cxx_simple_01_cxx_impl.cc b/src/examples/eolian_cxx/eolian_cxx_simple_01_cxx_impl.cc
index 0a35f931a6..11209783bc 100644
--- a/src/examples/eolian_cxx/eolian_cxx_simple_01_cxx_impl.cc
+++ b/src/examples/eolian_cxx/eolian_cxx_simple_01_cxx_impl.cc
@@ -18,11 +18,15 @@ main()
18 eina_log_domain_level_set("colourablesquare", EINA_LOG_LEVEL_DBG); 18 eina_log_domain_level_set("colourablesquare", EINA_LOG_LEVEL_DBG);
19 19
20 int r, g, b; 20 int r, g, b;
21 ::colourable obj1(0x123456); 21 ::colourable obj1(
22 obj1.colourable_rgb_24bits_constructor(0x123456)
23 );
22 obj1.colour_set(0xc0ffee); 24 obj1.colour_set(0xc0ffee);
23 obj1.composite_colour_get(&r, &g, &b); 25 obj1.composite_colour_get(&r, &g, &b);
24 26
25 ::colourablesquare obj2(0x123456); 27 ::colourablesquare obj2(
28 obj2.colourablesquare_size_constructor(0x123456)
29 );
26 obj2.composite_colour_set(r, g, b); 30 obj2.composite_colour_set(r, g, b);
27 obj2.size_set(11); 31 obj2.size_set(11);
28 assert(obj1.colour_get() == obj2.colour_get()); 32 assert(obj1.colour_get() == obj2.colour_get());