63 virtual const char*
what()
const throw() {
return "FutureThreadError\n";}
67 virtual const char*
what()
const throw() {
return "FutureWhenError\n";}
339 std::auto_ptr<Cgu::Thread::Thread> thread_a;
340 std::auto_ptr<Cgu::Callback::Callback> cb_a;
350 #ifndef DOXYGEN_PARSING
354 template<
class Obj,
class Func>
358 arg_pair(Obj obj_, Func func_):
359 obj(obj_), func(func_) {}
362 template<
class Obj,
class Func,
class Arg1>
368 obj(obj_), func(func_), arg1(arg1_) {}
371 template<
class Obj,
class Func,
class Arg1,
class Arg2>
372 struct arg_quadruple {
379 obj(obj_), func(func_), arg1(arg1_), arg2(arg2_) {}
382 struct when_mainloop_args {
384 GMainContext* context;
385 when_mainloop_args(gint p, GMainContext* c): priority(p), context(c) {}
395 template <
class Ret,
class T>
396 static void run_wrapper(
const arg_pair<T&, Ret (T::*)()>& args,
399 template <
class Ret,
class Arg1,
class T>
400 static void run_wrapper(
const arg_triple<T&, Ret (T::*)(Arg1), Arg1>& args,
403 template <
class Ret,
class Arg1,
class Arg2,
class T>
404 static void run_wrapper(
const arg_quadruple<T&, Ret (T::*)(Arg1, Arg2), Arg1, Arg2>& args,
407 template <
class Ret,
class T>
408 static void run_wrapper_const(
const arg_pair<
const T&, Ret (T::*)()
const>& args,
411 template <
class Ret,
class Arg1,
class T>
412 static void run_wrapper_const(
const arg_triple<
const T&, Ret (T::*)(Arg1)
const, Arg1>& args,
415 template <
class Ret,
class Arg1,
class Arg2,
class T>
416 static void run_wrapper_const(
const arg_quadruple<
const T&, Ret (T::*)(Arg1, Arg2)
const, Arg1, Arg2>& args,
420 static void run_wrapper_static(Ret (*func)(),
423 template <
class Ret,
class Arg1>
424 static void run_wrapper_static(
const arg_triple<Empty, Ret (*)(Arg1), Arg1>& args,
427 template <
class Ret,
class Arg1,
class Arg2>
428 static void run_wrapper_static(
const arg_quadruple<Empty, Ret (*)(Arg1, Arg2), Arg1, Arg2>& args,
431 void cancel_cleanup();
435 const when_mainloop_args&);
438 const when_mainloop_args&);
448 Future(): val(), done(
false), running(
false), error(
false), emitter_error(
false) {}
481 template <
class Ret,
class T>
512 template <
class Ret,
class Arg1,
class T>
514 Ret (T::*func)(Arg1),
544 template <
class Ret,
class Arg1,
class Arg2,
class T>
546 Ret (T::*func)(Arg1, Arg2),
576 template <
class Ret,
class T>
578 Ret (T::*func)()
const);
607 template <
class Ret,
class Arg1,
class T>
609 Ret (T::*func)(Arg1)
const,
639 template <
class Ret,
class Arg1,
class Arg2,
class T>
641 Ret (T::*func)(Arg1, Arg2)
const,
701 template <
class Ret,
class Arg1>
731 template <
class Ret,
class Arg1,
class Arg2>
1029 gint priority = G_PRIORITY_DEFAULT,
1030 GMainContext* context = 0);
1147 gint priority = G_PRIORITY_DEFAULT,
1148 GMainContext* context = 0);
1246 GMainContext* context = 0);
1321 GMainContext* context = 0);
1472 #include <c++-gtk-utils/future.tpp>