39 #ifndef CGU_CALLBACK_H
40 #define CGU_CALLBACK_H
536 #include <functional>
540 #include <type_traits>
649 template <
class... FreeArgs>
689 #ifdef CGU_USE_GLIB_MEMORY_SLICES_NO_COMPAT
778 return std::unique_ptr<
const CallbackArg<T...>>(cb);
797 template <
class... T>
799 return (f1.cb_s.get() == f2.cb_s.get());
807 template <
class... T>
825 template <
class... T>
827 return std::less<
const CallbackArg<T...>*>()(f1.cb_s.get(), f2.cb_s.get());
835 template <
class... T>
837 return (f1.cb_s.get() == f2.cb_s.get());
845 template <
class... T>
858 template <
class... T>
860 return std::less<
const CallbackArg<T...>*>()(f1.cb_s.get(), f2.cb_s.get());
869 #ifndef DOXYGEN_PARSING
874 template <
class... T>
875 struct hash<
Cgu::Callback::FunctorArg<T...>> {
876 typedef std::size_t result_type;
878 result_type operator()(
const argument_type& f)
const {
885 template <
class... T>
886 struct hash<
Cgu::Callback::SafeFunctorArg<T...>> {
887 typedef std::size_t result_type;
889 result_type operator()(
const argument_type& f)
const {
898 #endif // DOXYGEN_PARSING
961 template <
class... FreeArgs>
963 SharedPtr<
const CallbackArg<FreeArgs...>> cb_s;
986 if (cb_s.get()) cb_s->dispatch(args...);
1018 friend
bool operator< <>(const
FunctorArg&, const FunctorArg&);
1020 friend struct
std::hash<FunctorArg>;
1085 template <
class... FreeArgs>
1086 class SafeFunctorArg {
1101 if (cb_s.get()) cb_s->dispatch(args...);
1133 friend
bool operator< <>(const
SafeFunctorArg&, const SafeFunctorArg&);
1135 friend struct
std::hash<SafeFunctorArg>;
1217 template<
class... T>
1257 template<
class... T>
1265 template <
class Lambda,
class... FreeArgs>
1275 #if defined(DOXYGEN_PARSING) || defined(CGU_USE_TUPLE)
1278 template <
class T,
class MemFunc,
class Tuple,
class... FreeArgs>
1288 template <
class... Args>
1290 obj(&obj_), func(func_), tuple(
std::forward<Args>(args)...) {}
1297 template <
class T,
class MemFunc,
class... FreeArgs>
1303 (obj->*func)(free_args...);
1310 template <
class Func,
class Tuple,
class... FreeArgs>
1319 template <
class... Args>
1321 func(func_), tuple(
std::forward<Args>(args)...) {}
1339 template <
class T,
class... FreeArgs>
1341 void (T::*func)(FreeArgs...)) {
1357 template <
class T,
class... FreeArgs>
1359 void (T::*func)(FreeArgs...)) {
1374 template <
class T,
class BoundArg,
class... FreeArgs>
1376 void (T::*func)(BoundArg, FreeArgs...),
1378 typedef std::tuple<BoundArg> Tuple;
1400 template <
class T,
class BoundArg,
class Arg,
class... FreeArgs>
1402 void (T::*func)(BoundArg, FreeArgs...),
1404 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg>::type>::type> Tuple;
1406 {t, func, std::forward<Arg>(arg)};
1420 template <
class T,
class BoundArg1,
class BoundArg2,
class... FreeArgs>
1422 void (T::*func)(BoundArg1, BoundArg2, FreeArgs...),
1425 typedef std::tuple<BoundArg1, BoundArg2> Tuple;
1427 {t, func, arg1, arg2};
1447 template <
class T,
class BoundArg1,
class BoundArg2,
1448 class Arg1,
class Arg2,
class... FreeArgs>
1450 void (T::*func)(BoundArg1, BoundArg2, FreeArgs...),
1453 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
1454 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type> Tuple;
1456 {t, func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2)};
1470 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
1472 void (T::*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...),
1476 typedef std::tuple<BoundArg1, BoundArg2, BoundArg3> Tuple;
1478 {t, func, arg1, arg2, arg3};
1498 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
1499 class Arg1,
class Arg2,
class Arg3,
class... FreeArgs>
1501 void (T::*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...),
1505 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
1506 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type,
1507 typename std::remove_const<typename std::remove_reference<BoundArg3>::type>::type> Tuple;
1509 {t, func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2), std::forward<Arg3>(arg3)};
1523 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
1524 class BoundArg4,
class... FreeArgs>
1526 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
1527 BoundArg4, FreeArgs...),
1532 typedef std::tuple<BoundArg1, BoundArg2, BoundArg3, BoundArg4> Tuple;
1534 {t, func, arg1, arg2, arg3, arg4};
1554 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
1555 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class... FreeArgs>
1557 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
1558 BoundArg4, FreeArgs...),
1563 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
1564 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type,
1565 typename std::remove_const<typename std::remove_reference<BoundArg3>::type>::type,
1566 typename std::remove_const<typename std::remove_reference<BoundArg4>::type>::type> Tuple;
1568 {t, func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2),
1569 std::forward<Arg3>(arg3), std::forward<Arg4>(arg4)};
1583 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
1584 class BoundArg4,
class BoundArg5,
class... FreeArgs>
1586 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
1587 BoundArg4, BoundArg5, FreeArgs...),
1593 typedef std::tuple<BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5> Tuple;
1595 {t, func, arg1, arg2, arg3, arg4, arg5};
1615 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
class BoundArg5,
1616 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5,
class... FreeArgs>
1618 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
1619 BoundArg4, BoundArg5, FreeArgs...),
1625 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
1626 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type,
1627 typename std::remove_const<typename std::remove_reference<BoundArg3>::type>::type,
1628 typename std::remove_const<typename std::remove_reference<BoundArg4>::type>::type,
1629 typename std::remove_const<typename std::remove_reference<BoundArg5>::type>::type> Tuple;
1631 {t, func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2), std::forward<Arg3>(arg3),
1632 std::forward<Arg4>(arg4), std::forward<Arg5>(arg5)};
1653 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
1654 class BoundArg4,
class BoundArg5,
class BoundArg6,
class... FreeArgs>
1656 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
1657 BoundArg4, BoundArg5, BoundArg6,
1665 typedef std::tuple<BoundArg1, BoundArg2, BoundArg3, BoundArg4,
1666 BoundArg5, BoundArg6> Tuple;
1668 {t, func, arg1, arg2, arg3, arg4, arg5, arg6};
1693 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
1694 class BoundArg5,
class BoundArg6,
class Arg1,
class Arg2,
class Arg3,
class Arg4,
1695 class Arg5,
class Arg6,
class... FreeArgs>
1697 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
1698 BoundArg4, BoundArg5, BoundArg6,
1706 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
1707 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type,
1708 typename std::remove_const<typename std::remove_reference<BoundArg3>::type>::type,
1709 typename std::remove_const<typename std::remove_reference<BoundArg4>::type>::type,
1710 typename std::remove_const<typename std::remove_reference<BoundArg5>::type>::type,
1711 typename std::remove_const<typename std::remove_reference<BoundArg6>::type>::type> Tuple;
1713 {t, func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2), std::forward<Arg3>(arg3),
1714 std::forward<Arg4>(arg4), std::forward<Arg5>(arg5), std::forward<Arg6>(arg6)};
1735 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
1736 class BoundArg4,
class BoundArg5,
class BoundArg6,
class BoundArg7,
1739 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
1740 BoundArg4, BoundArg5, BoundArg6,
1741 BoundArg7, FreeArgs...),
1749 typedef std::tuple<BoundArg1, BoundArg2, BoundArg3, BoundArg4,
1750 BoundArg5, BoundArg6, BoundArg7> Tuple;
1752 {t, func, arg1, arg2, arg3, arg4, arg5, arg6, arg7};
1777 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
1778 class BoundArg5,
class BoundArg6,
class BoundArg7,
class Arg1,
class Arg2,
1779 class Arg3,
class Arg4,
class Arg5,
class Arg6,
class Arg7,
class... FreeArgs>
1781 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
1782 BoundArg4, BoundArg5, BoundArg6,
1783 BoundArg7, FreeArgs...),
1791 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
1792 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type,
1793 typename std::remove_const<typename std::remove_reference<BoundArg3>::type>::type,
1794 typename std::remove_const<typename std::remove_reference<BoundArg4>::type>::type,
1795 typename std::remove_const<typename std::remove_reference<BoundArg5>::type>::type,
1796 typename std::remove_const<typename std::remove_reference<BoundArg6>::type>::type,
1797 typename std::remove_const<typename std::remove_reference<BoundArg7>::type>::type> Tuple;
1799 {t, func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2), std::forward<Arg3>(arg3),
1800 std::forward<Arg4>(arg4), std::forward<Arg5>(arg5), std::forward<Arg6>(arg6),
1801 std::forward<Arg7>(arg7)};
1822 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
1823 class BoundArg4,
class BoundArg5,
class BoundArg6,
class BoundArg7,
1824 class BoundArg8,
class... FreeArgs>
1826 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
1827 BoundArg4, BoundArg5, BoundArg6,
1828 BoundArg7, BoundArg8, FreeArgs...),
1837 typedef std::tuple<BoundArg1, BoundArg2, BoundArg3, BoundArg4,
1838 BoundArg5, BoundArg6, BoundArg7, BoundArg8> Tuple;
1840 {t, func, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8};
1865 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
1866 class BoundArg5,
class BoundArg6,
class BoundArg7,
class BoundArg8,
class Arg1,
1867 class Arg2,
class Arg3,
class Arg4,
class Arg5,
class Arg6,
class Arg7,
class Arg8,
1870 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
1871 BoundArg4, BoundArg5, BoundArg6,
1872 BoundArg7, BoundArg8, FreeArgs...),
1881 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
1882 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type,
1883 typename std::remove_const<typename std::remove_reference<BoundArg3>::type>::type,
1884 typename std::remove_const<typename std::remove_reference<BoundArg4>::type>::type,
1885 typename std::remove_const<typename std::remove_reference<BoundArg5>::type>::type,
1886 typename std::remove_const<typename std::remove_reference<BoundArg6>::type>::type,
1887 typename std::remove_const<typename std::remove_reference<BoundArg7>::type>::type,
1888 typename std::remove_const<typename std::remove_reference<BoundArg8>::type>::type> Tuple;
1890 {t, func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2), std::forward<Arg3>(arg3),
1891 std::forward<Arg4>(arg4), std::forward<Arg5>(arg5), std::forward<Arg6>(arg6),
1892 std::forward<Arg7>(arg7), std::forward<Arg8>(arg8)};
1913 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
1914 class BoundArg4,
class BoundArg5,
class BoundArg6,
class BoundArg7,
1915 class BoundArg8,
class BoundArg9,
class... FreeArgs>
1917 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
1918 BoundArg4, BoundArg5, BoundArg6,
1919 BoundArg7, BoundArg8, BoundArg9,
1930 typedef std::tuple<BoundArg1, BoundArg2, BoundArg3, BoundArg4,
1931 BoundArg5, BoundArg6, BoundArg7, BoundArg8,
1934 {t, func, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9};
1959 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
1960 class BoundArg5,
class BoundArg6,
class BoundArg7,
class BoundArg8,
class BoundArg9,
1961 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5,
class Arg6,
class Arg7,
1962 class Arg8,
class Arg9,
class... FreeArgs>
1964 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
1965 BoundArg4, BoundArg5, BoundArg6,
1966 BoundArg7, BoundArg8, BoundArg9,
1977 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
1978 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type,
1979 typename std::remove_const<typename std::remove_reference<BoundArg3>::type>::type,
1980 typename std::remove_const<typename std::remove_reference<BoundArg4>::type>::type,
1981 typename std::remove_const<typename std::remove_reference<BoundArg5>::type>::type,
1982 typename std::remove_const<typename std::remove_reference<BoundArg6>::type>::type,
1983 typename std::remove_const<typename std::remove_reference<BoundArg7>::type>::type,
1984 typename std::remove_const<typename std::remove_reference<BoundArg8>::type>::type,
1985 typename std::remove_const<typename std::remove_reference<BoundArg9>::type>::type> Tuple;
1987 {t, func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2), std::forward<Arg3>(arg3),
1988 std::forward<Arg4>(arg4), std::forward<Arg5>(arg5), std::forward<Arg6>(arg6),
1989 std::forward<Arg7>(arg7), std::forward<Arg8>(arg8), std::forward<Arg9>(arg9)};
2010 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2011 class BoundArg4,
class BoundArg5,
class BoundArg6,
class BoundArg7,
2012 class BoundArg8,
class BoundArg9,
class BoundArg10,
class... FreeArgs>
2014 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2015 BoundArg4, BoundArg5, BoundArg6,
2016 BoundArg7, BoundArg8, BoundArg9,
2017 BoundArg10, FreeArgs...),
2028 typedef std::tuple<BoundArg1, BoundArg2, BoundArg3, BoundArg4,
2029 BoundArg5, BoundArg6, BoundArg7, BoundArg8,
2030 BoundArg9, BoundArg10> Tuple;
2032 {t, func, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10};
2057 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
2058 class BoundArg5,
class BoundArg6,
class BoundArg7,
class BoundArg8,
class BoundArg9,
2059 class BoundArg10,
class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5,
class Arg6,
2060 class Arg7,
class Arg8,
class Arg9,
class Arg10,
class... FreeArgs>
2062 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2063 BoundArg4, BoundArg5, BoundArg6,
2064 BoundArg7, BoundArg8, BoundArg9,
2065 BoundArg10, FreeArgs...),
2076 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
2077 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type,
2078 typename std::remove_const<typename std::remove_reference<BoundArg3>::type>::type,
2079 typename std::remove_const<typename std::remove_reference<BoundArg4>::type>::type,
2080 typename std::remove_const<typename std::remove_reference<BoundArg5>::type>::type,
2081 typename std::remove_const<typename std::remove_reference<BoundArg6>::type>::type,
2082 typename std::remove_const<typename std::remove_reference<BoundArg7>::type>::type,
2083 typename std::remove_const<typename std::remove_reference<BoundArg8>::type>::type,
2084 typename std::remove_const<typename std::remove_reference<BoundArg9>::type>::type,
2085 typename std::remove_const<typename std::remove_reference<BoundArg10>::type>::type> Tuple;
2087 {t, func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2), std::forward<Arg3>(arg3),
2088 std::forward<Arg4>(arg4), std::forward<Arg5>(arg5), std::forward<Arg6>(arg6),
2089 std::forward<Arg7>(arg7), std::forward<Arg8>(arg8), std::forward<Arg9>(arg9),
2090 std::forward<Arg10>(arg10)};
2104 template <
class T,
class... FreeArgs>
2106 void (T::*func)(FreeArgs...)
const) {
2107 return new Callback_memfun<
const T, decltype(func), FreeArgs...>{t, func};
2122 template <
class T,
class... FreeArgs>
2124 void (T::*func)(FreeArgs...)
const) {
2125 return new Callback_memfun<
const T, decltype(func), FreeArgs...>{t, func};
2139 template <
class T,
class BoundArg,
class... FreeArgs>
2141 void (T::*func)(BoundArg, FreeArgs...)
const,
2143 typedef std::tuple<BoundArg> Tuple;
2165 template <
class T,
class BoundArg,
class Arg,
class... FreeArgs>
2167 void (T::*func)(BoundArg, FreeArgs...)
const,
2169 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg>::type>::type> Tuple;
2171 {t, func, std::forward<Arg>(arg)};
2185 template <
class T,
class BoundArg1,
class BoundArg2,
class... FreeArgs>
2187 void (T::*func)(BoundArg1, BoundArg2, FreeArgs...)
const,
2190 typedef std::tuple<BoundArg1, BoundArg2> Tuple;
2192 {t, func, arg1, arg2};
2212 template <
class T,
class BoundArg1,
class BoundArg2,
2213 class Arg1,
class Arg2,
class... FreeArgs>
2215 void (T::*func)(BoundArg1, BoundArg2, FreeArgs...)
const,
2218 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
2219 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type> Tuple;
2221 {t, func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2)};
2235 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
2237 void (T::*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...)
const,
2241 typedef std::tuple<BoundArg1, BoundArg2, BoundArg3> Tuple;
2243 {t, func, arg1, arg2, arg3};
2263 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2264 class Arg1,
class Arg2,
class Arg3,
class... FreeArgs>
2266 void (T::*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...)
const,
2270 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
2271 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type,
2272 typename std::remove_const<typename std::remove_reference<BoundArg3>::type>::type> Tuple;
2274 {t, func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2), std::forward<Arg3>(arg3)};
2288 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2289 class BoundArg4,
class... FreeArgs>
2291 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2292 BoundArg4, FreeArgs...)
const,
2297 typedef std::tuple<BoundArg1, BoundArg2, BoundArg3, BoundArg4> Tuple;
2299 {t, func, arg1, arg2, arg3, arg4};
2319 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
2320 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class... FreeArgs>
2322 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2323 BoundArg4, FreeArgs...)
const,
2328 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
2329 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type,
2330 typename std::remove_const<typename std::remove_reference<BoundArg3>::type>::type,
2331 typename std::remove_const<typename std::remove_reference<BoundArg4>::type>::type> Tuple;
2333 {t, func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2),
2334 std::forward<Arg3>(arg3), std::forward<Arg4>(arg4)};
2348 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2349 class BoundArg4,
class BoundArg5,
class... FreeArgs>
2351 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2352 BoundArg4, BoundArg5, FreeArgs...)
const,
2358 typedef std::tuple<BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5> Tuple;
2360 {t, func, arg1, arg2, arg3, arg4, arg5};
2380 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
class BoundArg5,
2381 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5,
class... FreeArgs>
2383 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2384 BoundArg4, BoundArg5, FreeArgs...)
const,
2390 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
2391 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type,
2392 typename std::remove_const<typename std::remove_reference<BoundArg3>::type>::type,
2393 typename std::remove_const<typename std::remove_reference<BoundArg4>::type>::type,
2394 typename std::remove_const<typename std::remove_reference<BoundArg5>::type>::type> Tuple;
2396 {t, func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2), std::forward<Arg3>(arg3),
2397 std::forward<Arg4>(arg4), std::forward<Arg5>(arg5)};
2418 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2419 class BoundArg4,
class BoundArg5,
class BoundArg6,
class... FreeArgs>
2421 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2422 BoundArg4, BoundArg5, BoundArg6,
2430 typedef std::tuple<BoundArg1, BoundArg2, BoundArg3, BoundArg4,
2431 BoundArg5, BoundArg6> Tuple;
2433 {t, func, arg1, arg2, arg3, arg4, arg5, arg6};
2458 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
2459 class BoundArg5,
class BoundArg6,
class Arg1,
class Arg2,
class Arg3,
class Arg4,
2460 class Arg5,
class Arg6,
class... FreeArgs>
2462 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2463 BoundArg4, BoundArg5, BoundArg6,
2471 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
2472 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type,
2473 typename std::remove_const<typename std::remove_reference<BoundArg3>::type>::type,
2474 typename std::remove_const<typename std::remove_reference<BoundArg4>::type>::type,
2475 typename std::remove_const<typename std::remove_reference<BoundArg5>::type>::type,
2476 typename std::remove_const<typename std::remove_reference<BoundArg6>::type>::type> Tuple;
2478 {t, func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2), std::forward<Arg3>(arg3),
2479 std::forward<Arg4>(arg4), std::forward<Arg5>(arg5), std::forward<Arg6>(arg6)};
2500 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2501 class BoundArg4,
class BoundArg5,
class BoundArg6,
class BoundArg7,
2504 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2505 BoundArg4, BoundArg5, BoundArg6,
2506 BoundArg7, FreeArgs...)
const,
2514 typedef std::tuple<BoundArg1, BoundArg2, BoundArg3, BoundArg4,
2515 BoundArg5, BoundArg6, BoundArg7> Tuple;
2517 {t, func, arg1, arg2, arg3, arg4, arg5, arg6, arg7};
2542 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
2543 class BoundArg5,
class BoundArg6,
class BoundArg7,
class Arg1,
class Arg2,
2544 class Arg3,
class Arg4,
class Arg5,
class Arg6,
class Arg7,
class... FreeArgs>
2546 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2547 BoundArg4, BoundArg5, BoundArg6,
2548 BoundArg7, FreeArgs...)
const,
2556 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
2557 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type,
2558 typename std::remove_const<typename std::remove_reference<BoundArg3>::type>::type,
2559 typename std::remove_const<typename std::remove_reference<BoundArg4>::type>::type,
2560 typename std::remove_const<typename std::remove_reference<BoundArg5>::type>::type,
2561 typename std::remove_const<typename std::remove_reference<BoundArg6>::type>::type,
2562 typename std::remove_const<typename std::remove_reference<BoundArg7>::type>::type> Tuple;
2564 {t, func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2), std::forward<Arg3>(arg3),
2565 std::forward<Arg4>(arg4), std::forward<Arg5>(arg5), std::forward<Arg6>(arg6),
2566 std::forward<Arg7>(arg7)};
2587 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2588 class BoundArg4,
class BoundArg5,
class BoundArg6,
class BoundArg7,
2589 class BoundArg8,
class... FreeArgs>
2591 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2592 BoundArg4, BoundArg5, BoundArg6,
2593 BoundArg7, BoundArg8, FreeArgs...)
const,
2602 typedef std::tuple<BoundArg1, BoundArg2, BoundArg3, BoundArg4,
2603 BoundArg5, BoundArg6, BoundArg7, BoundArg8> Tuple;
2605 {t, func, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8};
2630 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
2631 class BoundArg5,
class BoundArg6,
class BoundArg7,
class BoundArg8,
class Arg1,
2632 class Arg2,
class Arg3,
class Arg4,
class Arg5,
class Arg6,
class Arg7,
class Arg8,
2635 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2636 BoundArg4, BoundArg5, BoundArg6,
2637 BoundArg7, BoundArg8, FreeArgs...)
const,
2646 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
2647 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type,
2648 typename std::remove_const<typename std::remove_reference<BoundArg3>::type>::type,
2649 typename std::remove_const<typename std::remove_reference<BoundArg4>::type>::type,
2650 typename std::remove_const<typename std::remove_reference<BoundArg5>::type>::type,
2651 typename std::remove_const<typename std::remove_reference<BoundArg6>::type>::type,
2652 typename std::remove_const<typename std::remove_reference<BoundArg7>::type>::type,
2653 typename std::remove_const<typename std::remove_reference<BoundArg8>::type>::type> Tuple;
2655 {t, func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2), std::forward<Arg3>(arg3),
2656 std::forward<Arg4>(arg4), std::forward<Arg5>(arg5), std::forward<Arg6>(arg6),
2657 std::forward<Arg7>(arg7), std::forward<Arg8>(arg8)};
2678 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2679 class BoundArg4,
class BoundArg5,
class BoundArg6,
class BoundArg7,
2680 class BoundArg8,
class BoundArg9,
class... FreeArgs>
2682 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2683 BoundArg4, BoundArg5, BoundArg6,
2684 BoundArg7, BoundArg8, BoundArg9,
2695 typedef std::tuple<BoundArg1, BoundArg2, BoundArg3, BoundArg4,
2696 BoundArg5, BoundArg6, BoundArg7, BoundArg8,
2699 {t, func, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9};
2724 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
2725 class BoundArg5,
class BoundArg6,
class BoundArg7,
class BoundArg8,
class BoundArg9,
2726 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5,
class Arg6,
class Arg7,
2727 class Arg8,
class Arg9,
class... FreeArgs>
2729 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2730 BoundArg4, BoundArg5, BoundArg6,
2731 BoundArg7, BoundArg8, BoundArg9,
2742 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
2743 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type,
2744 typename std::remove_const<typename std::remove_reference<BoundArg3>::type>::type,
2745 typename std::remove_const<typename std::remove_reference<BoundArg4>::type>::type,
2746 typename std::remove_const<typename std::remove_reference<BoundArg5>::type>::type,
2747 typename std::remove_const<typename std::remove_reference<BoundArg6>::type>::type,
2748 typename std::remove_const<typename std::remove_reference<BoundArg7>::type>::type,
2749 typename std::remove_const<typename std::remove_reference<BoundArg8>::type>::type,
2750 typename std::remove_const<typename std::remove_reference<BoundArg9>::type>::type> Tuple;
2752 {t, func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2), std::forward<Arg3>(arg3),
2753 std::forward<Arg4>(arg4), std::forward<Arg5>(arg5), std::forward<Arg6>(arg6),
2754 std::forward<Arg7>(arg7), std::forward<Arg8>(arg8), std::forward<Arg9>(arg9)};
2775 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
2776 class BoundArg4,
class BoundArg5,
class BoundArg6,
class BoundArg7,
2777 class BoundArg8,
class BoundArg9,
class BoundArg10,
class... FreeArgs>
2779 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2780 BoundArg4, BoundArg5, BoundArg6,
2781 BoundArg7, BoundArg8, BoundArg9,
2782 BoundArg10, FreeArgs...)
const,
2793 typedef std::tuple<BoundArg1, BoundArg2, BoundArg3, BoundArg4,
2794 BoundArg5, BoundArg6, BoundArg7, BoundArg8,
2795 BoundArg9, BoundArg10> Tuple;
2797 {t, func, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10};
2822 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
2823 class BoundArg5,
class BoundArg6,
class BoundArg7,
class BoundArg8,
class BoundArg9,
2824 class BoundArg10,
class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5,
class Arg6,
2825 class Arg7,
class Arg8,
class Arg9,
class Arg10,
class... FreeArgs>
2827 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
2828 BoundArg4, BoundArg5, BoundArg6,
2829 BoundArg7, BoundArg8, BoundArg9,
2830 BoundArg10, FreeArgs...)
const,
2841 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
2842 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type,
2843 typename std::remove_const<typename std::remove_reference<BoundArg3>::type>::type,
2844 typename std::remove_const<typename std::remove_reference<BoundArg4>::type>::type,
2845 typename std::remove_const<typename std::remove_reference<BoundArg5>::type>::type,
2846 typename std::remove_const<typename std::remove_reference<BoundArg6>::type>::type,
2847 typename std::remove_const<typename std::remove_reference<BoundArg7>::type>::type,
2848 typename std::remove_const<typename std::remove_reference<BoundArg8>::type>::type,
2849 typename std::remove_const<typename std::remove_reference<BoundArg9>::type>::type,
2850 typename std::remove_const<typename std::remove_reference<BoundArg10>::type>::type> Tuple;
2852 {t, func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2), std::forward<Arg3>(arg3),
2853 std::forward<Arg4>(arg4), std::forward<Arg5>(arg5), std::forward<Arg6>(arg6),
2854 std::forward<Arg7>(arg7), std::forward<Arg8>(arg8), std::forward<Arg9>(arg9),
2855 std::forward<Arg10>(arg10)};
2869 template <
class... FreeArgs>
2886 template <
class... FreeArgs>
2902 template <
class BoundArg,
class... FreeArgs>
2905 typedef std::tuple<BoundArg> Tuple;
2927 template <
class BoundArg,
class Arg,
class... FreeArgs>
2930 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg>::type>::type> Tuple;
2932 {func, std::forward<Arg>(arg)};
2946 template <
class BoundArg1,
class BoundArg2,
class... FreeArgs>
2950 typedef std::tuple<BoundArg1, BoundArg2> Tuple;
2972 template <
class BoundArg1,
class BoundArg2,
class Arg1,
class Arg2,
class... FreeArgs>
2976 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
2977 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type> Tuple;
2979 {func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2)};
2993 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
2994 CallbackArg<FreeArgs...>*
make(
void (*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...),
2998 typedef std::tuple<BoundArg1, BoundArg2, BoundArg3> Tuple;
3000 {func, arg1, arg2, arg3};
3020 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
3021 class Arg1,
class Arg2,
class Arg3,
class... FreeArgs>
3026 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
3027 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type,
3028 typename std::remove_const<typename std::remove_reference<BoundArg3>::type>::type> Tuple;
3030 {func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2), std::forward<Arg3>(arg3)};
3044 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
3045 class BoundArg4,
class... FreeArgs>
3047 BoundArg4, FreeArgs...),
3052 typedef std::tuple<BoundArg1, BoundArg2, BoundArg3, BoundArg4> Tuple;
3054 {func, arg1, arg2, arg3, arg4};
3074 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
3075 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class... FreeArgs>
3077 BoundArg4, FreeArgs...),
3082 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
3083 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type,
3084 typename std::remove_const<typename std::remove_reference<BoundArg3>::type>::type,
3085 typename std::remove_const<typename std::remove_reference<BoundArg4>::type>::type> Tuple;
3087 {func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2),
3088 std::forward<Arg3>(arg3), std::forward<Arg4>(arg4)};
3102 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
3103 class BoundArg4,
class BoundArg5,
class... FreeArgs>
3105 BoundArg4, BoundArg5, FreeArgs...),
3111 typedef std::tuple<BoundArg1, BoundArg2, BoundArg3, BoundArg4, BoundArg5> Tuple;
3113 {func, arg1, arg2, arg3, arg4, arg5};
3133 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
class BoundArg5,
3134 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5,
class... FreeArgs>
3136 BoundArg4, BoundArg5, FreeArgs...),
3142 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
3143 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type,
3144 typename std::remove_const<typename std::remove_reference<BoundArg3>::type>::type,
3145 typename std::remove_const<typename std::remove_reference<BoundArg4>::type>::type,
3146 typename std::remove_const<typename std::remove_reference<BoundArg5>::type>::type> Tuple;
3148 {func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2), std::forward<Arg3>(arg3),
3149 std::forward<Arg4>(arg4), std::forward<Arg5>(arg5)};
3170 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
3171 class BoundArg5,
class BoundArg6,
class... FreeArgs>
3173 BoundArg4, BoundArg5, BoundArg6,
3181 typedef std::tuple<BoundArg1, BoundArg2, BoundArg3, BoundArg4,
3182 BoundArg5, BoundArg6> Tuple;
3184 {func, arg1, arg2, arg3, arg4, arg5, arg6};
3209 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
class BoundArg5,
3210 class BoundArg6,
class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5,
3211 class Arg6,
class... FreeArgs>
3213 BoundArg4, BoundArg5, BoundArg6,
3221 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
3222 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type,
3223 typename std::remove_const<typename std::remove_reference<BoundArg3>::type>::type,
3224 typename std::remove_const<typename std::remove_reference<BoundArg4>::type>::type,
3225 typename std::remove_const<typename std::remove_reference<BoundArg5>::type>::type,
3226 typename std::remove_const<typename std::remove_reference<BoundArg6>::type>::type> Tuple;
3228 {func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2), std::forward<Arg3>(arg3),
3229 std::forward<Arg4>(arg4), std::forward<Arg5>(arg5), std::forward<Arg6>(arg6)};
3250 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
3251 class BoundArg5,
class BoundArg6,
class BoundArg7,
class... FreeArgs>
3253 BoundArg4, BoundArg5, BoundArg6,
3254 BoundArg7, FreeArgs...),
3262 typedef std::tuple<BoundArg1, BoundArg2, BoundArg3, BoundArg4,
3263 BoundArg5, BoundArg6, BoundArg7> Tuple;
3265 {func, arg1, arg2, arg3, arg4, arg5, arg6, arg7};
3290 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
3291 class BoundArg5,
class BoundArg6,
class BoundArg7,
class Arg1,
class Arg2,
3292 class Arg3,
class Arg4,
class Arg5,
class Arg6,
class Arg7,
class... FreeArgs>
3294 BoundArg4, BoundArg5, BoundArg6,
3295 BoundArg7, FreeArgs...),
3303 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
3304 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type,
3305 typename std::remove_const<typename std::remove_reference<BoundArg3>::type>::type,
3306 typename std::remove_const<typename std::remove_reference<BoundArg4>::type>::type,
3307 typename std::remove_const<typename std::remove_reference<BoundArg5>::type>::type,
3308 typename std::remove_const<typename std::remove_reference<BoundArg6>::type>::type,
3309 typename std::remove_const<typename std::remove_reference<BoundArg7>::type>::type> Tuple;
3311 {func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2), std::forward<Arg3>(arg3),
3312 std::forward<Arg4>(arg4), std::forward<Arg5>(arg5), std::forward<Arg6>(arg6),
3313 std::forward<Arg7>(arg7)};
3334 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
3335 class BoundArg5,
class BoundArg6,
class BoundArg7,
class BoundArg8,
3338 BoundArg4, BoundArg5, BoundArg6,
3339 BoundArg7, BoundArg8, FreeArgs...),
3348 typedef std::tuple<BoundArg1, BoundArg2, BoundArg3, BoundArg4,
3349 BoundArg5, BoundArg6, BoundArg7, BoundArg8> Tuple;
3351 {func, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8};
3376 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
3377 class BoundArg5,
class BoundArg6,
class BoundArg7,
class BoundArg8,
3378 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5,
class Arg6,
3379 class Arg7,
class Arg8,
class... FreeArgs>
3381 BoundArg4, BoundArg5, BoundArg6,
3382 BoundArg7, BoundArg8, FreeArgs...),
3391 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
3392 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type,
3393 typename std::remove_const<typename std::remove_reference<BoundArg3>::type>::type,
3394 typename std::remove_const<typename std::remove_reference<BoundArg4>::type>::type,
3395 typename std::remove_const<typename std::remove_reference<BoundArg5>::type>::type,
3396 typename std::remove_const<typename std::remove_reference<BoundArg6>::type>::type,
3397 typename std::remove_const<typename std::remove_reference<BoundArg7>::type>::type,
3398 typename std::remove_const<typename std::remove_reference<BoundArg8>::type>::type> Tuple;
3400 {func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2), std::forward<Arg3>(arg3),
3401 std::forward<Arg4>(arg4), std::forward<Arg5>(arg5), std::forward<Arg6>(arg6),
3402 std::forward<Arg7>(arg7), std::forward<Arg8>(arg8)};
3423 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
3424 class BoundArg5,
class BoundArg6,
class BoundArg7,
class BoundArg8,
3425 class BoundArg9,
class... FreeArgs>
3427 BoundArg4, BoundArg5, BoundArg6,
3428 BoundArg7, BoundArg8, BoundArg9,
3439 typedef std::tuple<BoundArg1, BoundArg2, BoundArg3, BoundArg4,
3440 BoundArg5, BoundArg6, BoundArg7, BoundArg8,
3443 {func, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9};
3468 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
3469 class BoundArg5,
class BoundArg6,
class BoundArg7,
class BoundArg8,
3470 class BoundArg9,
class Arg1,
class Arg2,
class Arg3,
class Arg4,
3471 class Arg5,
class Arg6,
class Arg7,
class Arg8,
class Arg9,
3474 BoundArg4, BoundArg5, BoundArg6,
3475 BoundArg7, BoundArg8, BoundArg9,
3486 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
3487 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type,
3488 typename std::remove_const<typename std::remove_reference<BoundArg3>::type>::type,
3489 typename std::remove_const<typename std::remove_reference<BoundArg4>::type>::type,
3490 typename std::remove_const<typename std::remove_reference<BoundArg5>::type>::type,
3491 typename std::remove_const<typename std::remove_reference<BoundArg6>::type>::type,
3492 typename std::remove_const<typename std::remove_reference<BoundArg7>::type>::type,
3493 typename std::remove_const<typename std::remove_reference<BoundArg8>::type>::type,
3494 typename std::remove_const<typename std::remove_reference<BoundArg9>::type>::type> Tuple;
3496 {func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2), std::forward<Arg3>(arg3),
3497 std::forward<Arg4>(arg4), std::forward<Arg5>(arg5), std::forward<Arg6>(arg6),
3498 std::forward<Arg7>(arg7), std::forward<Arg8>(arg8), std::forward<Arg9>(arg9)};
3519 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
3520 class BoundArg5,
class BoundArg6,
class BoundArg7,
class BoundArg8,
3521 class BoundArg9,
class BoundArg10,
class... FreeArgs>
3523 BoundArg4, BoundArg5, BoundArg6,
3524 BoundArg7, BoundArg8, BoundArg9,
3525 BoundArg10, FreeArgs...),
3536 typedef std::tuple<BoundArg1, BoundArg2, BoundArg3, BoundArg4,
3537 BoundArg5, BoundArg6, BoundArg7, BoundArg8,
3538 BoundArg9, BoundArg10> Tuple;
3540 {func, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10};
3565 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
3566 class BoundArg5,
class BoundArg6,
class BoundArg7,
class BoundArg8,
3567 class BoundArg9,
class BoundArg10,
class Arg1,
class Arg2,
class Arg3,
3568 class Arg4,
class Arg5,
class Arg6,
class Arg7,
class Arg8,
class Arg9,
3569 class Arg10,
class... FreeArgs>
3571 BoundArg4, BoundArg5, BoundArg6,
3572 BoundArg7, BoundArg8, BoundArg9,
3573 BoundArg10, FreeArgs...),
3584 typedef std::tuple<typename std::remove_const<typename std::remove_reference<BoundArg1>::type>::type,
3585 typename std::remove_const<typename std::remove_reference<BoundArg2>::type>::type,
3586 typename std::remove_const<typename std::remove_reference<BoundArg3>::type>::type,
3587 typename std::remove_const<typename std::remove_reference<BoundArg4>::type>::type,
3588 typename std::remove_const<typename std::remove_reference<BoundArg5>::type>::type,
3589 typename std::remove_const<typename std::remove_reference<BoundArg6>::type>::type,
3590 typename std::remove_const<typename std::remove_reference<BoundArg7>::type>::type,
3591 typename std::remove_const<typename std::remove_reference<BoundArg8>::type>::type,
3592 typename std::remove_const<typename std::remove_reference<BoundArg9>::type>::type,
3593 typename std::remove_const<typename std::remove_reference<BoundArg10>::type>::type> Tuple;
3595 {func, std::forward<Arg1>(arg1), std::forward<Arg2>(arg2), std::forward<Arg3>(arg3),
3596 std::forward<Arg4>(arg4), std::forward<Arg5>(arg5), std::forward<Arg6>(arg6),
3597 std::forward<Arg7>(arg7), std::forward<Arg8>(arg8), std::forward<Arg9>(arg9),
3598 std::forward<Arg10>(arg10)};
3601 #endif // CGU_USE_TUPLE
3617 template <
class... FreeArgs>
3619 typedef std::function<void(FreeArgs...)> LType;
3637 template <
class... FreeArgs>
3639 typedef std::function<void(FreeArgs...)> LType;
3655 template <
class... FreeArgs>
3657 typedef std::function<void(FreeArgs...)> LType;
3675 template <
class... FreeArgs>
3677 typedef std::function<void(FreeArgs...)> LType;
3721 template <
class... FreeArgs,
class Lambda>
3723 typedef typename std::remove_const<typename std::remove_reference<Lambda>::type>::type LType;
3724 return new Callback_lambda<LType, FreeArgs...>{std::forward<Lambda>(l)};
3739 #ifndef DOXYGEN_PARSING
3747 template <
class T,
class... FreeArgs>
3748 class Callback0:
public CallbackArg<FreeArgs...> {
3750 typedef void (T::* MemFunc)(FreeArgs...);
3756 (obj->*func)(free_args...);
3758 Callback0(T& obj_, MemFunc func_): obj(&obj_), func(func_) {}
3761 template <
bool unref,
class T,
class BoundArg,
class... FreeArgs>
3762 class Callback1:
public CallbackArg<FreeArgs...> {
3764 typedef void (T::* MemFunc)(BoundArg, FreeArgs...);
3771 (obj->*func)(arg, free_args...);
3773 template <
class Arg>
3774 Callback1(T& obj_, MemFunc func_,
3775 Arg&& arg_): obj(&obj_), func(func_), arg(std::forward<Arg>(arg_)) {}
3778 template <
bool unref,
class T,
class BoundArg1,
class BoundArg2,
class... FreeArgs>
3779 class Callback2:
public CallbackArg<FreeArgs...> {
3781 typedef void (T::* MemFunc)(BoundArg1, BoundArg2, FreeArgs...);
3789 (obj->*func)(arg1, arg2, free_args...);
3791 template <
class Arg1,
class Arg2>
3792 Callback2(T& obj_, MemFunc func_,
3794 Arg2&& arg2_): obj(&obj_), func(func_),
3795 arg1(std::forward<Arg1>(arg1_)),
3796 arg2(std::forward<Arg2>(arg2_)) {}
3799 template <
bool unref,
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
3800 class Callback3:
public CallbackArg<FreeArgs...> {
3802 typedef void (T::* MemFunc)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...);
3811 (obj->*func)(arg1, arg2, arg3, free_args...);
3813 template <
class Arg1,
class Arg2,
class Arg3>
3814 Callback3(T& obj_, MemFunc func_,
3818 obj(&obj_), func(func_),
3819 arg1(std::forward<Arg1>(arg1_)),
3820 arg2(std::forward<Arg2>(arg2_)),
3821 arg3(std::forward<Arg3>(arg3_)) {}
3824 template <
bool unref,
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
3825 class BoundArg4,
class... FreeArgs>
3826 class Callback4:
public CallbackArg<FreeArgs...> {
3828 typedef void (T::* MemFunc)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, FreeArgs...);
3838 (obj->*func)(arg1, arg2, arg3, arg4, free_args...);
3840 template <
class Arg1,
class Arg2,
class Arg3,
class Arg4>
3841 Callback4(T& obj_, MemFunc func_,
3846 obj(&obj_), func(func_),
3847 arg1(std::forward<Arg1>(arg1_)),
3848 arg2(std::forward<Arg2>(arg2_)),
3849 arg3(std::forward<Arg3>(arg3_)),
3850 arg4(std::forward<Arg4>(arg4_)) {}
3853 template <
bool unref,
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
3854 class BoundArg4,
class BoundArg5,
class... FreeArgs>
3855 class Callback5:
public CallbackArg<FreeArgs...> {
3857 typedef void (T::* MemFunc)(BoundArg1, BoundArg2, BoundArg3,
3858 BoundArg4, BoundArg5, FreeArgs...);
3869 (obj->*func)(arg1, arg2, arg3, arg4, arg5, free_args...);
3871 template <
class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5>
3872 Callback5(T& obj_, MemFunc func_,
3878 obj(&obj_), func(func_),
3879 arg1(std::forward<Arg1>(arg1_)),
3880 arg2(std::forward<Arg2>(arg2_)),
3881 arg3(std::forward<Arg3>(arg3_)),
3882 arg4(std::forward<Arg4>(arg4_)),
3883 arg5(std::forward<Arg5>(arg5_)) {}
3886 template <
class T,
class... FreeArgs>
3887 class Callback0_const:
public CallbackArg<FreeArgs...> {
3889 typedef void (T::* MemFunc)(FreeArgs...)
const;
3895 (obj->*func)(free_args...);
3897 Callback0_const(
const T& obj_, MemFunc func_): obj(&obj_), func(func_) {}
3900 template <
bool unref,
class T,
class BoundArg,
class... FreeArgs>
3901 class Callback1_const:
public CallbackArg<FreeArgs...> {
3903 typedef void (T::* MemFunc)(BoundArg, FreeArgs...)
const;
3910 (obj->*func)(arg, free_args...);
3912 template <
class Arg>
3913 Callback1_const(
const T& obj_, MemFunc func_,
3914 Arg&& arg_): obj(&obj_), func(func_), arg(std::forward<Arg>(arg_)) {}
3917 template <
bool unref,
class T,
class BoundArg1,
class BoundArg2,
class... FreeArgs>
3918 class Callback2_const:
public CallbackArg<FreeArgs...> {
3920 typedef void (T::* MemFunc)(BoundArg1, BoundArg2, FreeArgs...)
const;
3928 (obj->*func)(arg1, arg2, free_args...);
3930 template <
class Arg1,
class Arg2>
3931 Callback2_const(
const T& obj_, MemFunc func_,
3933 Arg2&& arg2_): obj(&obj_), func(func_),
3934 arg1(std::forward<Arg1>(arg1_)),
3935 arg2(std::forward<Arg2>(arg2_)) {}
3938 template <
bool unref,
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
3939 class Callback3_const:
public CallbackArg<FreeArgs...> {
3941 typedef void (T::* MemFunc)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...)
const;
3950 (obj->*func)(arg1, arg2, arg3, free_args...);
3952 template <
class Arg1,
class Arg2,
class Arg3>
3953 Callback3_const(
const T& obj_, MemFunc func_,
3957 obj(&obj_), func(func_),
3958 arg1(std::forward<Arg1>(arg1_)),
3959 arg2(std::forward<Arg2>(arg2_)),
3960 arg3(std::forward<Arg3>(arg3_)) {}
3963 template <
bool unref,
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
3964 class BoundArg4,
class... FreeArgs>
3965 class Callback4_const:
public CallbackArg<FreeArgs...> {
3967 typedef void (T::* MemFunc)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, FreeArgs...)
const;
3977 (obj->*func)(arg1, arg2, arg3, arg4, free_args...);
3979 template <
class Arg1,
class Arg2,
class Arg3,
class Arg4>
3980 Callback4_const(
const T& obj_, MemFunc func_,
3985 obj(&obj_), func(func_),
3986 arg1(std::forward<Arg1>(arg1_)),
3987 arg2(std::forward<Arg2>(arg2_)),
3988 arg3(std::forward<Arg3>(arg3_)),
3989 arg4(std::forward<Arg4>(arg4_)) {}
3992 template <
bool unref,
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
3993 class BoundArg4,
class BoundArg5,
class... FreeArgs>
3994 class Callback5_const:
public CallbackArg<FreeArgs...> {
3996 typedef void (T::* MemFunc)(BoundArg1, BoundArg2, BoundArg3,
3997 BoundArg4, BoundArg5, FreeArgs...)
const;
4008 (obj->*func)(arg1, arg2, arg3, arg4, arg5, free_args...);
4010 template <
class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5>
4011 Callback5_const(
const T& obj_, MemFunc func_,
4017 obj(&obj_), func(func_),
4018 arg1(std::forward<Arg1>(arg1_)),
4019 arg2(std::forward<Arg2>(arg2_)),
4020 arg3(std::forward<Arg3>(arg3_)),
4021 arg4(std::forward<Arg4>(arg4_)),
4022 arg5(std::forward<Arg5>(arg5_)) {}
4025 template <
class... FreeArgs>
4026 class Callback0_static:
public CallbackArg<FreeArgs...> {
4028 typedef void (*Func)(FreeArgs...);
4035 Callback0_static(Func func_): func(func_) {}
4038 template <
bool unref,
class BoundArg,
class... FreeArgs>
4039 class Callback1_static:
public CallbackArg<FreeArgs...> {
4041 typedef void (*Func)(BoundArg, FreeArgs...);
4047 func(arg, free_args...);
4049 template <
class Arg>
4050 Callback1_static(Func func_, Arg&& arg_): func(func_), arg(std::forward<Arg>(arg_)) {}
4053 template <
bool unref,
class BoundArg1,
class BoundArg2,
class... FreeArgs>
4054 class Callback2_static:
public CallbackArg<FreeArgs...> {
4056 typedef void (*Func)(BoundArg1, BoundArg2, FreeArgs...);
4063 func(arg1, arg2, free_args...);
4065 template <
class Arg1,
class Arg2>
4066 Callback2_static(Func func_, Arg1&& arg1_,
4067 Arg2&& arg2_): func(func_),
4068 arg1(std::forward<Arg1>(arg1_)),
4069 arg2(std::forward<Arg2>(arg2_)) {}
4072 template <
bool unref,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
4073 class Callback3_static:
public CallbackArg<FreeArgs...> {
4075 typedef void (*Func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...);
4083 func(arg1, arg2, arg3, free_args...);
4085 template <
class Arg1,
class Arg2,
class Arg3>
4086 Callback3_static(Func func_,
4091 arg1(std::forward<Arg1>(arg1_)),
4092 arg2(std::forward<Arg2>(arg2_)),
4093 arg3(std::forward<Arg3>(arg3_)) {}
4096 template <
bool unref,
class BoundArg1,
class BoundArg2,
class BoundArg3,
4097 class BoundArg4,
class... FreeArgs>
4098 class Callback4_static:
public CallbackArg<FreeArgs...> {
4100 typedef void (*Func)(BoundArg1, BoundArg2, BoundArg3, BoundArg4, FreeArgs...);
4109 func(arg1, arg2, arg3, arg4, free_args...);
4111 template <
class Arg1,
class Arg2,
class Arg3,
class Arg4>
4112 Callback4_static(Func func_,
4118 arg1(std::forward<Arg1>(arg1_)),
4119 arg2(std::forward<Arg2>(arg2_)),
4120 arg3(std::forward<Arg3>(arg3_)),
4121 arg4(std::forward<Arg4>(arg4_)) {}
4124 template <
bool unref,
class BoundArg1,
class BoundArg2,
class BoundArg3,
4125 class BoundArg4,
class BoundArg5,
class... FreeArgs>
4126 class Callback5_static:
public CallbackArg<FreeArgs...> {
4128 typedef void (*Func)(BoundArg1, BoundArg2, BoundArg3,
4129 BoundArg4, BoundArg5, FreeArgs...);
4139 func(arg1, arg2, arg3, arg4, arg5, free_args...);
4141 template <
class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5>
4142 Callback5_static(Func func_,
4149 arg1(std::forward<Arg1>(arg1_)),
4150 arg2(std::forward<Arg2>(arg2_)),
4151 arg3(std::forward<Arg3>(arg3_)),
4152 arg4(std::forward<Arg4>(arg4_)),
4153 arg5(std::forward<Arg5>(arg5_)) {}
4161 template <
class T,
class... FreeArgs>
4163 void (T::*func)(FreeArgs...)) {
4164 return new Callback0<T, FreeArgs...>{t, func};
4166 template <
class T,
class BoundArg,
class... FreeArgs>
4168 void (T::*func)(BoundArg, FreeArgs...),
4169 const BoundArg& arg) {
4170 return new Callback1<
false, T, BoundArg, FreeArgs...>{t, func, arg};
4172 template <
class T,
class BoundArg1,
class BoundArg2,
class... FreeArgs>
4174 void (T::*func)(BoundArg1, BoundArg2, FreeArgs...),
4175 const BoundArg1& arg1,
4176 const BoundArg2& arg2) {
4177 return new Callback2<
false, T, BoundArg1, BoundArg2, FreeArgs...>{t, func, arg1, arg2};
4179 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
4181 void (T::*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...),
4182 const BoundArg1& arg1,
4183 const BoundArg2& arg2,
4184 const BoundArg3& arg3) {
4185 return new Callback3<
false, T, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{t, func, arg1, arg2, arg3};
4187 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
4188 class BoundArg4,
class... FreeArgs>
4190 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
4191 BoundArg4, FreeArgs...),
4192 const BoundArg1& arg1,
4193 const BoundArg2& arg2,
4194 const BoundArg3& arg3,
4195 const BoundArg4& arg4) {
4196 return new Callback4<
false, T, BoundArg1, BoundArg2, BoundArg3,
4197 BoundArg4, FreeArgs...>{t, func, arg1, arg2, arg3, arg4};
4199 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
4200 class BoundArg4,
class BoundArg5,
class... FreeArgs>
4202 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
4203 BoundArg4, BoundArg5, FreeArgs...),
4204 const BoundArg1& arg1,
4205 const BoundArg2& arg2,
4206 const BoundArg3& arg3,
4207 const BoundArg4& arg4,
4208 const BoundArg5& arg5) {
4209 return new Callback5<
false, T, BoundArg1, BoundArg2, BoundArg3,
4210 BoundArg4, BoundArg5, FreeArgs...>{t, func, arg1, arg2, arg3, arg4, arg5};
4212 template <
class T,
class... FreeArgs>
4214 void (T::*func)(FreeArgs...)
const) {
4215 return new Callback0_const<T, FreeArgs...>{t, func};
4217 template <
class T,
class BoundArg,
class... FreeArgs>
4219 void (T::*func)(BoundArg, FreeArgs...)
const,
4220 const BoundArg& arg) {
4221 return new Callback1_const<
false, T, BoundArg, FreeArgs...>{t, func, arg};
4223 template <
class T,
class BoundArg1,
class BoundArg2,
class... FreeArgs>
4225 void (T::*func)(BoundArg1, BoundArg2, FreeArgs...)
const,
4226 const BoundArg1& arg1,
4227 const BoundArg2& arg2) {
4228 return new Callback2_const<
false, T, BoundArg1, BoundArg2, FreeArgs...>{t, func, arg1, arg2};
4230 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
4232 void (T::*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...)
const,
4233 const BoundArg1& arg1,
4234 const BoundArg2& arg2,
4235 const BoundArg3& arg3) {
4236 return new Callback3_const<
false, T, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{t, func, arg1, arg2, arg3};
4238 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
4239 class BoundArg4,
class... FreeArgs>
4241 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
4242 BoundArg4, FreeArgs...)
const,
4243 const BoundArg1& arg1,
4244 const BoundArg2& arg2,
4245 const BoundArg3& arg3,
4246 const BoundArg4& arg4) {
4247 return new Callback4_const<
false, T, BoundArg1, BoundArg2, BoundArg3,
4248 BoundArg4, FreeArgs...>{t, func, arg1, arg2, arg3, arg4};
4250 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
4251 class BoundArg4,
class BoundArg5,
class... FreeArgs>
4253 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
4254 BoundArg4, BoundArg5, FreeArgs...)
const,
4255 const BoundArg1& arg1,
4256 const BoundArg2& arg2,
4257 const BoundArg3& arg3,
4258 const BoundArg4& arg4,
4259 const BoundArg5& arg5) {
4260 return new Callback5_const<
false, T, BoundArg1, BoundArg2, BoundArg3,
4261 BoundArg4, BoundArg5, FreeArgs...>{t, func, arg1, arg2, arg3, arg4, arg5};
4263 template <
class... FreeArgs>
4264 CallbackArg<FreeArgs...>* make_val(
void (*func)(FreeArgs...)) {
4265 return new Callback0_static<FreeArgs...>{func};
4267 template <
class BoundArg,
class... FreeArgs>
4268 CallbackArg<FreeArgs...>* make_val(
void (*func)(BoundArg, FreeArgs...),
4269 const BoundArg& arg) {
4270 return new Callback1_static<
false, BoundArg, FreeArgs...>{func, arg};
4272 template <
class BoundArg1,
class BoundArg2,
class... FreeArgs>
4273 CallbackArg<FreeArgs...>* make_val(
void (*func)(BoundArg1, BoundArg2, FreeArgs...),
4274 const BoundArg1& arg1,
4275 const BoundArg2& arg2) {
4276 return new Callback2_static<
false, BoundArg1, BoundArg2, FreeArgs...>{func, arg1, arg2};
4278 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
4279 CallbackArg<FreeArgs...>* make_val(
void (*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...),
4280 const BoundArg1& arg1,
4281 const BoundArg2& arg2,
4282 const BoundArg3& arg3) {
4283 return new Callback3_static<
false, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{func, arg1, arg2, arg3};
4285 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
4286 class BoundArg4,
class... FreeArgs>
4287 CallbackArg<FreeArgs...>* make_val(
void (*func)(BoundArg1, BoundArg2, BoundArg3,
4288 BoundArg4, FreeArgs...),
4289 const BoundArg1& arg1,
4290 const BoundArg2& arg2,
4291 const BoundArg3& arg3,
4292 const BoundArg4& arg4) {
4293 return new Callback4_static<
false, BoundArg1, BoundArg2, BoundArg3,
4294 BoundArg4, FreeArgs...>{func, arg1, arg2, arg3, arg4};
4296 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
4297 class BoundArg4,
class BoundArg5,
class... FreeArgs>
4298 CallbackArg<FreeArgs...>* make_val(
void (*func)(BoundArg1, BoundArg2, BoundArg3,
4299 BoundArg4, BoundArg5, FreeArgs...),
4300 const BoundArg1& arg1,
4301 const BoundArg2& arg2,
4302 const BoundArg3& arg3,
4303 const BoundArg4& arg4,
4304 const BoundArg5& arg5) {
4305 return new Callback5_static<
false, BoundArg1, BoundArg2, BoundArg3,
4306 BoundArg4, BoundArg5, FreeArgs...>{func, arg1, arg2, arg3, arg4, arg5};
4308 template <
class... FreeArgs>
4309 CallbackArg<FreeArgs...>* make_val(
const std::function<
void(FreeArgs...)>& f) {
4310 typedef std::function<void(FreeArgs...)> LType;
4313 template <
class... FreeArgs>
4314 CallbackArg<FreeArgs...>* make_val(std::function<
void(FreeArgs...)>&& f) {
4315 typedef std::function<void(FreeArgs...)> LType;
4319 #ifndef CGU_USE_TUPLE
4321 template <
class T,
class... FreeArgs>
4323 void (T::*func)(FreeArgs...)) {
4324 return new Callback0<T, FreeArgs...>{t, func};
4327 template <
class T,
class... FreeArgs>
4329 void (T::*func)(FreeArgs...)) {
4330 return new Callback0<T, FreeArgs...>{t, func};
4333 template <
class T,
class BoundArg,
class... FreeArgs>
4335 void (T::*func)(BoundArg, FreeArgs...),
4337 return new Callback1<
false, T, BoundArg, FreeArgs...>{t, func, arg};
4340 template <
class T,
class BoundArg,
class Arg,
class... FreeArgs>
4342 void (T::*func)(BoundArg, FreeArgs...),
4344 return new Callback1<
true, T, BoundArg, FreeArgs...>{t, func, std::forward<Arg>(arg)};
4347 template <
class T,
class BoundArg1,
class BoundArg2,
class... FreeArgs>
4349 void (T::*func)(BoundArg1, BoundArg2, FreeArgs...),
4352 return new Callback2<
false, T, BoundArg1, BoundArg2, FreeArgs...>{t, func, arg1, arg2};
4355 template <
class T,
class BoundArg1,
class BoundArg2,
4356 class Arg1,
class Arg2,
class... FreeArgs>
4358 void (T::*func)(BoundArg1, BoundArg2, FreeArgs...),
4361 return new Callback2<
true, T, BoundArg1, BoundArg2, FreeArgs...>{t, func,
4362 std::forward<Arg1>(arg1),
4363 std::forward<Arg2>(arg2)};
4366 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
4368 void (T::*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...),
4372 return new Callback3<
false, T, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{t, func, arg1, arg2, arg3};
4375 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
4376 class Arg1,
class Arg2,
class Arg3,
class... FreeArgs>
4378 void (T::*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...),
4382 return new Callback3<
true, T, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{t, func,
4383 std::forward<Arg1>(arg1),
4384 std::forward<Arg2>(arg2),
4385 std::forward<Arg3>(arg3)};
4388 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
4389 class BoundArg4,
class... FreeArgs>
4391 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
4392 BoundArg4, FreeArgs...),
4397 return new Callback4<
false, T, BoundArg1, BoundArg2, BoundArg3,
4398 BoundArg4, FreeArgs...>{t, func, arg1, arg2, arg3, arg4};
4401 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
4402 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class... FreeArgs>
4404 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
4405 BoundArg4, FreeArgs...),
4410 return new Callback4<
true, T, BoundArg1, BoundArg2, BoundArg3,
4411 BoundArg4, FreeArgs...>{t, func,
4412 std::forward<Arg1>(arg1),
4413 std::forward<Arg2>(arg2),
4414 std::forward<Arg3>(arg3),
4415 std::forward<Arg4>(arg4)};
4418 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
4419 class BoundArg4,
class BoundArg5,
class... FreeArgs>
4421 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
4422 BoundArg4, BoundArg5, FreeArgs...),
4428 return new Callback5<
false, T, BoundArg1, BoundArg2, BoundArg3,
4429 BoundArg4, BoundArg5, FreeArgs...>{t, func, arg1, arg2, arg3, arg4, arg5};
4432 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
class BoundArg5,
4433 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5,
class... FreeArgs>
4435 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
4436 BoundArg4, BoundArg5, FreeArgs...),
4442 return new Callback5<
true, T, BoundArg1, BoundArg2, BoundArg3,
4443 BoundArg4, BoundArg5, FreeArgs...>{t, func,
4444 std::forward<Arg1>(arg1),
4445 std::forward<Arg2>(arg2),
4446 std::forward<Arg3>(arg3),
4447 std::forward<Arg4>(arg4),
4448 std::forward<Arg5>(arg5)};
4451 template <
class T,
class... FreeArgs>
4453 void (T::*func)(FreeArgs...)
const) {
4454 return new Callback0_const<T, FreeArgs...>{t, func};
4457 template <
class T,
class... FreeArgs>
4459 void (T::*func)(FreeArgs...)
const) {
4460 return new Callback0_const<T, FreeArgs...>{t, func};
4463 template <
class T,
class BoundArg,
class... FreeArgs>
4465 void (T::*func)(BoundArg, FreeArgs...)
const,
4467 return new Callback1_const<
false, T, BoundArg, FreeArgs...>{t, func, arg};
4470 template <
class T,
class BoundArg,
class Arg,
class... FreeArgs>
4472 void (T::*func)(BoundArg, FreeArgs...)
const,
4474 return new Callback1_const<
true, T, BoundArg, FreeArgs...>{t, func, std::forward<Arg>(arg)};
4477 template <
class T,
class BoundArg1,
class BoundArg2,
class... FreeArgs>
4479 void (T::*func)(BoundArg1, BoundArg2, FreeArgs...)
const,
4482 return new Callback2_const<
false, T, BoundArg1, BoundArg2, FreeArgs...>{t, func, arg1, arg2};
4485 template <
class T,
class BoundArg1,
class BoundArg2,
4486 class Arg1,
class Arg2,
class... FreeArgs>
4488 void (T::*func)(BoundArg1, BoundArg2, FreeArgs...)
const,
4491 return new Callback2_const<
true, T, BoundArg1, BoundArg2, FreeArgs...>{t, func,
4492 std::forward<Arg1>(arg1),
4493 std::forward<Arg2>(arg2)};
4496 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
4498 void (T::*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...)
const,
4502 return new Callback3_const<
false, T, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{t, func, arg1, arg2, arg3};
4505 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
4506 class Arg1,
class Arg2,
class Arg3,
class... FreeArgs>
4508 void (T::*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...)
const,
4512 return new Callback3_const<
true, T, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{t, func,
4513 std::forward<Arg1>(arg1),
4514 std::forward<Arg2>(arg2),
4515 std::forward<Arg3>(arg3)};
4518 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
4519 class BoundArg4,
class... FreeArgs>
4521 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
4522 BoundArg4, FreeArgs...)
const,
4527 return new Callback4_const<
false, T, BoundArg1, BoundArg2, BoundArg3,
4528 BoundArg4, FreeArgs...>{t, func, arg1, arg2, arg3, arg4};
4531 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
4532 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class... FreeArgs>
4534 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
4535 BoundArg4, FreeArgs...)
const,
4540 return new Callback4_const<
true, T, BoundArg1, BoundArg2, BoundArg3,
4541 BoundArg4, FreeArgs...>{t, func,
4542 std::forward<Arg1>(arg1),
4543 std::forward<Arg2>(arg2),
4544 std::forward<Arg3>(arg3),
4545 std::forward<Arg4>(arg4)};
4548 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
4549 class BoundArg4,
class BoundArg5,
class... FreeArgs>
4551 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
4552 BoundArg4, BoundArg5, FreeArgs...)
const,
4558 return new Callback5_const<
false, T, BoundArg1, BoundArg2, BoundArg3,
4559 BoundArg4, BoundArg5, FreeArgs...>{t, func, arg1, arg2, arg3, arg4, arg5};
4562 template <
class T,
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
class BoundArg5,
4563 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5,
class... FreeArgs>
4565 void (T::*func)(BoundArg1, BoundArg2, BoundArg3,
4566 BoundArg4, BoundArg5, FreeArgs...)
const,
4572 return new Callback5_const<
true, T, BoundArg1, BoundArg2, BoundArg3,
4573 BoundArg4, BoundArg5, FreeArgs...>{t, func,
4574 std::forward<Arg1>(arg1),
4575 std::forward<Arg2>(arg2),
4576 std::forward<Arg3>(arg3),
4577 std::forward<Arg4>(arg4),
4578 std::forward<Arg5>(arg5)};
4581 template <
class... FreeArgs>
4583 return new Callback0_static<FreeArgs...>{func};
4586 template <
class... FreeArgs>
4588 return new Callback0_static<FreeArgs...>{func};
4591 template <
class BoundArg,
class... FreeArgs>
4594 return new Callback1_static<
false, BoundArg, FreeArgs...>{func, arg};
4597 template <
class BoundArg,
class Arg,
class... FreeArgs>
4600 return new Callback1_static<
true, BoundArg, FreeArgs...>{func, std::forward<Arg>(arg)};
4603 template <
class BoundArg1,
class BoundArg2,
class... FreeArgs>
4604 CallbackArg<FreeArgs...>*
make(
void (*func)(BoundArg1, BoundArg2, FreeArgs...),
4607 return new Callback2_static<
false, BoundArg1, BoundArg2, FreeArgs...>{func, arg1, arg2};
4610 template <
class BoundArg1,
class BoundArg2,
class Arg1,
class Arg2,
class... FreeArgs>
4614 return new Callback2_static<
true, BoundArg1, BoundArg2, FreeArgs...>{func,
4615 std::forward<Arg1>(arg1),
4616 std::forward<Arg2>(arg2)};
4619 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
class... FreeArgs>
4620 CallbackArg<FreeArgs...>*
make(
void (*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...),
4624 return new Callback3_static<
false, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{func, arg1, arg2, arg3};
4627 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
4628 class Arg1,
class Arg2,
class Arg3,
class... FreeArgs>
4629 CallbackArg<FreeArgs...>*
make_ref(
void (*func)(BoundArg1, BoundArg2, BoundArg3, FreeArgs...),
4633 return new Callback3_static<
true, BoundArg1, BoundArg2, BoundArg3, FreeArgs...>{func,
4634 std::forward<Arg1>(arg1),
4635 std::forward<Arg2>(arg2),
4636 std::forward<Arg3>(arg3)};
4639 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
4640 class BoundArg4,
class... FreeArgs>
4641 CallbackArg<FreeArgs...>*
make(
void (*func)(BoundArg1, BoundArg2, BoundArg3,
4642 BoundArg4, FreeArgs...),
4647 return new Callback4_static<
false, BoundArg1, BoundArg2, BoundArg3,
4648 BoundArg4, FreeArgs...>{func, arg1, arg2, arg3, arg4};
4651 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
4652 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class... FreeArgs>
4654 BoundArg4, FreeArgs...),
4659 return new Callback4_static<
true, BoundArg1, BoundArg2, BoundArg3,
4660 BoundArg4, FreeArgs...>{func,
4661 std::forward<Arg1>(arg1),
4662 std::forward<Arg2>(arg2),
4663 std::forward<Arg3>(arg3),
4664 std::forward<Arg4>(arg4)};
4667 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
4668 class BoundArg4,
class BoundArg5,
class... FreeArgs>
4669 CallbackArg<FreeArgs...>*
make(
void (*func)(BoundArg1, BoundArg2, BoundArg3,
4670 BoundArg4, BoundArg5, FreeArgs...),
4676 return new Callback5_static<
false, BoundArg1, BoundArg2, BoundArg3,
4677 BoundArg4, BoundArg5, FreeArgs...>{func, arg1, arg2, arg3, arg4, arg5};
4680 template <
class BoundArg1,
class BoundArg2,
class BoundArg3,
class BoundArg4,
class BoundArg5,
4681 class Arg1,
class Arg2,
class Arg3,
class Arg4,
class Arg5,
class... FreeArgs>
4683 BoundArg4, BoundArg5, FreeArgs...),
4689 return new Callback5_static<
true, BoundArg1, BoundArg2, BoundArg3,
4690 BoundArg4, BoundArg5, FreeArgs...>{func,
4691 std::forward<Arg1>(arg1),
4692 std::forward<Arg2>(arg2),
4693 std::forward<Arg3>(arg3),
4694 std::forward<Arg4>(arg4),
4695 std::forward<Arg5>(arg5)};
4698 #endif // CGU_USE_TUPLE
4700 #endif // DOXYGEN_PARSING
4732 void post(
const Callback* cb, gint priority = G_PRIORITY_DEFAULT_IDLE,
4733 GMainContext* context = 0);
4784 gint priority = G_PRIORITY_DEFAULT_IDLE, GMainContext* context = 0);
4829 class =
typename std::enable_if<!std::is_convertible<typename std::remove_reference<F>::type,
4831 void post(F&& func, gint priority = G_PRIORITY_DEFAULT_IDLE,
4832 GMainContext* context = 0) {
4833 post(lambda<>(std::forward<F>(func)), priority, context);
4894 class =
typename std::enable_if<!std::is_convertible<typename std::remove_reference<F>::type,
4897 gint priority = G_PRIORITY_DEFAULT_IDLE, GMainContext* context = 0) {
4898 post(lambda<>(std::forward<F>(func)), r, priority, context);
void operator()(typename Cgu::Param< FreeArgs >::ParamType...args) const
Definition: callback.h:985
FunctorArg Functor
Definition: callback.h:784
void dispatch(typename Cgu::Param< FreeArgs >::ParamType...free_args) const
Definition: callback.h:1271
CallbackArg< FreeArgs...> * make_ref(T &t, void(T::*func)(FreeArgs...))
Definition: callback.h:1358
SafeFunctorArg< T...> to_safe_functor(const CallbackArg< T...> *cb)
Definition: callback.h:1258
CallbackArg< FreeArgs...> * make(T &t, void(T::*func)(FreeArgs...))
Definition: callback.h:1340
FunctorArg(FunctorArg &&f)
Definition: callback.h:1048
This is a smart pointer for managing the lifetime of objects allocated on freestore, with a thread safe reference count.
Definition: shared_ptr.h:644
SafeFunctorArg(const SafeFunctorArg &f)
Definition: callback.h:1157
Struct which will conditionally convert a reference type to a value type.
Definition: param.h:111
Callback_memfun(T &obj_, MemFunc func_)
Definition: callback.h:1305
Functor class holding a Callback::CallbackArg object.
Definition: callback.h:783
std::unique_ptr< const CallbackArg< T...> > to_unique(const CallbackArg< T...> *cb) noexcept
Definition: callback.h:777
const T & ParamType
Definition: param.h:84
Callback_lambda(L &&l_)
Definition: callback.h:1272
Callback_fun_tuple(Func func_, Args &&...args)
Definition: callback.h:1320
Callback_memfun_tuple(T &obj_, MemFunc func_, Args &&...args)
Definition: callback.h:1289
SafeFunctorArg()
Definition: callback.h:1175
A specialization of std::hash for Cgu::Callback::FunctorArg, Cgu::Callback::SafeFunctorArg, Cgu::GobjHandle, Cgu::GvarHandle, Cgu::IntrusivePtr, Cgu::SharedHandle, Cgu::SharedLockHandle, Cgu::SharedPtr and Cgu::SharedLockPtr so that such objects may be keys of unordered associative containers.
Definition: callback.h:1279
Definition: callback.h:1311
FunctorArg()
Definition: callback.h:1055
SafeFunctorArg SafeFunctor
Definition: callback.h:786
SafeFunctorArg(SafeFunctorArg &&f)
Definition: callback.h:1163
bool operator==(const FunctorArg< T...> &f1, const FunctorArg< T...> &f2) noexcept
Definition: callback.h:798
void dispatch(typename Cgu::Param< FreeArgs >::ParamType...free_args) const
Definition: callback.h:1285
bool operator!=(const FunctorArg< T...> &f1, const FunctorArg< T...> &f2) noexcept
Definition: callback.h:808
CallbackArg< FreeArgs...> * lambda(Lambda &&l)
Definition: callback.h:3722
FunctorArg & operator=(FunctorArg &&f)
Definition: callback.h:1001
Definition: callback.h:1266
FunctorArg & operator=(const FunctorArg &f)
Definition: callback.h:994
Definition: application.h:44
auto tuple_apply(Func &&func, const std::tuple< TupleArgs...> &t, OtherArgs &&...args) -> typename std::result_of< Func(const TupleArgs &..., OtherArgs &&...)>::type
Definition: param.h:304
FunctorArg(const FunctorArg &f)
Definition: callback.h:1042
virtual void dispatch(typename Cgu::Param< FreeArgs >::ParamType...args) const =0
SafeFunctorArg & operator=(const SafeFunctorArg &f)
Definition: callback.h:1109
Functor class holding a Callback::CallbackArg object, with thread-safe reference count.
Definition: callback.h:784
bool operator<(const FunctorArg< T...> &f1, const FunctorArg< T...> &f2)
Definition: callback.h:826
void dispatch(typename Cgu::Param< FreeArgs >::ParamType...free_args) const
Definition: callback.h:1316
Definition: callback.h:1298
void operator()(typename Cgu::Param< FreeArgs >::ParamType...args) const
Definition: callback.h:1100
CallbackArg()
Definition: callback.h:680
SafeFunctorArg & operator=(SafeFunctorArg &&f)
Definition: callback.h:1116
CallbackArg Callback
Definition: callback.h:567
void dispatch(typename Cgu::Param< FreeArgs >::ParamType...free_args) const
Definition: callback.h:1302
virtual ~CallbackArg()
Definition: callback.h:686
The callback interface class.
Definition: callback.h:567
#define CGU_GLIB_MEMORY_SLICES_FUNCS
Definition: cgu_config.h:84
A class used for tracking EmitterArg and SafeEmitterArg connections.
Definition: emitter.h:352
FunctorArg< T...> to_functor(const CallbackArg< T...> *cb)
Definition: callback.h:1218
void post(const Callback *cb, gint priority=G_PRIORITY_DEFAULT_IDLE, GMainContext *context=0)