Commit Graph

808 Commits

Author SHA1 Message Date
Felipe Magno de Almeida 9e364d6f4b eina-cxx: Fixes compilation errors and warnings in clang
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
2014-03-11 10:07:18 +09:00
Felipe Magno de Almeida 2ab6aac74d eina-cxx: Added malloc_clone_allocator to use with POD's when wrapping Eina C structures
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
2014-03-10 12:35:00 +09:00
Felipe Magno de Almeida 416376e03c eina-cxx: Added eina_log support for C++, using IOStreams syntax
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
2014-03-10 12:35:00 +09:00
Felipe Magno de Almeida 5942207b25 eina-cxx: Added range types for containers
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
2014-03-10 12:35:00 +09:00
Felipe Magno de Almeida 4105c002b3 ecore-cxx: add support for exceptions.
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>
2014-03-07 14:37:03 +09:00
Felipe Magno de Almeida bc0a54c57c eina-cxx: renamed efl::eina::eina_value to efl::eina::value
Reviewers: cedric

CC: savio, cedric

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

Signed-off-by: Cedric BAIL <cedric.bail@samsung.com>
2014-03-07 14:32:42 +09:00
Felipe Magno de Almeida 91f5a9b043 ecore_cxx: add main_loop_thread_safe_call_sync and main_loop_thread_safe_call_async with tests
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>
2014-02-26 18:52:08 -03:00
Cedric Bail 96b1b880a4 eina_cxx: move Eina_CXX to a bindings subdirectory.
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.
2014-02-26 12:18:26 -03:00