summaryrefslogtreecommitdiff
path: root/src/examples/eolian_cxx/colourablesquare_cxx.cc
diff options
context:
space:
mode:
authorSavio Sena <savio@expertisesolutions.com.br>2014-07-24 16:47:35 -0300
committerSavio Sena <savio@expertisesolutions.com.br>2014-07-24 19:52:23 -0300
commit3e43bb57d85ab172f0d68e42f4c94f616ebf1d3f (patch)
treeefd31e885ac5c71d1cd6015ae2ccaadbcc343411 /src/examples/eolian_cxx/colourablesquare_cxx.cc
parentfb82d67ab13b12534468a39ac29eb31d0d04cee5 (diff)
eolian-cxx: Added example of Eo implementation in C++.
Instead of implementing Eo functions in C we do it in C++ simply.
Diffstat (limited to 'src/examples/eolian_cxx/colourablesquare_cxx.cc')
-rw-r--r--src/examples/eolian_cxx/colourablesquare_cxx.cc49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/examples/eolian_cxx/colourablesquare_cxx.cc b/src/examples/eolian_cxx/colourablesquare_cxx.cc
new file mode 100644
index 0000000000..b98df67d4b
--- /dev/null
+++ b/src/examples/eolian_cxx/colourablesquare_cxx.cc
@@ -0,0 +1,49 @@
1
2#include <iostream>
3#include <iomanip>
4
5#ifdef HAVE_CONFIG_H
6# include <config.h>
7#endif
8
9#include "Eo.hh"
10#include "Eina.hh"
11
12extern "C"
13{
14#include "colourablesquare_stub.h"
15#include "colourable.eo.h"
16#include "colourablesquare.eo.h"
17}
18
19#define MY_CLASS COLOURABLESQUARE_CLASS
20
21static efl::eina::log_domain domain("colourablesquare");
22
23void
24_colourablesquare_size_constructor(Eo *obj, ColourableSquare_Data *self, int size)
25{
26 self->size = size;
27 EINA_CXX_DOM_LOG_DBG(domain) << __func__ << " [ size = " << size << " ]" << std::endl;
28 eo_do_super(obj, MY_CLASS, eo_constructor());
29}
30
31int
32_colourablesquare_size_get(Eo *obj EINA_UNUSED, ColourableSquare_Data *self)
33{
34 EINA_CXX_DOM_LOG_DBG(domain) << __func__ << " [ size = " << self->size << " ]" << std::endl;
35 return self->size;
36}
37
38void
39_colourablesquare_size_print(Eo *obj EINA_UNUSED, ColourableSquare_Data *self)
40{
41 EINA_CXX_DOM_LOG_DBG(domain) << __func__ << " [ size = " << self->size << " ]" << std::endl;
42}
43
44void
45_colourablesquare_size_set(Eo *obj EINA_UNUSED, ColourableSquare_Data *self EINA_UNUSED, int size)
46{
47 EINA_CXX_DOM_LOG_DBG(domain) << __func__ << " [ size = " << self->size << " ]" << std::endl;
48}
49