cxx: Add _get_wref() convenience to all classes
authorJean-Philippe Andre <jp.andre@samsung.com>
Thu, 2 Nov 2017 09:14:59 +0000 (18:14 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Tue, 7 Nov 2017 00:57:24 +0000 (09:57 +0900)
commit73ec85aeffc2eddfe81673344ed22bb21461aaa7
treeba849f324c6b7dd413836ab84d4a6cc7bab3f704
parent88e10da36b00291b399c2d9bfe5f266a44a40f6f
cxx: Add _get_wref() convenience to all classes

This allows constructs like:

  auto w_obj = obj._get_wref();
  auto cb = std::bind([w_obj]() {
    auto o = w_obj.lock();
    if (!o) return;
    o->call();
  });
  event_add(..., obj, cb);

Note: I don't like how those wref work. Close to c++ wref but far from
EFL wref.
src/lib/eolian_cxx/grammar/class_definition.hpp