This flag allows one to compile Eina++ replacing C++ exceptions with a
call to abort().
Please use EFL_CXX_THROW() macro instead of C++ throw() from now on.
Added empty wrapper constructor to generation from std::nullptr_t and
allowed efl::eo::base to be empty with proper copy-constructors and
assignment operators.
Summary:
This fixes the breakage when Eldbus_Service_Interface_Desc added a
wrongfully methods2 field to a class that is allocated by the user.
This patch adds the respective eldbus_service_interface_register2 and
eldbus_service_interface_fallback_register2 for registration of
Eldbus_Service_Interface_Desc2 which is now versioned. So future the
functions can be backwards compatible and the struct be forward
compatible and leaves the Eldbus_Service_Interface_Desc and
eldbus_service_interface_register and
eldbus_service_interface_fallback_register intact as it was in EFL
1.10.
This fixes T1408
Reviewers: cedric, stefan_schmidt, raster
Reviewed By: raster
Subscribers: cedric
Maniphest Tasks: T1408
Differential Revision: https://phab.enlightenment.org/D1188
Summary:
Removed the void* data variable from Eldbus_Method and created another
struct that has the void* data and added an array of Eldbus_Method2 in
the descriptor for the Eldbus_Service_Interface_Desc and making the
appropriate modifications in the implementation to use both
descriptions.
Reviewers: cedric, stefan_schmidt, raster
CC: cedric
Maniphest Tasks: T1408
Differential Revision: https://phab.enlightenment.org/D1139
Summary:
Removes Wshadow warnings by prepending/appending radices to
the target variables and parameters.
Reviewers: felipealmeida
CC: cedric
Differential Revision: https://phab.enlightenment.org/D1118
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
Summary:
This patch allows us to construct efl::eina:: types from
their respective C types.
Reviewers: cedric, felipealmeida, q66
Reviewed By: q66
CC: smohanty, woohyun, raster, cedric
Differential Revision: https://phab.enlightenment.org/D1068
Summary:
Fixed compilation error on clang when std::vector<char>::iterator and
std::string::iterator are the same type in type_traits for contiguous
traits optimization.
@fix
Reviewers: MagikBSD, tasn, cedric, raster, savio, woohyun
Reviewed By: tasn
CC: cedric
Maniphest Tasks: T1328
Differential Revision: https://phab.enlightenment.org/D1004
Signed-off-by: Cedric BAIL <c.bail@partner.samsung.com>
Summary:
Added documentation to almost all classes that are intended for direct use by the library users.
Marked classes/functions used by the library itself as @internal.
Modified the Doxyfile.in to enable the generation of documentation to the bindings.
Reviewers: felipealmeida, cedric, woohyun, smohanty, raster
CC: savio, cedric
Differential Revision: https://phab.enlightenment.org/D947
Signed-off-by: Cedric BAIL <c.bail@partner.samsung.com>
Summary:
Replaced the "safe bool idiom" by explicit conversion to bollean,
in order to follow the improved conventions of the C++11.
Reviewers: felipealmeida, cedric, woohyun, smohanty, raster
Reviewed By: raster
CC: savio, cedric
Differential Revision: https://phab.enlightenment.org/D903
Summary: The previous definition of EINA_CXX_DOM_LOG could cause a problem if used inside an one-line "if" statement followed by an "else". Changed the top "if" by a "for" statement to avoid this problem.
Reviewers: felipealmeida, cedric, woohyun, smohanty, raster
Reviewed By: raster
CC: savio, cedric
Differential Revision: https://phab.enlightenment.org/D902
Summary:
Fixed the rbegin/rend functions returning switched reverse iterators.
Added code to some unit tests for comparing elements in reverse order, in interest of
checking the correctness of the rbegin/rend functions.
Reviewers: felipealmeida, cedric, woohyun, smohanty, raster
Reviewed By: felipealmeida
CC: savio, cedric
Differential Revision: https://phab.enlightenment.org/D901
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>
Summary:
Modified syntax for eina C++ log to imitate the macro call as returning a stream. So, instead of:
EINA_CXX_DOM_LOG_CRIT(efl::eina::global_domain, "foo " << 5);
It is now used as:
EINA_CXX_DOM_LOG_CRIT(efl::eina::global_domain) << "foo " << 5;
Which more closely resambles using IOStreams in C++.
@feature
Reviewers: cedric, barbieri, smohanty
Reviewed By: barbieri
CC: cedric
Differential Revision: https://phab.enlightenment.org/D623
Summary: Renamed a few local variables to avoid excessive warnings with -Wshadow warning. Also made construction of a few objects pass all arguments for explicit initialization to avoid other harmless warning.
Reviewers: cedric, tasn, smohanty, raster
Reviewed By: raster
CC: cedric
Differential Revision: https://phab.enlightenment.org/D698
Summary: @fix compilation errors with defining variable and type on the same statement on clang without a default-constructor. Also removed warnings with inconsistent uses of struct/class for forward declaration and unused parameters.
Reviewers: cedric, stefan_schmidt
CC: savio, cedric
Differential Revision: https://phab.enlightenment.org/D622
Summary:
Added efl::eina::malloc_clone_allocator to be used with ptr_* data
structures for wrapping structures allocated by EFL in C.
This allows for example:
void foo(Eina_List* l)
{
efl::eina::ptr_list<int, efl::eina::malloc_clone_allocator> list(l);
}
If the standard efl::eina::heap_no_clone_allocator is used, the
deallocation code uses C++ delete operator, which causes undefined
behavior because the allocation was originally done with malloc.
Reviewers: cedric
CC: savio, cedric
Differential Revision: https://phab.enlightenment.org/D614
Summary:
Added eina_log support for C++ using the following macros:
For logging into a domain:
EINA_CXX_DOM_LOG
EINA_CXX_DOM_LOG_CRIT
EINA_CXX_DOM_LOG_ERR
EINA_CXX_DOM_LOG_INFO
EINA_CXX_DOM_LOG_DBG
EINA_CXX_DOM_LOG_WARN
And for logging into the default domain:
EINA_CXX_LOG
EINA_CXX_LOG_CRIT
EINA_CXX_LOG_ERR
EINA_CXX_LOG_INFO
EINA_CXX_LOG_DBG
EINA_CXX_LOG_WARN
The usage is simple as can be seen in the tests:
efl::eina::log_domain domain("error_domain_name");
domain.set_level(efl::eina::log_level::critical);
EINA_CXX_DOM_LOG_CRIT(domain, "something went wrong with the following error: " << error);
@feature
Reviewers: cedric
CC: raster, savio, cedric, sanjeev
Differential Revision: https://phab.enlightenment.org/D605
Summary:
Added inarray, inlist, ptr_array and ptr_list's range types named: range_inarray, range_inlist, range_ptr_array and range_ptr_list.
Each has two "flavours": mutable and not mutable. The const versions are parameterized by a const parameter. For example: range_ptr_list<int const> and the mutable doesn't have the const, so: range_ptr_list<int>.
The difference between the two is that the const versions can't modify the elements from the sequence, while the mutable allows so. Also, the const receives a Eina_Array const* while the mutable must have a Eina_Array*.
Reviewers: cedric
CC: savio, cedric
Differential Revision: https://phab.enlightenment.org/D613
Summary:
Added support for exceptions on ecore_main_loop_thread_safe_call_async and
ecore_main_loop_thread_safe_call_sync. Also optimized the transport of the
return value through a parameter on ecore_main_loop_thread_safe_call_sync.
ecore-cxx: Changed uses of alignas for aligned_storage in C++11
Reviewers: cedric, raster
CC: savio, cedric
Differential Revision: https://phab.enlightenment.org/D593
Signed-off-by: Cedric BAIL <cedric.bail@samsung.com>
The point of this binding is to enable the support for easy lambda for ecore function
that wont be using Eo. See the tests on how to use those.
Reviewers: cedric, raster
CC: savio, cedric
Differential Revision: https://phab.enlightenment.org/D582
Signed-off-by: Cedric Bail <cedric.bail@free.fr>
We do expect to integrate more bindings support in EFL to make them
first class citizen and make sure they get proper attention during
the development cycle. It so make sense to give them a proper
subdirectory.