EasyDelegate  2.0
Delegate and deferred callers for C++11.
Public Types | Public Member Functions | List of all members
EasyDelegate::DeferredStaticCaller< returnType, parameters > Class Template Reference

A deferred caller type for static methods. More...

#include <deferredcallers.hpp>

Inheritance diagram for EasyDelegate::DeferredStaticCaller< returnType, parameters >:
EasyDelegate::ITypedDeferredCaller< returnType > EasyDelegate::IDeferredCaller

Public Types

typedef returnType(* StaticDelegateMethodPointer) (parameters...)
 Helper typedef referring to a static function pointer.
 

Public Member Functions

 DeferredStaticCaller (const StaticDelegateMethodPointer methodPointer, parameters...params)
 Constructor accepting a pointer to a static method. More...
 
EASYDELEGATE_INLINE returnType dispatch (void) const
 Dispatches the DeferredStaticCaller. More...
 
EASYDELEGATE_INLINE void genericDispatch (void) const
 Dispatches the DeferredStaticCaller, ignoring the return value. More...
 
EASYDELEGATE_INLINE bool callsMethod (const StaticDelegateMethodPointer methodPointer) const noexcept
 Returns whether or not this DeferredStaticCaller calls the given static method address. More...
 
template<typename otherReturn , typename... otherParams>
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 signature. More...
 
template<typename otherClass , typename otherReturn , typename... otherParams>
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. More...
 
EASYDELEGATE_INLINE bool hasSameMethodAs (const DeferredStaticCaller< returnType, parameters...> *other) const noexcept
 Returns whether or not this DeferredStaticCaller calls the same method as the specified DeferredStaticCaller. More...
 
template<typename otherClass , typename otherReturn , typename... otherParams>
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 DeferredMemberCaller. More...
 
template<typename otherReturn , typename... otherParams>
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 a differing signature. More...
 
EASYDELEGATE_INLINE bool hasThisPointer (const void *thisPointer) const noexcept
 Returns whether or not this DeferredStaticCaller calls against the given this pointer. More...
 
template<typename otherClass , typename otherReturn , typename... otherParams>
EASYDELEGATE_INLINE bool hasSameThisPointerAs (const IDeferredCaller *other) const noexcept
 Returns whether or not this DeferredStaticCaller shares the same this pointer as the given IDeferredCaller. More...
 

Detailed Description

template<typename returnType, typename... parameters>
class EasyDelegate::DeferredStaticCaller< returnType, parameters >

A deferred caller type for static methods.

The DeferredStaticCaller class works by storing the information required to make a call against a static method in its data structure when constructed. The parameters are stored in an std::tuple and are later unpacked when the DeferredStaticCaller is dispatched.

Examples:
example.cpp.

Constructor & Destructor Documentation

template<typename returnType, typename... parameters>
EasyDelegate::DeferredStaticCaller< returnType, parameters >::DeferredStaticCaller ( const StaticDelegateMethodPointer  methodPointer,
parameters...  params 
)
inline

Constructor accepting a pointer to a static method.

Parameters
methodPointerA pointer to the member function to be invoked.
paramsThe parameter list to use when later dispatching this DeferredStaticCaller.

Member Function Documentation

template<typename returnType, typename... parameters>
EASYDELEGATE_INLINE bool EasyDelegate::DeferredStaticCaller< returnType, parameters >::callsMethod ( const StaticDelegateMethodPointer  methodPointer) const
inlinenoexcept

Returns whether or not this DeferredStaticCaller calls the given static method address.

Parameters
methodPointerA pointer to a static method to be checked against.
Returns
A boolean representing whether or not this DeferredStaticCaller calls the given method address.
template<typename returnType, typename... parameters>
template<typename otherReturn , typename... otherParams>
EASYDELEGATE_INLINE bool EasyDelegate::DeferredStaticCaller< returnType, parameters >::callsMethod ( const StaticMethodPointer< otherReturn, otherParams...>  methodPointer) const
inlinenoexcept

Returns whether or not this DeferredStaticCaller calls the given static method address of a differing signature.

Parameters
methodPointerA pointer to a static method to be checked against.
Returns
A boolean representing whether or not this DeferredStaticCaller calls the given method address.
Note
Always returns false because methods of different signatures should reside at their own addresses.
template<typename returnType, typename... parameters>
template<typename otherClass , typename otherReturn , typename... otherParams>
EASYDELEGATE_INLINE bool EasyDelegate::DeferredStaticCaller< returnType, parameters >::callsMethod ( const MemberMethodPointer< otherClass, otherReturn, otherParams...>  methodPointer) const
inlinenoexcept

