summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVitor Sousa <vitorsousasilva@gmail.com>2015-12-09 15:32:04 -0200
committerVitor Sousa <vitorsousasilva@gmail.com>2016-03-18 17:47:09 -0300
commitc7550b2964e8f1c1cd9f51c7db573c5361f8cb10 (patch)
treea80024d9ec38b69a547a9b60cdcfd9319106a3ca /src
parentfd0cf8b76459da70e2ef0116b19a322913cc92bb (diff)
eina_cxx: Add missing methods to Eina C++ wrappers
Also fix release_native_handle type error on mutable ranges.
Diffstat (limited to 'src')
-rw-r--r--src/bindings/eina_cxx/eina_accessor.hh11
-rw-r--r--src/bindings/eina_cxx/eina_iterator.hh16
-rw-r--r--src/bindings/eina_cxx/eina_list.hh2
-rw-r--r--src/bindings/eina_cxx/eina_range_types.hh2
4 files changed, 30 insertions, 1 deletions
diff --git a/src/bindings/eina_cxx/eina_accessor.hh b/src/bindings/eina_cxx/eina_accessor.hh
index d084918ca8..800c3fa122 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
120 } 120 }
121 121
122 /** 122 /**
123 * @brief Release the handle of the wrapped @c Eina_Accessor.
124 * @return Handle for the native @c Eina_Accessor.
125 */
126 Eina_Accessor* release_native_handle()
127 {
128 auto h = _impl;
129 _impl = nullptr;
130 return h;
131 }
132
133 /**
123 * @brief Swap content between both objects. 134 * @brief Swap content between both objects.
124 * @param other Other accessor object. 135 * @param other Other accessor object.
125 * 136 *
diff --git a/src/bindings/eina_cxx/eina_iterator.hh b/src/bindings/eina_cxx/eina_iterator.hh
index 81eb2ee508..de04fd73a3 100644
--- a/src/bindings/eina_cxx/eina_iterator.hh
+++ b/src/bindings/eina_cxx/eina_iterator.hh
@@ -95,6 +95,22 @@ public:
95 return *this; 95 return *this;
96 } 96 }
97 97
98
99 /**
100 * @brief Get the handle for the wrapped @c Eina_Iterator.
101 * @return Internal handle for the native Eina iterator.
102 *
103 * This member function returns the native @c Eina_Iterator handle
104 * that is wrapped inside this object.
105 *
106 * @warning It is important to take care when using it, since the
107 * handle will be automatically release upon object destruction.
108 */
109 Eina_Iterator* native_handle() const
110 {
111 return _iterator;
112 }
113
98protected: 114protected:
99 /** 115 /**
100 * @internal 116 * @internal
diff --git a/src/bindings/eina_cxx/eina_list.hh b/src/bindings/eina_cxx/eina_list.hh
index ae140b2069..a47a7d7206 100644
--- a/src/bindings/eina_cxx/eina_list.hh
+++ b/src/bindings/eina_cxx/eina_list.hh
@@ -511,6 +511,7 @@ public:
511 using _base_type::crend; 511 using _base_type::crend;
512 using _base_type::swap; 512 using _base_type::swap;
513 using _base_type::native_handle; 513 using _base_type::native_handle;
514 using _base_type::release_native_handle;
514}; 515};
515 516
516template <typename T> 517template <typename T>
@@ -613,6 +614,7 @@ public:
613 } 614 }
614 using _base_type::swap; 615 using _base_type::swap;
615 using _base_type::native_handle; 616 using _base_type::native_handle;
617 using _base_type::release_native_handle;
616 618
617 friend bool operator==(range_list<T> const& rhs, range_list<T> const& lhs) 619 friend bool operator==(range_list<T> const& rhs, range_list<T> const& lhs)
618 { 620 {
diff --git a/src/bindings/eina_cxx/eina_range_types.hh b/src/bindings/eina_cxx/eina_range_types.hh
index 313ca05cd9..4f05d734e2 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>
276 { 276 {
277 auto h = _handle; 277 auto h = _handle;
278 _handle = nullptr; 278 _handle = nullptr;
279 return h; 279 return const_cast<native_handle_type>(h);
280 } 280 }
281 281
282 /** 282 /**