13 #ifndef EASYDELEGATE_NO_DEFERRED_CALLING
14 #ifndef _INCLUDE_EASYDELEGATE_DEFERREDCALLERS_HPP_
15 #define _INCLUDE_EASYDELEGATE_DEFERREDCALLERS_HPP_
52 template <
typename returnType>
65 template <
typename className,
typename returnType,
typename... parameters>
75 template <
typename returnType,
typename... parameters>
89 mParameters(params...), mMethodPointer(methodPointer) { }
101 assert(mMethodPointer);
106 return performCachedCall(
typename gens<
sizeof...(parameters)>::type());
132 template <
typename otherReturn,
typename... otherParams>
142 template <
typename otherClass,
typename otherReturn,
typename... otherParams>
161 template <
typename otherClass,
typename otherReturn,
typename... otherParams>
171 template <
typename otherReturn,
typename... otherParams>
191 template <
typename otherClass,
typename otherReturn,
typename... otherParams>
200 return (mMethodPointer)(std::get<S>(mParameters) ...);
218 template <
typename classType,
typename returnType,
typename... parameters>
219 class DeferredMemberCaller :
public ITypedDeferredCaller<returnType>
238 mThisPointer(thisPointer), mParameters(params...), mMethodPointer(methodPointer) { }
251 assert(mMethodPointer);
259 return performCachedCall(
typename gens<
sizeof...(parameters)>::type());
285 template <
typename otherClass,
typename otherReturn,
typename... otherParams>
294 template <
typename otherReturn,
typename... otherParams>
315 template <
typename otherClass,
typename otherReturn,
typename... otherParams>
325 template <
typename otherReturn,
typename... otherParams>
333 template <
typename otherClass,
typename otherReturn,
typename... otherParams>
343 template <
typename otherReturn,
typename... otherParams>
365 assert(mThisPointer);
370 return (mThisPointer->*mMethodPointer)(std::get<S>(mParameters) ...);
382 #endif // _INCLUDE_EASYDELEGATE_DEFERREDCALLERS_HPP_
383 #endif // EASYDELEGATE_NO_DEFERRED_CALLING
EASYDELEGATE_INLINE bool callsMethod(const StaticDelegateMethodPointer methodPointer) const noexcept
Returns whether or not this DeferredStaticCaller calls the given static method address.
Definition: deferredcallers.hpp:123
returnType(* StaticDelegateMethodPointer)(parameters...)
Helper typedef referring to a static function pointer.
Definition: deferredcallers.hpp:81
returnType(className::*)(parameters...) MemberMethodPointer
Helper typedef to a pointer of a class member method with the given signature.
Definition: types.hpp:69
#define EASYDELEGATE_CONSTEXPR
A macro that is used to declare constexpr to something that is compatible with the compiler...
Definition: easydelegate.hpp:25
EASYDELEGATE_INLINE returnType dispatch(void) const
Dispatches the DeferredStaticCaller.
Definition: deferredcallers.hpp:99
EASYDELEGATE_INLINE bool callsMethod(const MemberMethodPointer< otherClass, otherReturn, otherParams...> methodPointer) const noexcept
Returns whether or not this DeferredStaticCaller calls the given class member method address...
Definition: deferredcallers.hpp:143
returnType(*)(parameters...) StaticMethodPointer
Helper typedef to a pointer of a static method with the given signature.
Definition: types.hpp:65
An exception type that is thrown by the EasyDelegate library when any delegate type has attempted to ...
Definition: exceptions.hpp:51
virtual EASYDELEGATE_INLINE void genericDispatch(void) const =0
Invoke the deferred caller and ignore the return value.
classType * mThisPointer
A pointer to the this object to invoke against.
Definition: deferredcallers.hpp:357
EASYDELEGATE_INLINE bool hasThisPointer(const void *thisPointer) const noexcept
Returns whether or not this DeferredStaticCaller calls against the given this pointer.
Definition: deferredcallers.hpp:181
MemberMethodPointer< classType, returnType, parameters...> MemberDelegateMethodPointer
Helper typedef referring to a class member method pointer.
Definition: deferredcallers.hpp:224
Namespace containing all EasyDelegate functionality.
Definition: deferredcallers.hpp:20
DeferredStaticCaller(const StaticDelegateMethodPointer methodPointer, parameters...params)
Constructor accepting a pointer to a static method.
Definition: deferredcallers.hpp:88
DeferredMemberCaller(const MemberDelegateMethodPointer methodPointer, classType *thisPointer, parameters...params)
Constructor accepting a this pointer and a member method.
Definition: deferredcallers.hpp:237
#define EASYDELEGATE_INLINE
A preprocessor definition for a keyword that forces the inlining of a given method.
Definition: easydelegate.hpp:33
EASYDELEGATE_INLINE bool hasSameMethodAs(const DeferredStaticCaller< returnType, parameters...> *other) const noexcept
Returns whether or not this DeferredStaticCaller calls the same method as the specified DeferredStati...
Definition: deferredcallers.hpp:152
EASYDELEGATE_INLINE void genericDispatch(void) const
Dispatches the DeferredMemberCaller, ignoring the return value.
Definition: deferredcallers.hpp:268
EASYDELEGATE_INLINE bool hasSameMethodAs(const DeferredStaticCaller< otherReturn, otherParams...> *other) const noexcept
Returns whether or not this DeferredMemberCaller calls the same method as DeferredStaticCaller.
Definition: deferredcallers.hpp:326
EASYDELEGATE_INLINE bool callsMethod(const StaticMethodPointer< otherReturn, otherParams...> methodPointer) const noexcept
Returns whether or not this DeferredStaticCaller calls the given static method address of a differing...
Definition: deferredcallers.hpp:133
std::tuple< typename std::remove_reference< typenames >::type...> NoReferenceTuple
A helper typedef for an std::tuple that removes the reference from referenced types.
Definition: types.hpp:60
EASYDELEGATE_INLINE bool callsMethod(const MemberMethodPointer< otherClass, otherReturn, otherParams...> methodPointer) const noexcept
Returns whether or not this DeferredMemberCaller calls the given class member method of a differing s...
Definition: deferredcallers.hpp:286
EASYDELEGATE_INLINE bool hasSameThisPointerAs(const DeferredStaticCaller< otherReturn, otherParams...> *other) const noexcept
Returns whether or not this DeferredMemberCaller calls against the same this pointer of the DeferredS...
Definition: deferredcallers.hpp:344
The most generic of the deferred caller types. All deferred callers eventually trace back to this cla...
Definition: deferredcallers.hpp:28
EASYDELEGATE_INLINE bool hasSameMethodAs(const DeferredMemberCaller< otherClass, otherReturn, otherParams...> *other) const noexcept
Returns whether or not this DeferredMemberCaller calls the same method as another DeferredMemberCalle...
Definition: deferredcallers.hpp:316
EASYDELEGATE_INLINE bool hasSameMethodAs(const DeferredMemberCaller< otherClass, otherReturn, otherParams...> *other) const noexcept
Returns whether or not this DeferredStaticCaller calls the same method as the specified DeferredMembe...
Definition: deferredcallers.hpp:162
A deferred caller type for class member methods.
Definition: deferredcallers.hpp:66
EASYDELEGATE_INLINE bool hasSameMethodAs(const DeferredStaticCaller< otherReturn, otherParams...> *other) const noexcept
Returns whether or not this DeferredStaticCaller calls the same of the given DeferredStaticCaller of ...
Definition: deferredcallers.hpp:172
EASYDELEGATE_INLINE bool callsMethod(const StaticMethodPointer< otherReturn, otherParams...> methodPointer) const noexcept
Returns whether or not this DeferredMemberCaller calls the given static method.
Definition: deferredcallers.hpp:295
EASYDELEGATE_INLINE returnType dispatch(void) const
Dispatches the DeferredMemberCaller.
Definition: deferredcallers.hpp:248
EASYDELEGATE_INLINE bool callsMethod(const MemberDelegateMethodPointer methodPointer) const noexcept
Returns whether or not this DeferredMemberCaller calls the given class member method.
Definition: deferredcallers.hpp:275
virtual EASYDELEGATE_INLINE bool hasThisPointer(const void *thisPointer) const noexcept
Returns whether or not this deferred caller calls against the given this pointer. ...
Definition: deferredcallers.hpp:44
EASYDELEGATE_INLINE bool hasSameThisPointerAs(const IDeferredCaller *other) const noexcept
Returns whether or not this DeferredStaticCaller shares the same this pointer as the given IDeferredC...
Definition: deferredcallers.hpp:192
An exception type that is thrown by the EasyDelegate library when a member delegate type has attempte...
Definition: exceptions.hpp:31
EASYDELEGATE_INLINE void genericDispatch(void) const
Dispatches the DeferredStaticCaller, ignoring the return value.
Definition: deferredcallers.hpp:115
A less generic deferred caller type that retains return type information. Use this if you don't care ...
Definition: deferredcallers.hpp:53
EASYDELEGATE_INLINE bool hasThisPointer(const void *thisPointer) const noexcept
Returns whether or not this DeferredMemberCaller calls against the given this pointer.
Definition: deferredcallers.hpp:352
virtual EASYDELEGATE_INLINE returnType dispatch(void) const =0
Invoke the deferred caller and return the result to the calling method.
A deferred caller type for static methods.
Definition: deferredcallers.hpp:76
EASYDELEGATE_INLINE bool hasSameMethodAs(const DeferredMemberCaller< classType, returnType, parameters...> *other) const noexcept
Returns whether or not this DeferredMemberCaller calls the same method as another DeferredMemberCalle...
Definition: deferredcallers.hpp:304
EASYDELEGATE_INLINE bool hasSameThisPointerAs(const DeferredMemberCaller< otherClass, otherReturn, otherParams...> *other) const noexcept
Returns whether or not this DeferredMemberCaller calls against the same this pointer as another...
Definition: deferredcallers.hpp:334