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 00:28:22 -07:00
|
|
|
|
2014-07-29 18:21:18 -07:00
|
|
|
if HAVE_CXX11
|
|
|
|
|
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 00:28:22 -07:00
|
|
|
### Library
|
|
|
|
|
|
|
|
installed_eldbuscxxmainheadersdir = $(includedir)/eldbus_cxx-@VMAJ@
|
|
|
|
dist_installed_eldbuscxxmainheaders_DATA = \
|
|
|
|
bindings/eldbus_cxx/eldbus_basic.hh \
|
|
|
|
bindings/eldbus_cxx/eldbus_error.hh \
|
|
|
|
bindings/eldbus_cxx/eldbus_freedesktop.hh \
|
|
|
|
bindings/eldbus_cxx/Eldbus.hh \
|
|
|
|
bindings/eldbus_cxx/eldbus_integer_sequence.hh \
|
|
|
|
bindings/eldbus_cxx/eldbus_message_arguments.hh \
|
|
|
|
bindings/eldbus_cxx/eldbus_message.hh \
|
|
|
|
bindings/eldbus_cxx/eldbus_proxy_call.hh \
|
|
|
|
bindings/eldbus_cxx/eldbus_raw_tuple.hh \
|
|
|
|
bindings/eldbus_cxx/eldbus_service.hh \
|
|
|
|
bindings/eldbus_cxx/eldbus_signature_traits.hh
|
|
|
|
|
|
|
|
### Unit tests
|
|
|
|
|
|
|
|
if EFL_ENABLE_TESTS
|
|
|
|
|
|
|
|
check_PROGRAMS += tests/eldbus_cxx/eldbus_cxx_suite
|
|
|
|
TESTS += tests/eldbus_cxx/eldbus_cxx_suite
|
|
|
|
|
|
|
|
tests_eldbus_cxx_eldbus_cxx_suite_SOURCES = \
|
|
|
|
tests/eldbus_cxx/eldbus_cxx_suite.cc \
|
|
|
|
tests/eldbus_cxx/eldbus_cxx_test_eldbus_connect.cc \
|
|
|
|
tests/eldbus_cxx/eldbus_cxx_test_eldbus_client.cc
|
|
|
|
|
|
|
|
tests_eldbus_cxx_eldbus_cxx_suite_CPPFLAGS = \
|
|
|
|
-I$(top_builddir)/src/bindings/eina_cxx \
|
|
|
|
-I$(top_srcdir)/src/bindings/eina_cxx \
|
|
|
|
-I$(top_builddir)/src/bindings/ecore_cxx \
|
|
|
|
-I$(top_srcdir)/src/bindings/ecore_cxx \
|
|
|
|
-I$(top_builddir)/src/bindings/eldbus_cxx \
|
|
|
|
-I$(top_srcdir)/src/bindings/eldbus_cxx \
|
|
|
|
-I$(top_builddir)/src/lib/efl \
|
2015-04-13 11:31:59 -07:00
|
|
|
-I$(top_builddir)/src/lib/efl/interfaces \
|
|
|
|
-I$(top_builddir)/src/lib/ecore \
|
2014-07-17 10:07:09 -07:00
|
|
|
-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/eldbus\" \
|
|
|
|
@CHECK_CFLAGS@ @ECORE_CXX_CFLAGS@ @EINA_CXX_CFLAGS@ @EINA_CFLAGS@ \
|
|
|
|
@ECORE_CFLAGS@ @EO_CFLAGS@ @EO_CXX_CFLAGS@ @ELDBUS_CFLAGS@
|
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 00:28:22 -07:00
|
|
|
|
|
|
|
tests_eldbus_cxx_eldbus_cxx_suite_LDADD = @CHECK_LIBS@ @USE_ELDBUS_LIBS@
|
|
|
|
tests_eldbus_cxx_eldbus_cxx_suite_DEPENDENCIES = @USE_ELDBUS_INTERNAL_LIBS@
|
|
|
|
|
|
|
|
endif
|
2014-07-29 18:21:18 -07:00
|
|
|
|
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 00:28:22 -07:00
|
|
|
endif
|