summaryrefslogtreecommitdiff
path: root/src/lib/efl/cxx
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-11-23 13:51:10 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-12-05 10:14:03 +0900
commit63725d71fda340986345725e2df3fcbaaa573649 (patch)
tree30c2990dc88b3252bac4221f5f9442e03d628d10 /src/lib/efl/cxx
parent0f5d40e6d4628cc38305fe0a72702f58817c9e69 (diff)
cxx: Implement proper part support (wrt. refs)
It's VERY hacky, but works as expected: no leak, no extra unref. This is a lucky case of simply overriding efl_part() implementation in C++, without having to modify the declaration.
Diffstat (limited to 'src/lib/efl/cxx')
-rw-r--r--src/lib/efl/cxx/efl_part_impl.hh26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/lib/efl/cxx/efl_part_impl.hh b/src/lib/efl/cxx/efl_part_impl.hh
new file mode 100644
index 0000000000..c1c99e785a
--- /dev/null
+++ b/src/lib/efl/cxx/efl_part_impl.hh
@@ -0,0 +1,26 @@
1//#ifndef EFL_PART_IMPL_HH
2//#define EFL_PART_IMPL_HH
3
4namespace efl {
5inline ::efl::eolian::return_traits< ::efl::Object>::type Part::part( ::efl::eolian::in_traits< ::efl::eina::string_view>::type name) const
6{
7 Eo *handle = ::efl_part(this->_eo_ptr(), name.c_str());
8 ::efl_auto_unref_set(handle, false);
9 return ::efl::Object{handle};
10}
11}
12
13namespace eo_cxx {
14namespace efl {
15inline ::efl::eolian::return_traits< ::efl::Object>::type Part::part( ::efl::eolian::in_traits< ::efl::eina::string_view>::type name) const
16{
17 Eo *handle = ::efl_part(this->_eo_ptr(), name.c_str());
18 ::efl_auto_unref_set(handle, false);
19 return ::efl::Object{handle};
20}
21inline efl::Part::operator ::efl::Part() const { return *static_cast< ::efl::Part const*>(static_cast<void const*>(this)); }
22inline efl::Part::operator ::efl::Part&() { return *static_cast< ::efl::Part*>(static_cast<void*>(this)); }
23inline efl::Part::operator ::efl::Part const&() const { return *static_cast< ::efl::Part const*>(static_cast<void const*>(this)); }
24} }
25
26//#endif