39 #ifndef CGU_CALLBACK_H
40 #define CGU_CALLBACK_H
1152 #include <functional>
1155 #include <type_traits>
1227 template <
class... FreeArgs>
1267 #ifdef CGU_USE_GLIB_MEMORY_SLICES_NO_COMPAT
1288 template <
class... T>
1290 return (f1.cb_s.get() == f2.cb_s.get());
1298 template <
class... T>
1314 template <
class... T>
1316 return std::less<
const CallbackArg<T...>*>()(f1.cb_s.get(), f2.cb_s.get());
1324 template <
class... T>
1326 return (f1.cb_s.get() == f2.cb_s.get());
1334 template <
class... T>
1345 template <
class... T>
1347 return std::less<
const CallbackArg<T...>*>()(f1.cb_s.get(), f2.cb_s.get());
1356 #ifndef DOXYGEN_PARSING
1361 template <
class... T>
1362 struct hash<Cgu::Callback::FunctorArg<T...>> {
1363 typedef std::size_t result_type;
1365 result_type operator()(
const argument_type& f)
const {
1372 template <
class... T>
1373 struct hash<Cgu::Callback::SafeFunctorArg<T...>> {
1374 typedef std::size_t result_type;
1376 result_type operator()(
const argument_type& f)
const {
1385 #endif // DOXYGEN_PARSING
1446 template <
class... FreeArgs>
1448 SharedPtr<
const CallbackArg<FreeArgs...>> cb_s;
1471 if (cb_s.get()) cb_s->dispatch(args...);
1562 template <
class... FreeArgs>
1563 class SafeFunctorArg {
1578 if (cb_s.get()) cb_s->dispatch(args...);
1659 template <
class T,
class... FreeArgs>
1668 (obj->*func)(free_args...);
1673 template <
bool unref,
class T,
class BoundArg,
class... FreeArgs>
1676 typedef void (T::*
MemFunc)(BoundArg, FreeArgs...);
1683 (obj->*func)(arg, free_args...);
1685 template <
class Arg>
1687 Arg&& arg_): obj(&obj_), func(func_), arg(std::forward<Arg>(arg_)) {}
1690 template <
bool unref,
class T,
class BoundArg1,
class BoundArg2,
class... FreeArgs>
1693 typedef void (T::*
MemFunc)(BoundArg1, BoundArg2, FreeArgs...);
1701 (obj->*func)(arg1, arg2, free_args...);
1703 template <
class Arg1,
class Arg2>
1706 Arg2&& arg2_): obj(&obj_), func(func_),
1707 arg1(std::forward<Arg1>(arg1_)),
1708 arg2(std::forward<Arg2>(arg2_)) {}
1711 template <
bool unref,
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
1714 typedef void (T::*
MemFunc)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...);
1723 (obj->*func)(arg1, arg2, arg3, free_args...);
1725 template <
class Arg1,
class Arg2,
class Arg3>
1730 obj(&obj_), func(func_),
1731 arg1(std::forward<Arg1>(arg1_)),
1732 arg2(std::forward<Arg2>(arg2_)),
1733 arg3(std::forward<Arg3>(arg3_)) {}
1736 template <
bool unref,
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
1737 class BoundArg4,
class... FreeArgs>
1740 typedef void (T::*
MemFunc)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, FreeArgs...);
1750 (obj->*func)(arg1, arg2, arg3, arg4, free_args...);
1752 template <
class Arg1,
class Arg2,
class Arg3,
class Arg4>
1758 obj(&obj_), func(func_),
1759 arg1(std::forward<Arg1>(arg1_)),
1760 arg2(std::forward<Arg2>(arg2_)),
1761 arg3(std::forward<Arg3>(arg3_)),
1762 arg4(std::forward<Arg4>(arg4_)) {}
1765 template <
bool unref,
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
1766 class BoundArg4,
class BoundArg5,
class... FreeArgs>
1769 typedef void (T::*
MemFunc)(BoundArg1, BoundArg2, BoundArg3,
1770 BoundArg4, BoundArg5, FreeArgs...);
1781 (obj->*func)(arg1, arg2, arg3, arg4, arg5, free_args...);
1783 template <
class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5>
1790 obj(&obj_), func(func_),
1791 arg1(std::forward<Arg1>(arg1_)),
1792 arg2(std::forward<Arg2>(arg2_)),
1793 arg3(std::forward<Arg3>(arg3_)),
1794 arg4(std::forward<Arg4>(arg4_)),
1795 arg5(std::forward<Arg5>(arg5_)) {}
1800 template <
class T,
class... FreeArgs>
1809 (obj->*func)(free_args...);
1814 template <
bool unref,
class T,
class BoundArg,
class... FreeArgs>
1817 typedef void (T::*
MemFunc)(BoundArg, FreeArgs...)
const;
1824 (obj->*func)(arg, free_args...);
1826 template <
class Arg>
1828 Arg&& arg_): obj(&obj_), func(func_), arg(std::forward<Arg>(arg_)) {}
1831 template <
bool unref,
class T,
class BoundArg1,
class BoundArg2,
class... FreeArgs>
1834 typedef void (T::*
MemFunc)(BoundArg1, BoundArg2, FreeArgs...)
const;
1842 (obj->*func)(arg1, arg2, free_args...);
1844 template <
class Arg1,
class Arg2>
1847 Arg2&& arg2_): obj(&obj_), func(func_),
1848 arg1(std::forward<Arg1>(arg1_)),
1849 arg2(std::forward<Arg2>(arg2_)) {}
1852 template <
bool unref,
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
1855 typedef void (T::*
MemFunc)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...)
const;
1864 (obj->*func)(arg1, arg2, arg3, free_args...);
1866 template <
class Arg1,
class Arg2,
class Arg3>
1871 obj(&obj_), func(func_),
1872 arg1(std::forward<Arg1>(arg1_)),
1873 arg2(std::forward<Arg2>(arg2_)),
1874 arg3(std::forward<Arg3>(arg3_)) {}
1877 template <
bool unref,
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
1878 class BoundArg4,
class... FreeArgs>
1881 typedef void (T::*
MemFunc)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, FreeArgs...)
const;
1891 (obj->*func)(arg1, arg2, arg3, arg4, free_args...);
1893 template <
class Arg1,
class Arg2,
class Arg3,
class Arg4>
1899 obj(&obj_), func(func_),
1900 arg1(std::forward<Arg1>(arg1_)),
1901 arg2(std::forward<Arg2>(arg2_)),
1902 arg3(std::forward<Arg3>(arg3_)),
1903 arg4(std::forward<Arg4>(arg4_)) {}
1906 template <
bool unref,
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
1907 class BoundArg4,
class BoundArg5,
class... FreeArgs>
1910 typedef void (T::*
MemFunc)(BoundArg1, BoundArg2, BoundArg3,
1911 BoundArg4, BoundArg5, FreeArgs...)
const;
1922 (obj->*func)(arg1, arg2, arg3, arg4, arg5, free_args...);
1924 template <
class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5>
1931 obj(&obj_), func(func_),
1932 arg1(std::forward<Arg1>(arg1_)),
1933 arg2(std::forward<Arg2>(arg2_)),
1934 arg3(std::forward<Arg3>(arg3_)),
1935 arg4(std::forward<Arg4>(arg4_)),
1936 arg5(std::forward<Arg5>(arg5_)) {}
1941 template <
class... FreeArgs>
1954 template <
bool unref,
class BoundArg,
class... FreeArgs>
1957 typedef void (*
Func)(BoundArg, FreeArgs...);
1963 func(arg, free_args...);
1965 template <
class Arg>
1969 template <
bool unref,
class BoundArg1,
class BoundArg2,
class... FreeArgs>
1972 typedef void (*
Func)(BoundArg1, BoundArg2, FreeArgs...);
1979 func(arg1, arg2, free_args...);
1981 template <
class Arg1,
class Arg2>
1983 Arg2&& arg2_): func(func_),
1984 arg1(std::forward<Arg1>(arg1_)),
1985 arg2(std::forward<Arg2>(arg2_)) {}
1988 template <
bool unref,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
1991 typedef void (*
Func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...);
1999 func(arg1, arg2, arg3, free_args...);
2001 template <
class Arg1,
class Arg2,
class Arg3>
2007 arg1(std::forward<Arg1>(arg1_)),
2008 arg2(std::forward<Arg2>(arg2_)),
2009 arg3(std::forward<Arg3>(arg3_)) {}
2012 template <
bool unref,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2013 class BoundArg4,
class... FreeArgs>
2016 typedef void (*
Func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, FreeArgs...);
2025 func(arg1, arg2, arg3, arg4, free_args...);
2027 template <
class Arg1,
class Arg2,
class Arg3,
class Arg4>
2034 arg1(std::forward<Arg1>(arg1_)),
2035 arg2(std::forward<Arg2>(arg2_)),
2036 arg3(std::forward<Arg3>(arg3_)),
2037 arg4(std::forward<Arg4>(arg4_)) {}
2040 template <
bool unref,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2041 class BoundArg4,
class BoundArg5,
class... FreeArgs>
2044 typedef void (*
Func)(BoundArg1, BoundArg2, BoundArg3,
2045 BoundArg4, BoundArg5, FreeArgs...);
2055 func(arg1, arg2, arg3, arg4, arg5, free_args...);
2057 template <
class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5>
2065 arg1(std::forward<Arg1>(arg1_)),
2066 arg2(std::forward<Arg2>(arg2_)),
2067 arg3(std::forward<Arg3>(arg3_)),
2068 arg4(std::forward<Arg4>(arg4_)),
2069 arg5(std::forward<Arg5>(arg5_)) {}
2080 template <
class... FreeArgs>
2082 std::function<void(FreeArgs...)> f;
2090 template <
class Lambda,
class... FreeArgs>
2115 template <
class T,
class... FreeArgs>
2117 void (T::*func)(FreeArgs...)) {
2118 return new Callback0<T, FreeArgs...>{t, func};
2133 template <
class T,
class... FreeArgs>
2135 void (T::*func)(FreeArgs...)) {
2136 return new Callback0<T, FreeArgs...>{t, func};
2151 template <
class T,
class... FreeArgs>
2153 void (T::*func)(FreeArgs...)) {
2154 return new Callback0<T, FreeArgs...>{t, func};
2168 template <
class T,
class BoundArg,
class... FreeArgs>
2170 void (T::*func)(BoundArg, FreeArgs...),
2172 return new Callback1<
false, T, BoundArg, FreeArgs...>{t, func, arg};
2192 template <
class T,
class BoundArg,
class... FreeArgs>
2194 void (T::*func)(BoundArg, FreeArgs...),
2195 const BoundArg& arg) {
2196 return new Callback1<
false, T, BoundArg, FreeArgs...>{t, func, arg};
2216 template <
class T,
class BoundArg,
class Arg,
class... FreeArgs>
2218 void (T::*func)(BoundArg, FreeArgs...),
2220 return new Callback1<
true, T, BoundArg, FreeArgs...>{t, func, std::forward<Arg>(arg)};
2234 template <
class T,
class BoundArg1,
class BoundArg2,
class... FreeArgs>
2236 void (T::*func)(BoundArg1, BoundArg2, FreeArgs...),
2239 return new Callback2<
false, T, BoundArg1, BoundArg2, FreeArgs...>{t, func, arg1, arg2};
2259 template <
class T,
class BoundArg1,
class BoundArg2,
class... FreeArgs>
2261 void (T::*func)(BoundArg1, BoundArg2, FreeArgs...),
2262 const BoundArg1& arg1,
2263 const BoundArg2& arg2) {
2264 return new Callback2<
false, T, BoundArg1, BoundArg2, FreeArgs...>{t, func, arg1, arg2};
2284 template <
class T,
class BoundArg1,
class BoundArg2,
2285 class Arg1,
class Arg2,
class... FreeArgs>
2287 void (T::*func)(BoundArg1, BoundArg2, FreeArgs...),
2290 return new Callback2<
true, T, BoundArg1, BoundArg2, FreeArgs...>{t, func,
2291 std::forward<Arg1>(arg1),
2292 std::forward<Arg2>(arg2)};
2306 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
2308 void (T::*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...),
2312 return new Callback3<
false, T, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{t, func, arg1, arg2, arg3};
2332 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
2334 void (T::*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...),
2335 const BoundArg1& arg1,
2336 const BoundArg2& arg2,
2337 const BoundArg3& arg3) {
2338 return new Callback3<
false, T, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{t, func, arg1, arg2, arg3};
2358 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2359 class Arg1,
class Arg2,
class Arg3,
class... FreeArgs>
2361 void (T::*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...),
2365 return new Callback3<
true, T, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{t, func,
2366 std::forward<Arg1>(arg1),
2367 std::forward<Arg2>(arg2),
2368 std::forward<Arg3>(arg3)};
2382 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2383 class BoundArg4,
class... FreeArgs>
2385 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2386 BoundArg4, FreeArgs...),
2391 return new Callback4<
false, T, BoundArg1, BoundArg2, BoundArg3,
2392 BoundArg4, FreeArgs...>{t, func, arg1, arg2, arg3, arg4};
2412 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2413 class BoundArg4,
class... FreeArgs>
2415 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2416 BoundArg4, FreeArgs...),
2417 const BoundArg1& arg1,
2418 const BoundArg2& arg2,
2419 const BoundArg3& arg3,
2420 const BoundArg4& arg4) {
2421 return new Callback4<
false, T, BoundArg1, BoundArg2, BoundArg3,
2422 BoundArg4, FreeArgs...>{t, func, arg1, arg2, arg3, arg4};
2442 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
2443 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class... FreeArgs>
2445 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2446 BoundArg4, FreeArgs...),
2451 return new Callback4<
true, T, BoundArg1, BoundArg2, BoundArg3,
2452 BoundArg4, FreeArgs...>{t, func,
2453 std::forward<Arg1>(arg1),
2454 std::forward<Arg2>(arg2),
2455 std::forward<Arg3>(arg3),
2456 std::forward<Arg4>(arg4)};
2470 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2471 class BoundArg4,
class BoundArg5,
class... FreeArgs>
2473 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2474 BoundArg4, BoundArg5, FreeArgs...),
2480 return new Callback5<
false, T, BoundArg1, BoundArg2, BoundArg3,
2481 BoundArg4, BoundArg5, FreeArgs...>{t, func, arg1, arg2, arg3, arg4, arg5};
2501 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2502 class BoundArg4,
class BoundArg5,
class... FreeArgs>
2504 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2505 BoundArg4, BoundArg5, FreeArgs...),
2506 const BoundArg1& arg1,
2507 const BoundArg2& arg2,
2508 const BoundArg3& arg3,
2509 const BoundArg4& arg4,
2510 const BoundArg5& arg5) {
2511 return new Callback5<
false, T, BoundArg1, BoundArg2, BoundArg3,
2512 BoundArg4, BoundArg5, FreeArgs...>{t, func, arg1, arg2, arg3, arg4, arg5};
2532 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
class BoundArg5,
2533 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5,
class... FreeArgs>
2535 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2536 BoundArg4, BoundArg5, FreeArgs...),
2542 return new Callback5<
true, T, BoundArg1, BoundArg2, BoundArg3,
2543 BoundArg4, BoundArg5, FreeArgs...>{t, func,
2544 std::forward<Arg1>(arg1),
2545 std::forward<Arg2>(arg2),
2546 std::forward<Arg3>(arg3),
2547 std::forward<Arg4>(arg4),
2548 std::forward<Arg5>(arg5)};
2562 template <
class T,
class... FreeArgs>
2564 void (T::*func)(FreeArgs...)
const) {
2580 template <
class T,
class... FreeArgs>
2582 void (T::*func)(FreeArgs...)
const) {
2598 template <
class T,
class... FreeArgs>
2600 void (T::*func)(FreeArgs...)
const) {
2615 template <
class T,
class BoundArg,
class... FreeArgs>
2617 void (T::*func)(BoundArg, FreeArgs...)
const,
2619 return new Callback1_const<
false, T, BoundArg, FreeArgs...>{t, func, arg};
2639 template <
class T,
class BoundArg,
class... FreeArgs>
2641 void (T::*func)(BoundArg, FreeArgs...)
const,
2642 const BoundArg& arg) {
2643 return new Callback1_const<
false, T, BoundArg, FreeArgs...>{t, func, arg};
2663 template <
class T,
class BoundArg,
class Arg,
class... FreeArgs>
2665 void (T::*func)(BoundArg, FreeArgs...)
const,
2667 return new Callback1_const<
true, T, BoundArg, FreeArgs...>{t, func, std::forward<Arg>(arg)};
2681 template <
class T,
class BoundArg1,
class BoundArg2,
class... FreeArgs>
2683 void (T::*func)(BoundArg1, BoundArg2, FreeArgs...)
const,
2686 return new Callback2_const<
false, T, BoundArg1, BoundArg2, FreeArgs...>{t, func, arg1, arg2};
2706 template <
class T,
class BoundArg1,
class BoundArg2,
class... FreeArgs>
2708 void (T::*func)(BoundArg1, BoundArg2, FreeArgs...)
const,
2709 const BoundArg1& arg1,
2710 const BoundArg2& arg2) {
2711 return new Callback2_const<
false, T, BoundArg1, BoundArg2, FreeArgs...>{t, func, arg1, arg2};
2731 template <
class T,
class BoundArg1,
class BoundArg2,
2732 class Arg1,
class Arg2,
class... FreeArgs>
2734 void (T::*func)(BoundArg1, BoundArg2, FreeArgs...)
const,
2737 return new Callback2_const<
true, T, BoundArg1, BoundArg2, FreeArgs...>{t, func,
2738 std::forward<Arg1>(arg1),
2739 std::forward<Arg2>(arg2)};
2753 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
2755 void (T::*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...)
const,
2759 return new Callback3_const<
false, T, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{t, func, arg1, arg2, arg3};
2779 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
2781 void (T::*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...)
const,
2782 const BoundArg1& arg1,
2783 const BoundArg2& arg2,
2784 const BoundArg3& arg3) {
2785 return new Callback3_const<
false, T, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{t, func, arg1, arg2, arg3};
2805 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2806 class Arg1,
class Arg2,
class Arg3,
class... FreeArgs>
2808 void (T::*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...)
const,
2812 return new Callback3_const<
true, T, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{t, func,
2813 std::forward<Arg1>(arg1),
2814 std::forward<Arg2>(arg2),
2815 std::forward<Arg3>(arg3)};
2829 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2830 class BoundArg4,
class... FreeArgs>
2832 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2833 BoundArg4, FreeArgs...)
const,
2839 BoundArg4, FreeArgs...>{t, func, arg1, arg2, arg3, arg4};
2859 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2860 class BoundArg4,
class... FreeArgs>
2862 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2863 BoundArg4, FreeArgs...)
const,
2864 const BoundArg1& arg1,
2865 const BoundArg2& arg2,
2866 const BoundArg3& arg3,
2867 const BoundArg4& arg4) {
2869 BoundArg4, FreeArgs...>{t, func, arg1, arg2, arg3, arg4};
2889 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
2890 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class... FreeArgs>
2892 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2893 BoundArg4, FreeArgs...)
const,
2899 BoundArg4, FreeArgs...>{t, func,
2900 std::forward<Arg1>(arg1),
2901 std::forward<Arg2>(arg2),
2902 std::forward<Arg3>(arg3),
2903 std::forward<Arg4>(arg4)};
2917 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2918 class BoundArg4,
class BoundArg5,
class... FreeArgs>
2920 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2921 BoundArg4, BoundArg5, FreeArgs...)
const,
2928 BoundArg4, BoundArg5, FreeArgs...>{t, func, arg1, arg2, arg3, arg4, arg5};
2948 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2949 class BoundArg4,
class BoundArg5,
class... FreeArgs>
2951 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2952 BoundArg4, BoundArg5, FreeArgs...)
const,
2953 const BoundArg1& arg1,
2954 const BoundArg2& arg2,
2955 const BoundArg3& arg3,
2956 const BoundArg4& arg4,
2957 const BoundArg5& arg5) {
2959 BoundArg4, BoundArg5, FreeArgs...>{t, func, arg1, arg2, arg3, arg4, arg5};
2979 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
class BoundArg5,
2980 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5,
class... FreeArgs>
2982 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2983 BoundArg4, BoundArg5, FreeArgs...)
const,
2990 BoundArg4, BoundArg5, FreeArgs...>{t, func,
2991 std::forward<Arg1>(arg1),
2992 std::forward<Arg2>(arg2),
2993 std::forward<Arg3>(arg3),
2994 std::forward<Arg4>(arg4),
2995 std::forward<Arg5>(arg5)};
3009 template <
class... FreeArgs>
3026 template <
class... FreeArgs>
3043 template <
class... FreeArgs>
3059 template <
class BoundArg,
class... FreeArgs>
3082 template <
class BoundArg,
class... FreeArgs>
3084 const BoundArg& arg) {
3105 template <
class BoundArg,
class Arg,
class... FreeArgs>
3108 return new Callback1_static<
true, BoundArg, FreeArgs...>{func, std::forward<Arg>(arg)};
3122 template <
class BoundArg1,
class BoundArg2,
class... FreeArgs>
3126 return new Callback2_static<
false, BoundArg1, BoundArg2, FreeArgs...>{func, arg1, arg2};
3146 template <
class BoundArg1,
class BoundArg2,
class... FreeArgs>
3148 const BoundArg1& arg1,
3149 const BoundArg2& arg2) {
3150 return new Callback2_static<
false, BoundArg1, BoundArg2, FreeArgs...>{func, arg1, arg2};
3170 template <
class BoundArg1,
class BoundArg2,
class Arg1,
class Arg2,
class... FreeArgs>
3175 std::forward<Arg1>(arg1),
3176 std::forward<Arg2>(arg2)};
3190 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
3191 CallbackArg<FreeArgs...>*
make(
void (*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...),
3195 return new Callback3_static<
false, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{func, arg1, arg2, arg3};
3215 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
3217 const BoundArg1& arg1,
3218 const BoundArg2& arg2,
3219 const BoundArg3& arg3) {
3220 return new Callback3_static<
false, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{func, arg1, arg2, arg3};
3240 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
3241 class Arg1,
class Arg2,
class Arg3,
class... FreeArgs>
3246 return new Callback3_static<
true, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{func,
3247 std::forward<Arg1>(arg1),
3248 std::forward<Arg2>(arg2),
3249 std::forward<Arg3>(arg3)};
3263 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
3264 class BoundArg4,
class... FreeArgs>
3266 BoundArg4, FreeArgs...),
3272 BoundArg4, FreeArgs...>{func, arg1, arg2, arg3, arg4};
3292 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
3293 class BoundArg4,
class... FreeArgs>
3295 BoundArg4, FreeArgs...),
3296 const BoundArg1& arg1,
3297 const BoundArg2& arg2,
3298 const BoundArg3& arg3,
3299 const BoundArg4& arg4) {
3301 BoundArg4, FreeArgs...>{func, arg1, arg2, arg3, arg4};
3321 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
3322 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class... FreeArgs>
3324 BoundArg4, FreeArgs...),
3330 BoundArg4, FreeArgs...>{func,
3331 std::forward<Arg1>(arg1),
3332 std::forward<Arg2>(arg2),
3333 std::forward<Arg3>(arg3),
3334 std::forward<Arg4>(arg4)};
3348 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
3349 class BoundArg4,
class BoundArg5,
class... FreeArgs>
3351 BoundArg4, BoundArg5, FreeArgs...),
3358 BoundArg4, BoundArg5, FreeArgs...>{func, arg1, arg2, arg3, arg4, arg5};
3378 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
3379 class BoundArg4,
class BoundArg5,
class... FreeArgs>
3381 BoundArg4, BoundArg5, FreeArgs...),
3382 const BoundArg1& arg1,
3383 const BoundArg2& arg2,
3384 const BoundArg3& arg3,
3385 const BoundArg4& arg4,
3386 const BoundArg5& arg5) {
3388 BoundArg4, BoundArg5, FreeArgs...>{func, arg1, arg2, arg3, arg4, arg5};
3408 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
class BoundArg5,
3409 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5,
class... FreeArgs>
3411 BoundArg4, BoundArg5, FreeArgs...),
3418 BoundArg4, BoundArg5, FreeArgs...>{func,
3419 std::forward<Arg1>(arg1),
3420 std::forward<Arg2>(arg2),
3421 std::forward<Arg3>(arg3),
3422 std::forward<Arg4>(arg4),
3423 std::forward<Arg5>(arg5)};
3440 template <
class... FreeArgs>
3461 template <
class... FreeArgs>
3480 template <
class... FreeArgs>
3497 template <
class... FreeArgs>
3518 template <
class... FreeArgs>
3537 template <
class... FreeArgs>
3582 template <
class... FreeArgs,
class Lambda>
3584 typedef typename std::remove_const<typename std::remove_reference<Lambda>::type>::type LType;
3585 return new Callback_lambda<LType, FreeArgs...>{std::forward<Lambda>(l)};
3615 void post(
const Callback* cb, gint priority = G_PRIORITY_DEFAULT_IDLE,
3616 GMainContext* context = 0);
3662 gint priority = G_PRIORITY_DEFAULT_IDLE, GMainContext* context = 0);