vitorsousa pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c7550b2964e8f1c1cd9f51c7db573c5361f8cb10
commit c7550b2964e8f1c1cd9f51c7db573c5361f8cb10 Author: Vitor Sousa <vitorsousasi...@gmail.com> Date: Wed Dec 9 15:32:04 2015 -0200 eina_cxx: Add missing methods to Eina C++ wrappers Also fix release_native_handle type error on mutable ranges. --- src/bindings/eina_cxx/eina_accessor.hh | 11 +++++++++++ src/bindings/eina_cxx/eina_iterator.hh | 16 ++++++++++++++++ src/bindings/eina_cxx/eina_list.hh | 2 ++ src/bindings/eina_cxx/eina_range_types.hh | 2 +- 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/bindings/eina_cxx/eina_accessor.hh b/src/bindings/eina_cxx/eina_accessor.hh index d084918..800c3fa 100644 --- a/src/bindings/eina_cxx/eina_accessor.hh +++ b/src/bindings/eina_cxx/eina_accessor.hh @@ -120,6 +120,17 @@ struct accessor_common_base } /** + * @brief Release the handle of the wrapped @c Eina_Accessor. + * @return Handle for the native @c Eina_Accessor. + */ + Eina_Accessor* release_native_handle() + { + auto h = _impl; + _impl = nullptr; + return h; + } + + /** * @brief Swap content between both objects. * @param other Other accessor object. * diff --git a/src/bindings/eina_cxx/eina_iterator.hh b/src/bindings/eina_cxx/eina_iterator.hh index 81eb2ee..de04fd7 100644 --- a/src/bindings/eina_cxx/eina_iterator.hh +++ b/src/bindings/eina_cxx/eina_iterator.hh @@ -95,6 +95,22 @@ public: return *this; } + + /** + * @brief Get the handle for the wrapped @c Eina_Iterator. + * @return Internal handle for the native Eina iterator. + * + * This member function returns the native @c Eina_Iterator handle + * that is wrapped inside this object. + * + * @warning It is important to take care when using it, since the + * handle will be automatically release upon object destruction. + */ + Eina_Iterator* native_handle() const + { + return _iterator; + } + protected: /** * @internal diff --git a/src/bindings/eina_cxx/eina_list.hh b/src/bindings/eina_cxx/eina_list.hh index ae140b2..a47a7d7 100644 --- a/src/bindings/eina_cxx/eina_list.hh +++ b/src/bindings/eina_cxx/eina_list.hh @@ -511,6 +511,7 @@ public: using _base_type::crend; using _base_type::swap; using _base_type::native_handle; + using _base_type::release_native_handle; }; template <typename T> @@ -613,6 +614,7 @@ public: } using _base_type::swap; using _base_type::native_handle; + using _base_type::release_native_handle; friend bool operator==(range_list<T> const& rhs, range_list<T> const& lhs) { diff --git a/src/bindings/eina_cxx/eina_range_types.hh b/src/bindings/eina_cxx/eina_range_types.hh index 313ca05..4f05d73 100644 --- a/src/bindings/eina_cxx/eina_range_types.hh +++ b/src/bindings/eina_cxx/eina_range_types.hh @@ -276,7 +276,7 @@ struct _mutable_range_template : _const_range_template<T, Traits> { auto h = _handle; _handle = nullptr; - return h; + return const_cast<native_handle_type>(h); } /** --