43#ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_IMPL_DISPATCHER_0_H
44#define LASS_GUARDIAN_OF_INCLUSION_UTIL_IMPL_DISPATCHER_0_H
63class Dispatcher0:
public TDispatcherAllocatorBase
68 virtual ~Dispatcher0() {}
73 bool isEquivalent(
const Dispatcher0* iOther)
const
75 return doIsEquivalent(iOther);
80 Dispatcher0(
const Dispatcher0& ) {}
84 virtual void doCall()
const = 0;
85 virtual bool doIsEquivalent(
const Dispatcher0* iOther)
const = 0;
87 Dispatcher0& operator=(
const Dispatcher0& iOther);
100 typename Enable =
void
102class Dispatcher0Function:
public Dispatcher0
106 typedef Dispatcher0Function<Function, Enable> TSelf;
107 typedef Function TFunction;
109 Dispatcher0Function(
typename CallTraits<TFunction>::TParam iFunction):
114 const TFunction& function()
const
121 void doCall()
const override
129 bool doIsEquivalent(
const Dispatcher0* other)
const override
131 if constexpr (impl::IsEqualityComparable<TFunction>::value)
133 return other &&
typeid( *other ) ==
typeid( TSelf )
134 &&
static_cast<const TSelf*
>(other)->function_ == function_;
147#if LASS_HAVE_CPP_STD_11 && !LASS_HAVE_LAMBDA_OPERATOR_NOT
167 typedef Function TFunction;
174 const TFunction& function()
const
181 void doCall()
const override
185 bool doIsEquivalent(
const Dispatcher0* )
const override
207class Dispatcher0Method:
public Dispatcher0
211 typedef Dispatcher0Method<ObjectPtr, Method> TSelf;
212 typedef ObjectPtr TObjectPtr;
213 typedef Method TMethod;
215 Dispatcher0Method(
typename CallTraits<TObjectPtr>::TParam iObject,
216 typename CallTraits<TMethod>::TParam iMethod):
224 void doCall()
const override
226 if (!object_ || !method_)
230 ((*object_).*method_)();
233 bool doIsEquivalent(
const Dispatcher0* iOther)
const override
235 const TSelf* other =
dynamic_cast<const TSelf*
>(iOther);
236 return other && object_ == other->object_ && method_ == other->method_;
Dispatcher for lass::util::Callback0 to a fuction or equivalent callable entity.
abstract base class of all dispatchers for lass::util::Callback0.
general utility, debug facilities, ...
Library for Assembled Shared Sources.