114class Dispatcher1Function:
public Dispatcher1<P1>
118 typedef FunctionType TFunction;
119 typedef Dispatcher1Function<P1, FunctionType, Enable> TSelf;
121 Dispatcher1Function(
typename CallTraits<TFunction>::TParam iFunction):
126 const TFunction& function()
const
133 void doCall(
typename util::CallTraits<P1>::TParam iP1)
const override
142 bool doIsEquivalent(
const Dispatcher1<P1>* other)
const override
144 if constexpr (impl::IsEqualityComparable<TFunction>::value)
146 return other &&
typeid( *other ) ==
typeid( TSelf )
147 &&
static_cast<const TSelf*
>(other)->function_ == function_;
225class Dispatcher1Method:
public Dispatcher1<P1>
229 typedef Dispatcher1Method<P1, ObjectPtr, Method> TSelf;
231 Dispatcher1Method(
typename CallTraits<ObjectPtr>::TParam iObject,
232 typename CallTraits<Method>::TParam iMethod):
240 void doCall(
typename util::CallTraits<P1>::TParam iP1)
const override
242 if (!object_ || !method_)
246 ((*object_).*method_)(iP1);
249 bool doIsEquivalent(
const Dispatcher1<P1>* iOther)
const override
251 const TSelf* other =
dynamic_cast<const TSelf*
>(iOther);
252 return other && object_ == other->object_ && method_ == other->method_;