efl/src/lib/eldbus
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
..
Eldbus.h alpha1 release autofoo/build tree work to pass distcheck and actually work 2013-11-04 18:33:35 +09:00
eldbus_connection.h Eldbus: added function for getting bus unique name 2013-12-02 14:57:07 +09:00
eldbus_core.c efl: Unified eina critical manro to CRI. 2013-12-26 12:27:13 +09:00
eldbus_freedesktop.c eldbus: Add eldbus_object_manager_interfaces_added/removed() 2013-09-02 16:14:47 -03:00
eldbus_freedesktop.h eldbus: Add eldbus_object_manager_interfaces_added/removed() 2013-09-02 16:14:47 -03:00
eldbus_message.c eldbus: error message iters should be initted as readonly. 2013-06-22 20:15:44 +09:00
eldbus_message.h eldbus: Add EINA_ARG_NONNULL to new API function 2013-05-04 10:38:55 -03:00
eldbus_message_eina_value.h Rename edbus->eldbus 2013-04-23 12:36:29 -03:00
eldbus_message_from_eina_value.c eldbus: Check return value of eina_value_pget 2013-12-07 21:11:33 +01:00
eldbus_message_helper.c Rename edbus->eldbus 2013-04-23 12:36:29 -03:00
eldbus_message_helper.h Rename edbus->eldbus 2013-04-23 12:36:29 -03:00
eldbus_message_to_eina_value.c eldbus: Check return value of _type_size 2013-12-07 21:11:32 +01:00
eldbus_object.c efl: Unified eina critical manro to CRI. 2013-12-26 12:27:13 +09:00
eldbus_object.h Rename edbus->eldbus 2013-04-23 12:36:29 -03:00
eldbus_pending.c eldbus: Add timeout message error as a macro 2013-09-02 16:14:47 -03:00
eldbus_pending.h Rename edbus->eldbus 2013-04-23 12:36:29 -03:00
eldbus_private.h efl: Unified eina critical manro to CRI. 2013-12-26 12:27:13 +09:00
eldbus_private_types.h Registers a fallback handler for a given subsection of the object hierarchy. 2014-01-23 15:45:22 +09:00
eldbus_proxy.c efl: Unified eina critical manro to CRI. 2013-12-26 12:27:13 +09:00
eldbus_proxy.h eldbus: Add a new proxy event to notify when properties are cached 2013-09-02 16:14:43 -03:00
eldbus_service.c eldbus-cxx: Implementation of eldbus C++ API 2014-07-03 16:28:23 +09:00
eldbus_service.h eldbus-cxx: Implementation of eldbus C++ API 2014-07-03 16:28:23 +09:00
eldbus_signal_handler.c Rename edbus->eldbus 2013-04-23 12:36:29 -03:00
eldbus_signal_handler.h Rename edbus->eldbus 2013-04-23 12:36:29 -03:00