Returns whether or not this DeferredStaticCaller calls the given class member method address.

Parameters
methodPointerA pointer to a class member method to be checked against.
Returns
A boolean representing whether or not this DeferredStaticCaller calls the given method address.
Note
Always returns false because DeferredStaticCaller types cannot call class member methods.
template<typename returnType, typename... parameters>
EASYDELEGATE_INLINE returnType EasyDelegate::DeferredStaticCaller< returnType, parameters >::dispatch ( void  ) const
inlinevirtual

Dispatches the DeferredStaticCaller.

This is equivalent to the invoke() method on all other delegate types except the parameters were cached at creation. Said cached parameters will be passed in automatically upon calling this, so it is completely safe to store.

Returns
Anything; it depends on the method signature defined in the template.

Implements EasyDelegate::ITypedDeferredCaller< returnType >.

template<typename returnType, typename... parameters>
EASYDELEGATE_INLINE void EasyDelegate::DeferredStaticCaller< returnType, parameters >::genericDispatch ( void  ) const
inlinevirtual

Dispatches the DeferredStaticCaller, ignoring the return value.

This behaves exactly as the dispatch method above except it does not care about the return of the called function. This method is also callable on the IDeferredCaller type, unlike the normal dispatch method.

Implements EasyDelegate::IDeferredCaller.

template<typename returnType, typename... parameters>
EASYDELEGATE_INLINE bool EasyDelegate::DeferredStaticCaller< returnType, parameters >::hasSameMethodAs ( const DeferredStaticCaller< returnType, parameters...> *  other) const
inlinenoexcept

Returns whether or not this DeferredStaticCaller calls the same method as the specified DeferredStaticCaller.

Parameters
otherA pointer to the DeferredStaticCaller to check against.
Returns
A boolean representing whether or not this DeferredStaticCaller calls the same method as the given DeferredStaticCaller.
template<typename returnType, typename... parameters>
template<typename otherClass , typename otherReturn , typename... otherParams>
EASYDELEGATE_INLINE bool EasyDelegate::DeferredStaticCaller< returnType, parameters >::hasSameMethodAs ( const DeferredMemberCaller< otherClass, otherReturn, otherParams...> *  other) const
inlinenoexcept

Returns whether or not this DeferredStaticCaller calls the same method as the specified DeferredMemberCaller.

Parameters
otherA pointer to the DeferredMemberCaller to check against.
Note
Always returns false because a static method and a member method should never share the same address.
template<typename returnType, typename... parameters>
template<typename otherReturn , typename... otherParams>
EASYDELEGATE_INLINE bool EasyDelegate::DeferredStaticCaller< returnType, parameters >::hasSameMethodAs ( const DeferredStaticCaller< otherReturn, otherParams...> *  other) const
inlinenoexcept

Returns whether or not this DeferredStaticCaller calls the same of the given DeferredStaticCaller of a differing signature.

Parameters
otherA pointer to a DeferredStaticCaller to be checked against.
Returns
A boolean representing whether or not the two DeferredStaticCaller instances call the same method.
Note
Always returns false because methods of different signatures should reside at their own addresses.
template<typename returnType, typename... parameters>
template<typename otherClass , typename otherReturn , typename... otherParams>
EASYDELEGATE_INLINE bool EasyDelegate::DeferredStaticCaller< returnType, parameters >::hasSameThisPointerAs ( const IDeferredCaller other) const
inlinenoexcept

Returns whether or not this DeferredStaticCaller shares the same this pointer as the given IDeferredCaller.

Parameters
otherA pointer to the IDeferredCaller to compare against.
Returns
A boolean representing whether or not this DeferredStaticCaller shares the same this pointer as the given IDeferredCaller.
Note
Always returns false for DeferredStaticCaller types because they do not use a this pointer.
template<typename returnType, typename... parameters>
EASYDELEGATE_INLINE bool EasyDelegate::DeferredStaticCaller< returnType, parameters >::hasThisPointer ( const void *  thisPointer) const
inlinevirtualnoexcept

Returns whether or not this DeferredStaticCaller calls against the given this pointer.

Parameters
thisPointerA pointer referring to the object of interest.
Returns
A boolean representing whether or not this DeferredStaticCaller calls a member function against the given this pointer.
Note
Always returns false for DeferredStaticCaller types because they do not use a this pointer.

Reimplemented from EasyDelegate::IDeferredCaller.


The documentation for this class was generated from the following file: