Commit Graph

6 Commits

Author SHA1 Message Date
Felipe Magno de Almeida 30df128be5 eldbus-cxx: Implementation of eldbus C++ API
Summary:
Applications can:

  void method_callback(void* data, const Eldbus_Service_Interface* iface,
                       const Eldbus_Message* message);
  struct { ... } data_struct;

  Eldbus_Method methods[] =
   {
     "method1", ELDBUS_ARGS("b", "bool"), ELDBUS_ARGS("b", "bool"), ELDBUS_METHOD_FLAG_HAS_DATA
     , (Eldbus_Method_Cb)&method_callback, &data_struct
   };

   And method_callback will be called with data parameter pointing to data_struct global object.

Also, Eldbus-cxx supports registering an interface passing a lambda or
function object as method. For example:

  edb::service_interface iface = edb::service_interface_register
    (c, path, interface
     , es::method("SendStringAndBool"
                  , [expected_string, expected_bool] (std::string const& n, bool b
                                                      , bool* out)
                  {
                    std::cout << "Running SendStringAndBool" << std::endl;
                    ck_assert(n == expected_string);
                    ck_assert(b == expected_bool);
                    *out = b;
                    return n;
                  }
                  , es::ins<std::string, bool>("string", "bool")
                  , es::outs<std::string, bool>("string", "bool")
                  )
    );

When a request for "SendStringAndBool" with the proper signature is
called, executes the lambda and replies with the return value and
its bool* out parameter value.

Reviewers: cedric, woohyun, raster

CC: savio, cedric

Differential Revision: https://phab.enlightenment.org/D1052
2014-07-03 16:28:23 +09:00
Savio Sena 073b666022 autotools: Fixed 'make examples' and 'make examples-install'
It was broken in set-ups with ($(builddir) != $(srcdir)) && ($(builddir) !=
$(srcdir)/build)
2014-07-02 20:01:09 -03:00
Guillaume Friloux 9bee17a0aa Dont install c++ headers of bindings when --disable-c++11 is used. 2014-06-02 15:54:06 +02:00
Felipe Magno de Almeida 8149823897 eolian-cxx: fix make distcheck and automake files for Eolian C++
Summary:
Fixed distcheck for Eolian C++. Made the generated files as
nodist so it doesn't get picked up for generation way too
early.

Reviewers: cedric, seoz

CC: cedric

Maniphest Tasks: T1220

Differential Revision: https://phab.enlightenment.org/D820

Signed-off-by: Cedric Bail <cedric.bail@free.fr>
2014-05-04 12:21:30 +02:00
Savio Sena 46b6e8a563 eolian_cxx: initial version of the EFL C++ Bindings Generator.
Summary:
This patch adds 'eolian_cxx' -- a C++ bindings generator --
to the EFL tree. Eolian Cxx uses Eolian API to read .eo files and generate
.eo.hh. It relies/depends on Eo Cxx and Eina Cxx (both non-generated
bindings).

src/bin/eolian_cxx: The eolian_cxx program.
src/lib/eolian_cxx: A header-only library that implements the C++ code
generation that binds the .eo classes.

=Examples=

src/examples/eolian_cxx/eolian_cxx_simple_01.cc: The simplest example,
it just uses some "dummy" generated C++ classes.

src/examples/eolian_cxx/eolian_cxx_inherit_01.cc: Illustrates how
pure C++ classes inherit from .eo generated classes.

src/examples/evas/evas_cxx_rectangle.cc: More realistic example using
the generated bindings Evas Cxx. Still a bit shallow because we don't
have full fledged .eo descriptions yet, but will be improved.

=Important=

The generated code is not supported and not a stable API/ABI. It is
here to gather people interest and get review before we set things in
stone for release 1.11.

@feature

Reviewers: cedric, smohanty, raster, stefan_schmidt

CC: felipealmeida, JackDanielZ, cedric, stefan

Differential Revision: https://phab.enlightenment.org/D805

Signed-off-by: Cedric Bail <cedric.bail@free.fr>
2014-05-03 00:56:32 +02:00
Felipe Magno de Almeida ab3eb4b2d3 eet-cxx: add implementation for eet C++.
Usage example:

  struct type
  {
    int foo;
    float bar;
  };

  type t0;

  auto descriptor = make_descriptor("type", &type::ofo, &type::bar);

  eet_data_write(file, descriptor.native_handle(), "type", &t0, false);

  std::unique_ptr<type> p = read_by_ptr(file, "type", descriptor);
  type t = read(file, "type", descriptor);

@feature

Reviewers: cedric, smohanty

Reviewed By: cedric

CC: savio, cedric

Differential Revision: https://phab.enlightenment.org/D659

Signed-off-by: Cedric BAIL <cedric.bail@free.fr>
2014-04-01 22:00:13 +09:00