eina_cxx: Add missing methods to Eina C++ wrappers

Also fix release_native_handle type error on mutable ranges.
This commit is contained in:
Vitor Sousa 2015-12-09 15:32:04 -02:00
parent fd0cf8b764
commit c7550b2964
4 changed files with 30 additions and 1 deletions

View File

@ -119,6 +119,17 @@ struct accessor_common_base
return _impl; return _impl;
} }
/**
* @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. * @brief Swap content between both objects.
* @param other Other accessor object. * @param other Other accessor object.

View File

@ -95,6 +95,22 @@ public:
return *this; 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: protected:
/** /**
* @internal * @internal

View File

@ -511,6 +511,7 @@ public:
using _base_type::crend; using _base_type::crend;
using _base_type::swap; using _base_type::swap;
using _base_type::native_handle; using _base_type::native_handle;
using _base_type::release_native_handle;
}; };
template <typename T> template <typename T>
@ -613,6 +614,7 @@ public:
} }
using _base_type::swap; using _base_type::swap;
using _base_type::native_handle; using _base_type::native_handle;
using _base_type::release_native_handle;
friend bool operator==(range_list<T> const& rhs, range_list<T> const& lhs) friend bool operator==(range_list<T> const& rhs, range_list<T> const& lhs)
{ {

View File

@ -276,7 +276,7 @@ struct _mutable_range_template : _const_range_template<T, Traits>
{ {
auto h = _handle; auto h = _handle;
_handle = nullptr; _handle = nullptr;
return h; return const_cast<native_handle_type>(h);
} }
/** /**