EasyDelegate
2.0
Delegate and deferred callers for C++11.
|
A delegate of a static method. More...
#include <delegates.hpp>
Public Types | |
typedef StaticMethodPointer< returnType, parameters...> | MethodPointer |
Helper typedef referring to a static method pointer that is compatible with this delegate. | |
Public Types inherited from EasyDelegate::ITypedDelegate< returnType, parameters...> | |
typedef returnType | ReturnType |
Helper typedef referring to the return type of this delegate. | |
typedef StaticDelegate< returnType, parameters...> | StaticDelegateType |
Helper typedef for when building static delegates. | |
using | MemberDelegateType = MemberDelegate< classType, returnType, parameters...> |
Helper typedef for when building member delegates. | |
typedef StaticMethodPointer< returnType, parameters...> | StaticMethodPointerType |
Helper typedef referring to a static function pointer. | |
using | MemberDelegateFuncPtr = returnType(classType::*)(parameters...) |
Helper typedef referring to a class member method pointer. | |
Public Member Functions | |
StaticDelegate (const MethodPointer methodPointer) | |
Constructor accepting a static method. More... | |
StaticDelegate (const StaticDelegate< returnType, parameters...> *other) | |
Standard copy constructor. More... | |
returnType | invoke (parameters...params) |
Invokes the StaticDelegate. More... | |
EASYDELEGATE_INLINE bool | hasThisPointer (const void *thisPointer) const noexcept |
Returns whether or not this StaticDelegate calls against the given this pointer. More... | |
EASYDELEGATE_INLINE bool | callsMethod (const MethodPointer methodPointer) const noexcept |
Returns whether or not this StaticDelegate calls the given static method. 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 StaticDelegate calls the given class member method. More... | |
EASYDELEGATE_INLINE bool | hasSameMethodAs (const StaticDelegate< returnType, parameters...> *other) const noexcept |
Returns whether or not this StaticDelegate calls the same method as the StaticDelegate we are checking against. More... | |
template<typename otherClass , typename otherReturn , typename... otherParams> | |
EASYDELEGATE_INLINE bool | hasSameMethodAs (const MemberDelegate< otherClass, otherReturn, otherParams...> *other) const noexcept |
Returns whether or not this StaticDelegate calls against the same method as the MemberDelegate we are checking against. More... | |
template<typename otherReturn , typename... otherParams> | |
EASYDELEGATE_INLINE bool | hasSameMethodAs (const StaticDelegate< otherReturn, otherParams...> *other) const noexcept |
Returns whether or not this StaticDelegate calls against the same method as the StaticDelegate we are checking against. More... | |
template<typename otherClass , typename otherReturn , typename... otherParams> | |
EASYDELEGATE_INLINE bool | hasSameThisPointerAs (const MemberDelegate< otherClass, otherReturn, otherParams...> *other) const noexcept |
Returns whether or not this StaticDelegate uses the same this pointer as the MemberDelegate we are checking against. More... | |
template<typename otherReturn , typename... otherParams> | |
EASYDELEGATE_INLINE bool | hasSameThisPointerAs (const StaticDelegate< otherReturn, otherParams...> *other) const noexcept |
Returns whether or not this StaticDelegate uses the same this pointer as the StaticDelegate we are checking against. More... | |
Public Member Functions inherited from EasyDelegate::ITypedDelegate< returnType, parameters...> | |
ITypedDelegate (const bool &isMemberDelegate) noexcept | |
Constructor accepting a boolean. More... | |
bool | callsMethod (const MemberDelegateFuncPtr< className > methodPointer) const noexcept |
Returns whether or not this delegate calls the given class member method address. More... | |
Additional Inherited Members | |
Public Attributes inherited from EasyDelegate::IDelegate | |
const bool | mIsMemberDelegate |
A boolean representing whether or not this delegate is a member delegate. | |
Protected Member Functions inherited from EasyDelegate::IDelegate | |
IDelegate (const bool &isMemberDelegate) noexcept | |
Constructor accepting a boolean. More... | |
A delegate of a static method.
A static delegate allows you to create a sort of handle to a given static method. This handle can then be used to invoke the method anonymously.
|
inline |
Constructor accepting a static method.
methodPointer | The address of the static method that this delegate is intended to invoke. |
|
inline |
Standard copy constructor.
other | A pointer to a StaticDelegate with the same method signature to copy. |
|
inlinevirtualnoexcept |
Returns whether or not this StaticDelegate calls the given static method.
methodPointer | A pointer to the static method to be checked against. |
Implements EasyDelegate::ITypedDelegate< returnType, parameters...>.
|
inlinenoexcept |
Returns whether or not this StaticDelegate calls the given class member method.
methodPointer | A pointer to the class member method to be checked against. |
|
inlinenoexcept |
Returns whether or not this StaticDelegate calls the same method as the StaticDelegate we are checking against.
other | The other StaticDelegate pointer to compare against. |
|
inlinenoexcept |
Returns whether or not this StaticDelegate calls against the same method as the MemberDelegate we are checking against.
other | The other MemberDelegate pointer to compare against. |
|
inlinenoexcept |
Returns whether or not this StaticDelegate calls against the same method as the StaticDelegate we are checking against.
other | The other StaticDelegate pointer to compare against. |
|
inlinenoexcept |
Returns whether or not this StaticDelegate uses the same this pointer as the MemberDelegate we are checking against.
other | The other MemberDelegate pointer to compare against. |
|
inlinenoexcept |
Returns whether or not this StaticDelegate uses the same this pointer as the StaticDelegate we are checking against.
other | The other StaticDelegate pointer to compare against. |
|
inlinevirtualnoexcept |
Returns whether or not this StaticDelegate calls against the given this pointer.
thisPointer | A pointer referring to the object of interest. |
Implements EasyDelegate::ITypedDelegate< returnType, parameters...>.
|
inlinevirtual |
Invokes the StaticDelegate.
params | Anything; It depends on the method signature specified in the template. |
EasyDelegate::InvalidMethodPointerException | Thrown when the static method that this delegate is supposed to be invoking is NULL. |
std::exception | Potentially thrown by the method called by this StaticDelegate. |
Implements EasyDelegate::ITypedDelegate< returnType, parameters...>.