5 #ifndef _SIGXMACROS_INTERNAL_TYPES_H_
6 #define _SIGXMACROS_INTERNAL_TYPES_H_
27 #include <sigc++/type_traits.h>
28 #include <sigc++/functors/functor_trait.h>
29 #include <sigc++/adaptors/deduce_result_type.h>
30 #include <sigc++/adaptors/adaptor_trait.h>
31 #include <sigc++/adaptors/bind.h>
32 #include <sigc++/adaptors/hide.h>
33 #include <sigc++/functors/slot_base.h>
41 #define SIGX_DISPATCH_WITH_FUNCTOR(T_functor)\
42 sigc::bind_functor<-1, sigc::hide_functor<-1, T_functor>, shared_dispatchable>
55 template <
typename T_arg1 = sigc::nil,
typename T_arg2 = sigc::nil,
typename T_arg3 = sigc::nil,
typename T_arg4 = sigc::nil,
typename T_arg5 = sigc::nil,
typename T_arg6 = sigc::nil,
typename T_arg7 = sigc::nil>
57 {
static const int value = 7; };
61 {
static const int value = 0; };
62 template <
typename T_arg1>
64 {
static const int value = 1; };
65 template <
typename T_arg1,
typename T_arg2>
67 {
static const int value = 2; };
68 template <
typename T_arg1,
typename T_arg2,
typename T_arg3>
70 {
static const int value = 3; };
71 template <
typename T_arg1,
typename T_arg2,
typename T_arg3,
typename T_arg4>
73 {
static const int value = 4; };
74 template <
typename T_arg1,
typename T_arg2,
typename T_arg3,
typename T_arg4,
typename T_arg5>
76 {
static const int value = 5; };
77 template <
typename T_arg1,
typename T_arg2,
typename T_arg3,
typename T_arg4,
typename T_arg5,
typename T_arg6>
79 {
static const int value = 6; };
94 template<
typename T_functor,
96 sigc::is_base_and_derived<sigx::tunnel_base, T_functor>::value,
98 sigc::is_base_and_derived<sigc::adaptor_base, T_functor>::value>
99 struct is_functor_tunneled;
105 template<
typename T_functor>
106 struct is_functor_tunneled<T_functor, true, true>
108 static const bool value =
true;
114 template<
typename T_functor>
115 struct is_functor_tunneled<T_functor, true, false>
117 static const bool value =
true;
124 template<
typename T_functor>
125 struct is_functor_tunneled<T_functor, false, false>
129 static const bool value =
false;
135 template<
typename T_functor>
136 struct is_functor_tunneled<T_functor, false, true>
143 static const bool value = is_functor_tunneled<adaptor_type>::value;
152 template<
typename T_functor>
153 struct is_functor_tunneled<sigc::adaptor_functor<T_functor>, false, true>
155 static const bool value = is_functor_tunneled<T_functor>::value;
174 bool I_isslot = sigc::is_base_and_derived<sigc::slot_base, T_functor>::value,
175 bool I_isadaptor = sigc::is_base_and_derived<sigc::adaptor_base, T_functor>::value>
176 struct is_or_adapts_slot;
182 template<
typename T_functor>
183 struct is_or_adapts_slot<T_functor, true, false>
185 static const bool value =
true;
192 template<
typename T_functor>
193 struct is_or_adapts_slot<T_functor, false, false>
197 static const bool value =
false;
203 template<
typename T_functor>
204 struct is_or_adapts_slot<T_functor, false, true>
211 static const bool value = is_or_adapts_slot<adaptor_type>::value;
220 template<
typename T_functor>
221 struct is_or_adapts_slot<sigc::adaptor_functor<T_functor>, false, true>
223 static const bool value = is_or_adapts_slot<T_functor>::value;
239 template<typename T_functor, bool I_isadapter = sigc::is_base_and_derived<sigc::adaptor_base, T_functor>::value>
240 struct dispatchable_constraint;
243 template<
typename T_functor>
244 struct dispatchable_constraint<T_functor, false>
246 static const dispatchable& find_dispatchable(
typename sigc::type_trait<T_functor>::take _A_func)
260 return _A_func.obj_.invoke();
265 template<
typename T_functor>
266 struct dispatchable_constraint<T_functor, true>
268 static const dispatchable& find_dispatchable(
typename sigc::type_trait<T_functor>::take _A_func)
270 return is_adaptor_dispatchable(_A_func);
276 template<
typename T_adapted_functor>
277 static const dispatchable& is_adaptor_dispatchable(
const sigc::adaptor_functor<T_adapted_functor>& _A_func)
279 return dispatchable_constraint<T_adapted_functor>::find_dispatchable(_A_func.functor_);
283 template<
typename T_adapted_functor>
287 return _A_func.bound1_.visit();
291 template<
typename T_adapted_functor>
292 static const dispatchable& is_adaptor_dispatchable(
const T_adapted_functor& _A_func)
295 typedef typename T_adapted_functor::adaptor_type adaptor_type;
297 return is_adaptor_dispatchable(_A_func.functor_);