45 #include <type_traits>
64 virtual const char*
what()
const throw() {
return "FutureThreadError\n";}
68 virtual const char*
what()
const throw() {
return "FutureWhenError\n";}
236 #ifndef DOXYGEN_PARSING
237 namespace FutureHelper {
245 struct WhenWrapperArg {
246 mutable std::unique_ptr<const Cgu::Callback::CallbackArg<const Val&>> when;
251 when(std::move(when_)) {}
252 WhenWrapperArg(WhenWrapperArg&& w): when(std::move(w.when)) {}
261 struct WhenWrapperArgRel {
262 mutable std::unique_ptr<Cgu::SafeEmitterArg<const Val&>> when;
267 when(std::move(when_)) {}
268 WhenWrapperArgRel(WhenWrapperArgRel&& w): when(std::move(w.when)) {}
272 #endif // DOXYGEN_PARSING
278 std::unique_ptr<Cgu::Thread::Thread> thread_u;
279 std::unique_ptr<Cgu::Callback::Callback> cb_u;
289 template <
class T,
class Ret,
class... Args>
290 void run_wrapper(T*, Ret (T::*)(Args...),
const Args&...);
292 template <
class T,
class Ret,
class... Args>
293 void run_wrapper_const(
const T*, Ret (T::*)(Args...)
const,
const Args&...);
295 template <
class Ret,
class... Args>
296 void run_wrapper_static(Ret (*)(Args...),
const Args&...);
298 template <
class Func>
299 void run_wrapper_functor(Func&);
301 void cancel_cleanup();
304 void post_done(
const FutureHelper::WhenWrapperArg<Val>&,
305 gint, GMainContext*);
307 void post_done_rel(
const FutureHelper::WhenWrapperArgRel<Val>&,
308 gint, GMainContext*);
314 const std::unique_ptr<const Cgu::Callback::Callback>& func,
318 Future(): val(), done(
false), running(
false), error(
false), emitter_error(
false) {}
361 template <
class Ret,
class T>
392 template <
class Ret,
class Param1,
class Arg1,
class T>
394 Ret (T::*func)(Param1),
424 template <
class Ret,
class Param1,
class Param2,
class Arg1,
class Arg2,
class T>
426 Ret (T::*func)(Param1, Param2),
457 template <
class Ret,
class Param1,
class Param2,
class Param3,
458 class Arg1,
class Arg2,
class Arg3,
class T>
460 Ret (T::*func)(Param1, Param2, Param3),
491 template <
class Ret,
class T>
493 Ret (T::*func)()
const);
522 template <
class Ret,
class Param1,
class Arg1,
class T>
524 Ret (T::*func)(Param1)
const,
554 template <
class Ret,
class Param1,
class Param2,
class Arg1,
class Arg2,
class T>
556 Ret (T::*func)(Param1, Param2)
const,
587 template <
class Ret,
class Param1,
class Param2,
class Param3,
588 class Arg1,
class Arg2,
class Arg3,
class T>
590 Ret (T::*func)(Param1, Param2, Param3)
const,
651 template <
class Ret,
class Param1,
class Arg1>
682 template <
class Ret,
class Param1,
class Param2,
class Arg1,
class Arg2>
714 template <
class Ret,
class Param1,
class Param2,
class Param3,
715 class Arg1,
class Arg2,
class Arg3>
748 template <
class Ret,
class Param1,
class Param2,
class Param3,
class Param4,
749 class Arg1,
class Arg2,
class Arg3,
class Arg4>
789 template <
class Func>
1154 gint priority = G_PRIORITY_DEFAULT,
1155 GMainContext* context = 0);
1272 gint priority = G_PRIORITY_DEFAULT,
1273 GMainContext* context = 0);
1372 GMainContext* context = 0);
1448 GMainContext* context = 0);
1625 template <
class Obj,
class Ret,
class... Params,
class... Args>
1627 Ret (Obj::*func)(Params...),
1662 template <
class Obj,
class Ret,
class... Params,
class... Args>
1664 Ret (Obj::*func)(Params...)
const,
1699 template <
class Ret,
class... Params,
class... Args>
1765 template <
class Ret,
class Func>
1773 #ifndef DOXYGEN_PARSING
1774 template <
class Func>
1788 #include <c++-gtk-utils/future.tpp>