summaryrefslogtreecommitdiff
path: root/src/bindings/eina_cxx/eina_ptrarray.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/bindings/eina_cxx/eina_ptrarray.hh')
-rw-r--r--src/bindings/eina_cxx/eina_ptrarray.hh16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/bindings/eina_cxx/eina_ptrarray.hh b/src/bindings/eina_cxx/eina_ptrarray.hh
index 2f40627ce9..f47202ebb5 100644
--- a/src/bindings/eina_cxx/eina_ptrarray.hh
+++ b/src/bindings/eina_cxx/eina_ptrarray.hh
@@ -295,10 +295,12 @@ struct range_ptr_array : _range_template<T, _ptr_array_access_traits>
typedef _range_template<T, _ptr_array_access_traits> _base_type; /**< Type for the base class. */
typedef typename _base_type::value_type value_type; /**< The type of each element. */
+ typedef typename _base_type::native_handle_type native_handle_type;
+
/**
* @brief Creates a range from a native Eina array handle.
*/
- range_ptr_array(Eina_Array* array)
+ range_ptr_array(native_handle_type array)
: _base_type(array)
{}
@@ -391,7 +393,7 @@ struct _ptr_array_common_base
/**
* @internal
*/
- T* _new_clone(T const& a)
+ T* _new_clone(typename container_value_type<T>::type const& a)
{
return _get_clone_allocator().allocate_clone(a);
}
@@ -402,6 +404,7 @@ struct _ptr_array_common_base
struct _ptr_array_impl : CloneAllocator
{
_ptr_array_impl() : _array( ::eina_array_new(32u) ) {}
+ _ptr_array_impl(Eina_Array* array) : _array(array) {}
_ptr_array_impl(CloneAllocator allocator)
: clone_allocator_type(allocator), _array( ::eina_array_new(32u)) {}
@@ -449,6 +452,8 @@ public:
typedef std::unique_ptr<value_type, clone_allocator_deleter<clone_allocator_type> > _unique_ptr;
+ typedef Eina_Array* native_handle_type;
+
/**
* @brief Default constructor. Create an empty array.
*
@@ -1210,6 +1215,13 @@ public:
*/
size_type max_size() const { return -1; }
+ Eina_Array* release_native_handle()
+ {
+ Eina_Array* tmp = this->_impl._array;
+ this->_impl._array = ::eina_array_new(32u);
+ return tmp;
+ }
+
/**
* @brief Get a handle for the wrapped Eina_Array.
* @return Handle for the native Eina array.