39 #ifndef CGU_CALLBACK_H
40 #define CGU_CALLBACK_H
496 #include <functional>
500 #include <type_traits>
597 template <
class... FreeArgs>
637 #ifdef CGU_USE_GLIB_MEMORY_SLICES_NO_COMPAT
720 return std::unique_ptr<
const CallbackArg<T...>>(cb);
739 template <
class... T>
741 return (f1.cb_s.get() == f2.cb_s.get());
749 template <
class... T>
767 template <
class... T>
769 return std::less<
const CallbackArg<T...>*>()(f1.cb_s.get(), f2.cb_s.get());
777 template <
class... T>
779 return (f1.cb_s.get() == f2.cb_s.get());
787 template <
class... T>
800 template <
class... T>
802 return std::less<
const CallbackArg<T...>*>()(f1.cb_s.get(), f2.cb_s.get());
811 #ifndef DOXYGEN_PARSING
816 template <
class... T>
817 struct hash<
Cgu::Callback::FunctorArg<T...>> {
818 typedef std::size_t result_type;
820 result_type operator()(
const argument_type& f)
const {
827 template <
class... T>
828 struct hash<
Cgu::Callback::SafeFunctorArg<T...>> {
829 typedef std::size_t result_type;
831 result_type operator()(
const argument_type& f)
const {
840 #endif // DOXYGEN_PARSING
903 template <
class... FreeArgs>
905 SharedPtr<
const CallbackArg<FreeArgs...>> cb_s;
928 if (cb_s.get()) cb_s->dispatch(args...);
1025 template <
class... FreeArgs>
1026 class SafeFunctorArg {
1041 if (cb_s.get()) cb_s->dispatch(args...);
1155 template<
class... T>
1195 template<
class... T>
1202 template <
class T,
class... FreeArgs>
1211 (obj->*func)(free_args...);
1216 template <
bool unref,
class T,
class BoundArg,
class... FreeArgs>
1219 typedef void (T::*
MemFunc)(BoundArg, FreeArgs...);
1226 (obj->*func)(arg, free_args...);
1228 template <
class Arg>
1230 Arg&& arg_): obj(&obj_), func(func_), arg(std::forward<Arg>(arg_)) {}
1233 template <
bool unref,
class T,
class BoundArg1,
class BoundArg2,
class... FreeArgs>
1236 typedef void (T::*
MemFunc)(BoundArg1, BoundArg2, FreeArgs...);
1244 (obj->*func)(arg1, arg2, free_args...);
1246 template <
class Arg1,
class Arg2>
1249 Arg2&& arg2_): obj(&obj_), func(func_),
1250 arg1(std::forward<Arg1>(arg1_)),
1251 arg2(std::forward<Arg2>(arg2_)) {}
1254 template <
bool unref,
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
1257 typedef void (T::*
MemFunc)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...);
1266 (obj->*func)(arg1, arg2, arg3, free_args...);
1268 template <
class Arg1,
class Arg2,
class Arg3>
1273 obj(&obj_), func(func_),
1274 arg1(std::forward<Arg1>(arg1_)),
1275 arg2(std::forward<Arg2>(arg2_)),
1276 arg3(std::forward<Arg3>(arg3_)) {}
1279 template <
bool unref,
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
1280 class BoundArg4,
class... FreeArgs>
1283 typedef void (T::*
MemFunc)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, FreeArgs...);
1293 (obj->*func)(arg1, arg2, arg3, arg4, free_args...);
1295 template <
class Arg1,
class Arg2,
class Arg3,
class Arg4>
1301 obj(&obj_), func(func_),
1302 arg1(std::forward<Arg1>(arg1_)),
1303 arg2(std::forward<Arg2>(arg2_)),
1304 arg3(std::forward<Arg3>(arg3_)),
1305 arg4(std::forward<Arg4>(arg4_)) {}
1308 template <
bool unref,
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
1309 class BoundArg4,
class BoundArg5,
class... FreeArgs>
1312 typedef void (T::*
MemFunc)(BoundArg1, BoundArg2, BoundArg3,
1313 BoundArg4, BoundArg5, FreeArgs...);
1324 (obj->*func)(arg1, arg2, arg3, arg4, arg5, free_args...);
1326 template <
class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5>
1333 obj(&obj_), func(func_),
1334 arg1(std::forward<Arg1>(arg1_)),
1335 arg2(std::forward<Arg2>(arg2_)),
1336 arg3(std::forward<Arg3>(arg3_)),
1337 arg4(std::forward<Arg4>(arg4_)),
1338 arg5(std::forward<Arg5>(arg5_)) {}
1343 template <
class T,
class... FreeArgs>
1352 (obj->*func)(free_args...);
1357 template <
bool unref,
class T,
class BoundArg,
class... FreeArgs>
1360 typedef void (T::*
MemFunc)(BoundArg, FreeArgs...)
const;
1367 (obj->*func)(arg, free_args...);
1369 template <
class Arg>
1371 Arg&& arg_): obj(&obj_), func(func_), arg(std::forward<Arg>(arg_)) {}
1374 template <
bool unref,
class T,
class BoundArg1,
class BoundArg2,
class... FreeArgs>
1377 typedef void (T::*
MemFunc)(BoundArg1, BoundArg2, FreeArgs...)
const;
1385 (obj->*func)(arg1, arg2, free_args...);
1387 template <
class Arg1,
class Arg2>
1390 Arg2&& arg2_): obj(&obj_), func(func_),
1391 arg1(std::forward<Arg1>(arg1_)),
1392 arg2(std::forward<Arg2>(arg2_)) {}
1395 template <
bool unref,
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
1398 typedef void (T::*
MemFunc)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...)
const;
1407 (obj->*func)(arg1, arg2, arg3, free_args...);
1409 template <
class Arg1,
class Arg2,
class Arg3>
1414 obj(&obj_), func(func_),
1415 arg1(std::forward<Arg1>(arg1_)),
1416 arg2(std::forward<Arg2>(arg2_)),
1417 arg3(std::forward<Arg3>(arg3_)) {}
1420 template <
bool unref,
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
1421 class BoundArg4,
class... FreeArgs>
1424 typedef void (T::*
MemFunc)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, FreeArgs...)
const;
1434 (obj->*func)(arg1, arg2, arg3, arg4, free_args...);
1436 template <
class Arg1,
class Arg2,
class Arg3,
class Arg4>
1442 obj(&obj_), func(func_),
1443 arg1(std::forward<Arg1>(arg1_)),
1444 arg2(std::forward<Arg2>(arg2_)),
1445 arg3(std::forward<Arg3>(arg3_)),
1446 arg4(std::forward<Arg4>(arg4_)) {}
1449 template <
bool unref,
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
1450 class BoundArg4,
class BoundArg5,
class... FreeArgs>
1453 typedef void (T::*
MemFunc)(BoundArg1, BoundArg2, BoundArg3,
1454 BoundArg4, BoundArg5, FreeArgs...)
const;
1465 (obj->*func)(arg1, arg2, arg3, arg4, arg5, free_args...);
1467 template <
class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5>
1474 obj(&obj_), func(func_),
1475 arg1(std::forward<Arg1>(arg1_)),
1476 arg2(std::forward<Arg2>(arg2_)),
1477 arg3(std::forward<Arg3>(arg3_)),
1478 arg4(std::forward<Arg4>(arg4_)),
1479 arg5(std::forward<Arg5>(arg5_)) {}
1484 template <
class... FreeArgs>
1497 template <
bool unref,
class BoundArg,
class... FreeArgs>
1500 typedef void (*
Func)(BoundArg, FreeArgs...);
1506 func(arg, free_args...);
1508 template <
class Arg>
1512 template <
bool unref,
class BoundArg1,
class BoundArg2,
class... FreeArgs>
1515 typedef void (*
Func)(BoundArg1, BoundArg2, FreeArgs...);
1522 func(arg1, arg2, free_args...);
1524 template <
class Arg1,
class Arg2>
1526 Arg2&& arg2_): func(func_),
1527 arg1(std::forward<Arg1>(arg1_)),
1528 arg2(std::forward<Arg2>(arg2_)) {}
1531 template <
bool unref,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
1534 typedef void (*
Func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...);
1542 func(arg1, arg2, arg3, free_args...);
1544 template <
class Arg1,
class Arg2,
class Arg3>
1550 arg1(std::forward<Arg1>(arg1_)),
1551 arg2(std::forward<Arg2>(arg2_)),
1552 arg3(std::forward<Arg3>(arg3_)) {}
1555 template <
bool unref,
class BoundArg1,
class BoundArg2,
class BoundArg3,
1556 class BoundArg4,
class... FreeArgs>
1559 typedef void (*
Func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, FreeArgs...);
1568 func(arg1, arg2, arg3, arg4, free_args...);
1570 template <
class Arg1,
class Arg2,
class Arg3,
class Arg4>
1577 arg1(std::forward<Arg1>(arg1_)),
1578 arg2(std::forward<Arg2>(arg2_)),
1579 arg3(std::forward<Arg3>(arg3_)),
1580 arg4(std::forward<Arg4>(arg4_)) {}
1583 template <
bool unref,
class BoundArg1,
class BoundArg2,
class BoundArg3,
1584 class BoundArg4,
class BoundArg5,
class... FreeArgs>
1587 typedef void (*
Func)(BoundArg1, BoundArg2, BoundArg3,
1588 BoundArg4, BoundArg5, FreeArgs...);
1598 func(arg1, arg2, arg3, arg4, arg5, free_args...);
1600 template <
class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5>
1608 arg1(std::forward<Arg1>(arg1_)),
1609 arg2(std::forward<Arg2>(arg2_)),
1610 arg3(std::forward<Arg3>(arg3_)),
1611 arg4(std::forward<Arg4>(arg4_)),
1612 arg5(std::forward<Arg5>(arg5_)) {}
1623 template <
class... FreeArgs>
1625 std::function<void(FreeArgs...)> f;
1633 template <
class Lambda,
class... FreeArgs>
1658 template <
class T,
class... FreeArgs>
1660 void (T::*func)(FreeArgs...)) {
1661 return new Callback0<T, FreeArgs...>{t, func};
1676 template <
class T,
class... FreeArgs>
1678 void (T::*func)(FreeArgs...)) {
1679 return new Callback0<T, FreeArgs...>{t, func};
1694 template <
class T,
class... FreeArgs>
1696 void (T::*func)(FreeArgs...)) {
1697 return new Callback0<T, FreeArgs...>{t, func};
1711 template <
class T,
class BoundArg,
class... FreeArgs>
1713 void (T::*func)(BoundArg, FreeArgs...),
1715 return new Callback1<
false, T, BoundArg, FreeArgs...>{t, func, arg};
1735 template <
class T,
class BoundArg,
class... FreeArgs>
1737 void (T::*func)(BoundArg, FreeArgs...),
1738 const BoundArg& arg) {
1739 return new Callback1<
false, T, BoundArg, FreeArgs...>{t, func, arg};
1759 template <
class T,
class BoundArg,
class Arg,
class... FreeArgs>
1761 void (T::*func)(BoundArg, FreeArgs...),
1763 return new Callback1<
true, T, BoundArg, FreeArgs...>{t, func, std::forward<Arg>(arg)};
1777 template <
class T,
class BoundArg1,
class BoundArg2,
class... FreeArgs>
1779 void (T::*func)(BoundArg1, BoundArg2, FreeArgs...),
1782 return new Callback2<
false, T, BoundArg1, BoundArg2, FreeArgs...>{t, func, arg1, arg2};
1802 template <
class T,
class BoundArg1,
class BoundArg2,
class... FreeArgs>
1804 void (T::*func)(BoundArg1, BoundArg2, FreeArgs...),
1805 const BoundArg1& arg1,
1806 const BoundArg2& arg2) {
1807 return new Callback2<
false, T, BoundArg1, BoundArg2, FreeArgs...>{t, func, arg1, arg2};
1827 template <
class T,
class BoundArg1,
class BoundArg2,
1828 class Arg1,
class Arg2,
class... FreeArgs>
1830 void (T::*func)(BoundArg1, BoundArg2, FreeArgs...),
1833 return new Callback2<
true, T, BoundArg1, BoundArg2, FreeArgs...>{t, func,
1834 std::forward<Arg1>(arg1),
1835 std::forward<Arg2>(arg2)};
1849 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
1851 void (T::*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...),
1855 return new Callback3<
false, T, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{t, func, arg1, arg2, arg3};
1875 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
1877 void (T::*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...),
1878 const BoundArg1& arg1,
1879 const BoundArg2& arg2,
1880 const BoundArg3& arg3) {
1881 return new Callback3<
false, T, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{t, func, arg1, arg2, arg3};
1901 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
1902 class Arg1,
class Arg2,
class Arg3,
class... FreeArgs>
1904 void (T::*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...),
1908 return new Callback3<
true, T, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{t, func,
1909 std::forward<Arg1>(arg1),
1910 std::forward<Arg2>(arg2),
1911 std::forward<Arg3>(arg3)};
1925 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
1926 class BoundArg4,
class... FreeArgs>
1928 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
1929 BoundArg4, FreeArgs...),
1934 return new Callback4<
false, T, BoundArg1, BoundArg2, BoundArg3,
1935 BoundArg4, FreeArgs...>{t, func, arg1, arg2, arg3, arg4};
1955 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
1956 class BoundArg4,
class... FreeArgs>
1958 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
1959 BoundArg4, FreeArgs...),
1960 const BoundArg1& arg1,
1961 const BoundArg2& arg2,
1962 const BoundArg3& arg3,
1963 const BoundArg4& arg4) {
1964 return new Callback4<
false, T, BoundArg1, BoundArg2, BoundArg3,
1965 BoundArg4, FreeArgs...>{t, func, arg1, arg2, arg3, arg4};
1985 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
1986 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class... FreeArgs>
1988 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
1989 BoundArg4, FreeArgs...),
1994 return new Callback4<
true, T, BoundArg1, BoundArg2, BoundArg3,
1995 BoundArg4, FreeArgs...>{t, func,
1996 std::forward<Arg1>(arg1),
1997 std::forward<Arg2>(arg2),
1998 std::forward<Arg3>(arg3),
1999 std::forward<Arg4>(arg4)};
2013 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2014 class BoundArg4,
class BoundArg5,
class... FreeArgs>
2016 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2017 BoundArg4, BoundArg5, FreeArgs...),
2023 return new Callback5<
false, T, BoundArg1, BoundArg2, BoundArg3,
2024 BoundArg4, BoundArg5, FreeArgs...>{t, func, arg1, arg2, arg3, arg4, arg5};
2044 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2045 class BoundArg4,
class BoundArg5,
class... FreeArgs>
2047 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2048 BoundArg4, BoundArg5, FreeArgs...),
2049 const BoundArg1& arg1,
2050 const BoundArg2& arg2,
2051 const BoundArg3& arg3,
2052 const BoundArg4& arg4,
2053 const BoundArg5& arg5) {
2054 return new Callback5<
false, T, BoundArg1, BoundArg2, BoundArg3,
2055 BoundArg4, BoundArg5, FreeArgs...>{t, func, arg1, arg2, arg3, arg4, arg5};
2075 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
class BoundArg5,
2076 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5,
class... FreeArgs>
2078 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2079 BoundArg4, BoundArg5, FreeArgs...),
2085 return new Callback5<
true, T, BoundArg1, BoundArg2, BoundArg3,
2086 BoundArg4, BoundArg5, FreeArgs...>{t, func,
2087 std::forward<Arg1>(arg1),
2088 std::forward<Arg2>(arg2),
2089 std::forward<Arg3>(arg3),
2090 std::forward<Arg4>(arg4),
2091 std::forward<Arg5>(arg5)};
2105 template <
class T,
class... FreeArgs>
2107 void (T::*func)(FreeArgs...)
const) {
2123 template <
class T,
class... FreeArgs>
2125 void (T::*func)(FreeArgs...)
const) {
2141 template <
class T,
class... FreeArgs>
2143 void (T::*func)(FreeArgs...)
const) {
2158 template <
class T,
class BoundArg,
class... FreeArgs>
2160 void (T::*func)(BoundArg, FreeArgs...)
const,
2162 return new Callback1_const<
false, T, BoundArg, FreeArgs...>{t, func, arg};
2182 template <
class T,
class BoundArg,
class... FreeArgs>
2184 void (T::*func)(BoundArg, FreeArgs...)
const,
2185 const BoundArg& arg) {
2186 return new Callback1_const<
false, T, BoundArg, FreeArgs...>{t, func, arg};
2206 template <
class T,
class BoundArg,
class Arg,
class... FreeArgs>
2208 void (T::*func)(BoundArg, FreeArgs...)
const,
2210 return new Callback1_const<
true, T, BoundArg, FreeArgs...>{t, func, std::forward<Arg>(arg)};
2224 template <
class T,
class BoundArg1,
class BoundArg2,
class... FreeArgs>
2226 void (T::*func)(BoundArg1, BoundArg2, FreeArgs...)
const,
2229 return new Callback2_const<
false, T, BoundArg1, BoundArg2, FreeArgs...>{t, func, arg1, arg2};
2249 template <
class T,
class BoundArg1,
class BoundArg2,
class... FreeArgs>
2251 void (T::*func)(BoundArg1, BoundArg2, FreeArgs...)
const,
2252 const BoundArg1& arg1,
2253 const BoundArg2& arg2) {
2254 return new Callback2_const<
false, T, BoundArg1, BoundArg2, FreeArgs...>{t, func, arg1, arg2};
2274 template <
class T,
class BoundArg1,
class BoundArg2,
2275 class Arg1,
class Arg2,
class... FreeArgs>
2277 void (T::*func)(BoundArg1, BoundArg2, FreeArgs...)
const,
2280 return new Callback2_const<
true, T, BoundArg1, BoundArg2, FreeArgs...>{t, func,
2281 std::forward<Arg1>(arg1),
2282 std::forward<Arg2>(arg2)};
2296 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
2298 void (T::*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...)
const,
2302 return new Callback3_const<
false, T, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{t, func, arg1, arg2, arg3};
2322 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
2324 void (T::*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...)
const,
2325 const BoundArg1& arg1,
2326 const BoundArg2& arg2,
2327 const BoundArg3& arg3) {
2328 return new Callback3_const<
false, T, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{t, func, arg1, arg2, arg3};
2348 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2349 class Arg1,
class Arg2,
class Arg3,
class... FreeArgs>
2351 void (T::*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...)
const,
2355 return new Callback3_const<
true, T, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{t, func,
2356 std::forward<Arg1>(arg1),
2357 std::forward<Arg2>(arg2),
2358 std::forward<Arg3>(arg3)};
2372 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2373 class BoundArg4,
class... FreeArgs>
2375 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2376 BoundArg4, FreeArgs...)
const,
2382 BoundArg4, FreeArgs...>{t, func, arg1, arg2, arg3, arg4};
2402 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2403 class BoundArg4,
class... FreeArgs>
2405 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2406 BoundArg4, FreeArgs...)
const,
2407 const BoundArg1& arg1,
2408 const BoundArg2& arg2,
2409 const BoundArg3& arg3,
2410 const BoundArg4& arg4) {
2412 BoundArg4, FreeArgs...>{t, func, arg1, arg2, arg3, arg4};
2432 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
2433 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class... FreeArgs>
2435 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2436 BoundArg4, FreeArgs...)
const,
2442 BoundArg4, FreeArgs...>{t, func,
2443 std::forward<Arg1>(arg1),
2444 std::forward<Arg2>(arg2),
2445 std::forward<Arg3>(arg3),
2446 std::forward<Arg4>(arg4)};
2460 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2461 class BoundArg4,
class BoundArg5,
class... FreeArgs>
2463 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2464 BoundArg4, BoundArg5, FreeArgs...)
const,
2471 BoundArg4, BoundArg5, FreeArgs...>{t, func, arg1, arg2, arg3, arg4, arg5};
2491 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2492 class BoundArg4,
class BoundArg5,
class... FreeArgs>
2494 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2495 BoundArg4, BoundArg5, FreeArgs...)
const,
2496 const BoundArg1& arg1,
2497 const BoundArg2& arg2,
2498 const BoundArg3& arg3,
2499 const BoundArg4& arg4,
2500 const BoundArg5& arg5) {
2502 BoundArg4, BoundArg5, FreeArgs...>{t, func, arg1, arg2, arg3, arg4, arg5};
2522 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
class BoundArg5,
2523 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5,
class... FreeArgs>
2525 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2526 BoundArg4, BoundArg5, FreeArgs...)
const,
2533 BoundArg4, BoundArg5, FreeArgs...>{t, func,
2534 std::forward<Arg1>(arg1),
2535 std::forward<Arg2>(arg2),
2536 std::forward<Arg3>(arg3),
2537 std::forward<Arg4>(arg4),
2538 std::forward<Arg5>(arg5)};
2552 template <
class... FreeArgs>
2569 template <
class... FreeArgs>
2586 template <
class... FreeArgs>
2602 template <
class BoundArg,
class... FreeArgs>
2625 template <
class BoundArg,
class... FreeArgs>
2627 const BoundArg& arg) {
2648 template <
class BoundArg,
class Arg,
class... FreeArgs>
2651 return new Callback1_static<
true, BoundArg, FreeArgs...>{func, std::forward<Arg>(arg)};
2665 template <
class BoundArg1,
class BoundArg2,
class... FreeArgs>
2669 return new Callback2_static<
false, BoundArg1, BoundArg2, FreeArgs...>{func, arg1, arg2};
2689 template <
class BoundArg1,
class BoundArg2,
class... FreeArgs>
2691 const BoundArg1& arg1,
2692 const BoundArg2& arg2) {
2693 return new Callback2_static<
false, BoundArg1, BoundArg2, FreeArgs...>{func, arg1, arg2};
2713 template <
class BoundArg1,
class BoundArg2,
class Arg1,
class Arg2,
class... FreeArgs>
2718 std::forward<Arg1>(arg1),
2719 std::forward<Arg2>(arg2)};
2733 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
2734 CallbackArg<FreeArgs...>*
make(
void (*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...),
2738 return new Callback3_static<
false, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{func, arg1, arg2, arg3};
2758 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
2760 const BoundArg1& arg1,
2761 const BoundArg2& arg2,
2762 const BoundArg3& arg3) {
2763 return new Callback3_static<
false, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{func, arg1, arg2, arg3};
2783 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
2784 class Arg1,
class Arg2,
class Arg3,
class... FreeArgs>
2789 return new Callback3_static<
true, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{func,
2790 std::forward<Arg1>(arg1),
2791 std::forward<Arg2>(arg2),
2792 std::forward<Arg3>(arg3)};
2806 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
2807 class BoundArg4,
class... FreeArgs>
2809 BoundArg4, FreeArgs...),
2815 BoundArg4, FreeArgs...>{func, arg1, arg2, arg3, arg4};
2835 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
2836 class BoundArg4,
class... FreeArgs>
2838 BoundArg4, FreeArgs...),
2839 const BoundArg1& arg1,
2840 const BoundArg2& arg2,
2841 const BoundArg3& arg3,
2842 const BoundArg4& arg4) {
2844 BoundArg4, FreeArgs...>{func, arg1, arg2, arg3, arg4};
2864 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
2865 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class... FreeArgs>
2867 BoundArg4, FreeArgs...),
2873 BoundArg4, FreeArgs...>{func,
2874 std::forward<Arg1>(arg1),
2875 std::forward<Arg2>(arg2),
2876 std::forward<Arg3>(arg3),
2877 std::forward<Arg4>(arg4)};
2891 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
2892 class BoundArg4,
class BoundArg5,
class... FreeArgs>
2894 BoundArg4, BoundArg5, FreeArgs...),
2901 BoundArg4, BoundArg5, FreeArgs...>{func, arg1, arg2, arg3, arg4, arg5};
2921 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
2922 class BoundArg4,
class BoundArg5,
class... FreeArgs>
2924 BoundArg4, BoundArg5, FreeArgs...),
2925 const BoundArg1& arg1,
2926 const BoundArg2& arg2,
2927 const BoundArg3& arg3,
2928 const BoundArg4& arg4,
2929 const BoundArg5& arg5) {
2931 BoundArg4, BoundArg5, FreeArgs...>{func, arg1, arg2, arg3, arg4, arg5};
2951 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
class BoundArg5,
2952 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5,
class... FreeArgs>
2954 BoundArg4, BoundArg5, FreeArgs...),
2961 BoundArg4, BoundArg5, FreeArgs...>{func,
2962 std::forward<Arg1>(arg1),
2963 std::forward<Arg2>(arg2),
2964 std::forward<Arg3>(arg3),
2965 std::forward<Arg4>(arg4),
2966 std::forward<Arg5>(arg5)};
2983 template <
class... FreeArgs>
3004 template <
class... FreeArgs>
3023 template <
class... FreeArgs>
3040 template <
class... FreeArgs>
3061 template <
class... FreeArgs>
3080 template <
class... FreeArgs>
3125 template <
class... FreeArgs,
class Lambda>
3127 typedef typename std::remove_const<typename std::remove_reference<Lambda>::type>::type LType;
3128 return new Callback_lambda<LType, FreeArgs...>{std::forward<Lambda>(l)};
3161 void post(
const Callback* cb, gint priority = G_PRIORITY_DEFAULT_IDLE,
3162 GMainContext* context = 0);
3213 gint priority = G_PRIORITY_DEFAULT_IDLE, GMainContext* context = 0);