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
|
|
|
|
|
2015-01-09 08:20:14 -08:00
|
|
|
### Generated headers
|
|
|
|
|
|
|
|
generated_eldbus_cxx_bindings = $(eldbus_eolian_files:%.eo=%.eo.hh)
|
|
|
|
generated_eldbus_cxx_impl_bindings = $(eldbus_eolian_files:%.eo=%.eo.impl.hh)
|
|
|
|
|
|
|
|
lib/eldbus/Eldbus_Model.hh: $(generated_eldbus_cxx_bindings)
|
|
|
|
@echo @ECHO_E@ "#ifndef EFL_CXX_ELDBUS_MODEL_HH\n#define EFL_CXX_ELDBUS_MODEL_HH\n" > $(top_builddir)/src/lib/eldbus/Eldbus_Model.hh
|
|
|
|
@echo @ECHO_E@ "#include <Eldbus_Model.h>" >> $(top_builddir)/src/lib/eldbus/Eldbus_Model.hh
|
|
|
|
@echo @ECHO_E@ "#ifdef EFL_BETA_API_SUPPORT" >> $(top_builddir)/src/lib/eldbus/Eldbus_Model.hh
|
|
|
|
@for i in $(generated_eldbus_cxx_bindings); do echo "#include <$$(basename $$i)>" >> $(top_builddir)/src/lib/eldbus/Eldbus_Model.hh; done
|
|
|
|
@echo @ECHO_E@ "#endif\n\n#endif\n" >> $(top_builddir)/src/lib/eldbus/Eldbus_Model.hh
|
|
|
|
|
|
|
|
generated_eldbus_cxx_all = \
|
|
|
|
$(generated_eldbus_cxx_bindings) \
|
|
|
|
$(generated_eldbus_cxx_impl_bindings) \
|
|
|
|
lib/eldbus/Eldbus_Model.hh
|
|
|
|
|
|
|
|
CLEANFILES += $(generated_eldbus_cxx_all)
|
|
|
|
|
|
|
|
nodist_installed_eldbuscxxmainheaders_DATA = $(generated_eldbus_cxx_all)
|
|
|
|
|
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 \
|
2016-02-04 05:55:35 -08:00
|
|
|
tests/eldbus_cxx/eldbus_cxx_test_eldbus_client.cc \
|
|
|
|
tests/eldbus_cxx/eldbus_cxx_suite.h
|
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_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
|