annotate DEPENDENCIES/generic/include/boost/signals2/detail/signals_common_macros.hpp @ 125:34e428693f5d vext

Vext -> Repoint
author Chris Cannam
date Thu, 14 Jun 2018 11:15:39 +0100
parents c530137014c0
children
rev   line source
Chris@16 1 /*
Chris@16 2 Author: Frank Mori Hess <fmhess@users.sourceforge.net>
Chris@16 3 Begin: 2007-01-23
Chris@16 4 */
Chris@16 5 // Copyright Frank Mori Hess 2007-2008
Chris@16 6 // Use, modification and
Chris@16 7 // distribution is subject to the Boost Software License, Version
Chris@16 8 // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
Chris@16 9 // http://www.boost.org/LICENSE_1_0.txt)
Chris@16 10
Chris@16 11 #ifndef BOOST_SIGNALS2_SIGNALS_COMMON_MACROS_HPP
Chris@16 12 #define BOOST_SIGNALS2_SIGNALS_COMMON_MACROS_HPP
Chris@16 13
Chris@16 14 #include <boost/config.hpp>
Chris@16 15
Chris@16 16 #ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES
Chris@16 17
Chris@16 18 #ifndef BOOST_SIGNALS2_MAX_ARGS
Chris@16 19 #define BOOST_SIGNALS2_MAX_ARGS 9
Chris@16 20 #endif
Chris@16 21
Chris@16 22 // signaln
Chris@16 23 #define BOOST_SIGNALS2_SIGNAL_CLASS_NAME(arity) BOOST_PP_CAT(signal, arity)
Chris@16 24 // weak_signaln
Chris@16 25 #define BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(arity) BOOST_PP_CAT(weak_, BOOST_SIGNALS2_SIGNAL_CLASS_NAME(arity))
Chris@16 26 // signaln_impl
Chris@16 27 #define BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(arity) BOOST_PP_CAT(BOOST_SIGNALS2_SIGNAL_CLASS_NAME(arity), _impl)
Chris@16 28 // argn
Chris@16 29 #define BOOST_SIGNALS2_SIGNATURE_ARG_NAME(z, n, data) BOOST_PP_CAT(arg, BOOST_PP_INC(n))
Chris@16 30 // Tn argn
Chris@16 31 #define BOOST_SIGNALS2_SIGNATURE_FULL_ARG(z, n, data) \
Chris@16 32 BOOST_PP_CAT(T, BOOST_PP_INC(n)) BOOST_SIGNALS2_SIGNATURE_ARG_NAME(~, n, ~)
Chris@16 33 // T1 arg1, T2 arg2, ..., Tn argn
Chris@16 34 #define BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(arity) \
Chris@16 35 BOOST_PP_ENUM(arity, BOOST_SIGNALS2_SIGNATURE_FULL_ARG, ~)
Chris@16 36 // arg1, arg2, ..., argn
Chris@16 37 #define BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(arity) BOOST_PP_ENUM(arity, BOOST_SIGNALS2_SIGNATURE_ARG_NAME, ~)
Chris@16 38 // T1, T2, ..., TN
Chris@16 39 #define BOOST_SIGNALS2_ARGS_TEMPLATE_INSTANTIATION(arity) \
Chris@16 40 BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), T)
Chris@16 41 // R (T1, T2, ..., TN)
Chris@16 42 #define BOOST_SIGNALS2_SIGNATURE_FUNCTION_TYPE(arity) \
Chris@16 43 R ( BOOST_SIGNALS2_ARGS_TEMPLATE_INSTANTIATION(arity) )
Chris@16 44 // typename prefixR, typename prefixT1, typename prefixT2, ..., typename prefixTN
Chris@16 45 #define BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_DECL(arity, prefix) \
Chris@16 46 typename BOOST_PP_CAT(prefix, R) BOOST_PP_COMMA_IF(arity) \
Chris@16 47 BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), typename BOOST_PP_CAT(prefix, T))
Chris@16 48 // typename R, typename T1, typename T2, ..., typename TN
Chris@16 49 #define BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(arity) \
Chris@16 50 typename R BOOST_PP_COMMA_IF(arity) \
Chris@16 51 BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), typename T)
Chris@16 52 // typename prefixT1, typename prefixT2, ..., typename prefixTN
Chris@16 53 #define BOOST_SIGNALS2_PREFIXED_ARGS_TEMPLATE_DECL(arity, prefix) \
Chris@16 54 BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), typename BOOST_PP_CAT(prefix, T))
Chris@16 55 // typename T1, typename T2, ..., typename TN
Chris@16 56 #define BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(arity) \
Chris@16 57 BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), typename T)
Chris@16 58 // prefixR, prefixT1, prefixT2, ..., prefixTN
Chris@16 59 #define BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_INSTANTIATION(arity, prefix) \
Chris@16 60 BOOST_PP_CAT(prefix, R) BOOST_PP_COMMA_IF(arity) BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), BOOST_PP_CAT(prefix, T))
Chris@16 61 // R, T1, T2, ..., TN
Chris@16 62 #define BOOST_SIGNALS2_SIGNATURE_TEMPLATE_INSTANTIATION(arity) \
Chris@16 63 R BOOST_PP_COMMA_IF(arity) BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), T)
Chris@16 64 // boost::functionN<R, T1, T2, ..., TN>
Chris@16 65 #define BOOST_SIGNALS2_FUNCTION_N_DECL(arity) BOOST_PP_CAT(boost::function, arity)<\
Chris@16 66 BOOST_SIGNALS2_SIGNATURE_TEMPLATE_INSTANTIATION(arity) >
Chris@16 67 // R, const boost::signals2::connection&, T1, T2, ..., TN
Chris@16 68 #define BOOST_SIGNALS2_EXT_SLOT_TEMPLATE_INSTANTIATION(arity) \
Chris@16 69 R, const boost::signals2::connection& BOOST_PP_COMMA_IF(arity) \
Chris@16 70 BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(arity), T)
Chris@16 71 // boost::functionN<R, const boost::signals2::connection &, T1, T2, ..., TN>
Chris@16 72 #define BOOST_SIGNALS2_EXT_FUNCTION_N_DECL(arity) BOOST_PP_CAT(boost::function, BOOST_PP_INC(arity))<\
Chris@16 73 BOOST_SIGNALS2_EXT_SLOT_TEMPLATE_INSTANTIATION(arity) >
Chris@16 74 // slotN
Chris@16 75 #define BOOST_SIGNALS2_SLOT_CLASS_NAME(arity) BOOST_PP_CAT(slot, arity)
Chris@16 76 // slotN+1<R, const connection &, T1, T2, ..., TN, extended_slot_function_type>
Chris@16 77 #define BOOST_SIGNALS2_EXTENDED_SLOT_TYPE(arity) \
Chris@16 78 BOOST_SIGNALS2_SLOT_CLASS_NAME(BOOST_PP_INC(arity))< \
Chris@16 79 BOOST_SIGNALS2_EXT_SLOT_TEMPLATE_INSTANTIATION(arity), \
Chris@16 80 extended_slot_function_type>
Chris@16 81 // bound_extended_slot_functionN
Chris@16 82 #define BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N(arity) BOOST_PP_CAT(bound_extended_slot_function, arity)
Chris@16 83 // bound_extended_slot_function_helperN
Chris@16 84 #define BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_INVOKER_N(arity) BOOST_PP_CAT(bound_extended_slot_function_invoker, arity)
Chris@16 85 // typename function_traits<Signature>::argn_type
Chris@16 86 #define BOOST_SIGNALS2_SIGNATURE_TO_ARGN_TYPE(z, n, Signature) \
Chris@16 87 BOOST_PP_CAT(BOOST_PP_CAT(typename function_traits<Signature>::arg, BOOST_PP_INC(n)), _type)
Chris@16 88 // typename function_traits<Signature>::result_type,
Chris@16 89 // typename function_traits<Signature>::arg1_type,
Chris@16 90 // typename function_traits<Signature>::arg2_type,
Chris@16 91 // ...,
Chris@16 92 // typename function_traits<Signature>::argn_type
Chris@16 93 #define BOOST_SIGNALS2_PORTABLE_SIGNATURE(arity, Signature) \
Chris@16 94 typename function_traits<Signature>::result_type \
Chris@16 95 BOOST_PP_COMMA_IF(arity) BOOST_PP_ENUM(arity, BOOST_SIGNALS2_SIGNATURE_TO_ARGN_TYPE, Signature)
Chris@16 96 // prefixTn & argn
Chris@16 97 #define BOOST_SIGNALS2_PREFIXED_FULL_REF_ARG(z, n, prefix) \
Chris@16 98 BOOST_PP_CAT(BOOST_PP_CAT(prefix, T), BOOST_PP_INC(n)) & BOOST_SIGNALS2_SIGNATURE_ARG_NAME(~, n, ~)
Chris@16 99 // prefixT1 & arg1, prefixT2 & arg2, ..., prefixTn & argn
Chris@16 100 #define BOOST_SIGNALS2_PREFIXED_FULL_REF_ARGS(arity, prefix) \
Chris@16 101 BOOST_PP_ENUM(arity, BOOST_SIGNALS2_PREFIXED_FULL_REF_ARG, prefix)
Chris@16 102 // Tn & argn
Chris@101 103 #define BOOST_SIGNALS2_FULL_CREF_ARG(z, n, data) \
Chris@101 104 const BOOST_PP_CAT(T, BOOST_PP_INC(n)) & BOOST_SIGNALS2_SIGNATURE_ARG_NAME(~, n, ~)
Chris@101 105 // const T1 & arg1, const T2 & arg2, ..., const Tn & argn
Chris@101 106 #define BOOST_SIGNALS2_FULL_FORWARD_ARGS(arity) \
Chris@101 107 BOOST_PP_ENUM(arity, BOOST_SIGNALS2_FULL_CREF_ARG, ~)
Chris@101 108 #define BOOST_SIGNALS2_FORWARDED_ARGS(arity) \
Chris@101 109 BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(arity)
Chris@16 110 // preprocessed_arg_typeN
Chris@16 111 #define BOOST_SIGNALS2_PREPROCESSED_ARG_N_TYPE_CLASS_NAME(arity) BOOST_PP_CAT(preprocessed_arg_type, arity)
Chris@16 112
Chris@16 113 // typename R, typename T1, typename T2, ..., typename TN, typename SlotFunction
Chris@16 114 #define BOOST_SIGNALS2_SLOT_TEMPLATE_SPECIALIZATION_DECL(arity) \
Chris@16 115 BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(arity), \
Chris@16 116 typename SlotFunction
Chris@16 117 #define BOOST_SIGNALS2_SLOT_TEMPLATE_SPECIALIZATION
Chris@16 118
Chris@16 119 // typename R, typename T1, typename T2, ..., typename TN, typename Combiner, ...
Chris@16 120 #define BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL(arity) \
Chris@16 121 BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(arity), \
Chris@16 122 typename Combiner, \
Chris@16 123 typename Group, \
Chris@16 124 typename GroupCompare, \
Chris@16 125 typename SlotFunction, \
Chris@16 126 typename ExtendedSlotFunction, \
Chris@16 127 typename Mutex
Chris@16 128 // typename R, typename T1, typename T2, ..., typename TN, typename Combiner = optional_last_value<R>, ...
Chris@16 129 #define BOOST_SIGNALS2_SIGNAL_TEMPLATE_DEFAULTED_DECL(arity) \
Chris@16 130 BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(arity), \
Chris@16 131 typename Combiner = optional_last_value<R>, \
Chris@16 132 typename Group = int, \
Chris@16 133 typename GroupCompare = std::less<Group>, \
Chris@16 134 typename SlotFunction = BOOST_SIGNALS2_FUNCTION_N_DECL(arity), \
Chris@16 135 typename ExtendedSlotFunction = BOOST_SIGNALS2_EXT_FUNCTION_N_DECL(arity), \
Chris@16 136 typename Mutex = signals2::mutex
Chris@16 137 #define BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION_DECL(arity) BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL(arity)
Chris@16 138 #define BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION
Chris@16 139
Chris@16 140 #define BOOST_SIGNALS2_STD_FUNCTIONAL_BASE(result_type) std_functional_base
Chris@16 141
Chris@16 142 #define BOOST_SIGNALS2_PP_COMMA_IF(arity) BOOST_PP_COMMA_IF(arity)
Chris@16 143
Chris@16 144 #else // BOOST_NO_CXX11_VARIADIC_TEMPLATES
Chris@16 145
Chris@16 146 #define BOOST_SIGNALS2_SIGNAL_CLASS_NAME(arity) signal
Chris@16 147 #define BOOST_SIGNALS2_WEAK_SIGNAL_CLASS_NAME(arity) weak_signal
Chris@16 148 #define BOOST_SIGNALS2_SIGNAL_IMPL_CLASS_NAME(arity) signal_impl
Chris@16 149 #define BOOST_SIGNALS2_SIGNATURE_TEMPLATE_DECL(arity) typename Signature
Chris@16 150 #define BOOST_SIGNALS2_ARGS_TEMPLATE_INSTANTIATION(arity) Args...
Chris@16 151 #define BOOST_SIGNALS2_SIGNATURE_TEMPLATE_INSTANTIATION(arity) R (Args...)
Chris@16 152 #define BOOST_SIGNALS2_SIGNATURE_FUNCTION_TYPE(arity) R (Args...)
Chris@16 153 #define BOOST_SIGNALS2_ARGS_TEMPLATE_DECL(arity) typename ... Args
Chris@101 154 #define BOOST_SIGNALS2_FULL_FORWARD_ARGS(arity) Args && ... args
Chris@101 155 #define BOOST_SIGNALS2_FORWARDED_ARGS(arity) std::forward<Args>(args)...
Chris@16 156 #define BOOST_SIGNALS2_SLOT_CLASS_NAME(arity) slot
Chris@16 157 #define BOOST_SIGNALS2_EXTENDED_SLOT_TYPE(arity) slot<R (const connection &, Args...), extended_slot_function_type>
Chris@16 158 #define BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_N(arity) bound_extended_slot_function
Chris@16 159 #define BOOST_SIGNALS2_BOUND_EXTENDED_SLOT_FUNCTION_INVOKER_N(arity) bound_extended_slot_function_invoker
Chris@16 160 #define BOOST_SIGNALS2_FUNCTION_N_DECL(arity) boost::function<Signature>
Chris@16 161 #define BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_DECL(arity, prefix) typename prefixSignature
Chris@16 162 #define BOOST_SIGNALS2_PREFIXED_SIGNATURE_TEMPLATE_INSTANTIATION(arity, prefix) prefixSignature
Chris@16 163 #define BOOST_SIGNALS2_SIGNATURE_FULL_ARGS(arity) Args ... args
Chris@16 164 #define BOOST_SIGNALS2_SIGNATURE_ARG_NAMES(arity) args...
Chris@16 165 #define BOOST_SIGNALS2_PORTABLE_SIGNATURE(arity, Signature) Signature
Chris@16 166
Chris@16 167 #define BOOST_SIGNALS2_SLOT_TEMPLATE_SPECIALIZATION_DECL(arity) \
Chris@16 168 typename SlotFunction, \
Chris@16 169 typename R, \
Chris@16 170 typename ... Args
Chris@16 171 #define BOOST_SIGNALS2_SLOT_TEMPLATE_SPECIALIZATION \
Chris@16 172 <R (Args...), SlotFunction>
Chris@16 173
Chris@16 174 #define BOOST_SIGNALS2_SIGNAL_TEMPLATE_DECL(arity) \
Chris@16 175 typename Signature, \
Chris@16 176 typename Combiner, \
Chris@16 177 typename Group, \
Chris@16 178 typename GroupCompare, \
Chris@16 179 typename SlotFunction, \
Chris@16 180 typename ExtendedSlotFunction, \
Chris@16 181 typename Mutex
Chris@16 182 #define BOOST_SIGNALS2_SIGNAL_TEMPLATE_DEFAULTED_DECL(arity) \
Chris@16 183 typename Signature, \
Chris@16 184 typename Combiner = optional_last_value<typename boost::function_traits<Signature>::result_type>, \
Chris@16 185 typename Group = int, \
Chris@16 186 typename GroupCompare = std::less<Group>, \
Chris@16 187 typename SlotFunction = boost::function<Signature>, \
Chris@16 188 typename ExtendedSlotFunction = typename detail::variadic_extended_signature<Signature>::function_type, \
Chris@16 189 typename Mutex = signals2::mutex
Chris@16 190 #define BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION_DECL(arity) \
Chris@16 191 typename Combiner, \
Chris@16 192 typename Group, \
Chris@16 193 typename GroupCompare, \
Chris@16 194 typename SlotFunction, \
Chris@16 195 typename ExtendedSlotFunction, \
Chris@16 196 typename Mutex, \
Chris@16 197 typename R, \
Chris@16 198 typename ... Args
Chris@16 199 #define BOOST_SIGNALS2_SIGNAL_TEMPLATE_SPECIALIZATION <\
Chris@16 200 R (Args...), \
Chris@16 201 Combiner, \
Chris@16 202 Group, \
Chris@16 203 GroupCompare, \
Chris@16 204 SlotFunction, \
Chris@16 205 ExtendedSlotFunction, \
Chris@16 206 Mutex>
Chris@16 207
Chris@16 208 #define BOOST_SIGNALS2_STD_FUNCTIONAL_BASE(result_type) \
Chris@16 209 std_functional_base<result_type , Args...>
Chris@16 210
Chris@16 211 #define BOOST_SIGNALS2_PP_COMMA_IF(arity) ,
Chris@16 212
Chris@16 213 #endif // BOOST_NO_CXX11_VARIADIC_TEMPLATES
Chris@16 214
Chris@16 215 #endif // BOOST_SIGNALS2_SIGNALS_COMMON_MACROS_HPP