EasyDelegate
2.0
Delegate and deferred callers for C++11.
|
A delegate of a class member method. More...
#include <delegates.hpp>
Public Types | |
typedef MemberMethodPointer< classType, returnType, parameters...> | MethodPointer |
Helper typedef referring to a static function 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 | |
MemberDelegate (const MethodPointer methodPointer, classType *thisPointer) | |
Constructor accepting a this pointer and a member function. More... | |
MemberDelegate (const MemberDelegate< classType, returnType, parameters...> *other) | |
Standard copy constructor. More... | |
returnType | invoke (parameters...params) |
Invoke the MemberDelegate. More... | |
EASYDELEGATE_INLINE bool | hasThisPointer (const void *thisPointer) const noexcept |
Returns whether or not this MemberDelegate calls against the given this pointer. More... | |
EASYDELEGATE_INLINE bool | callsMethod (const MethodPointer methodPointer) const noexcept |
Returns whether or not this MemberDelegate calls the given class member method pointer. More... | |
template<typename otherReturn , typename... otherParams> | |
EASYDELEGATE_INLINE bool | callsMethod (const StaticMethodPointer< otherReturn, otherParams...> methodPointer) const noexcept |
Returns whether or not this MemberDelegate calls the given static method pointer. More... | |
EASYDELEGATE_INLINE bool | callsMethod (const typename ITypedDelegate< returnType, parameters...>::StaticMethodPointerType methodPointer) const noexcept |
Returns whether or not this MemeberDelegate calls the given static method address. More... | |
EASYDELEGATE_INLINE bool | hasSameMethodAs (const MemberDelegate< classType, returnType, parameters...> *other) const noexcept |
Returns whether or not this MemberDelegate calls the same method as the other MemberDelegate. 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 MemberDelegate calls the same method as the other of a deferring signature. More... | |
template<typename otherReturn , typename... otherParams> | |
EASYDELEGATE_INLINE bool | hasSameMethodAs (const StaticDelegate< otherReturn, otherParams...> *other) const noexcept |
Returns whether or not this MemberDelegate calls the same method as the StaticDelegate type. More... | |
template<typename otherReturn , typename... otherParams> | |
EASYDELEGATE_INLINE bool | hasSameThisPointerAs (const StaticDelegate< otherReturn, otherParams...> *other) const noexcept |
Returns whether or not this MemberDelegate calls against the same this pointer as the StaticDelegate. 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 MemberDelegate calls against the same this pointer as the other. More... | |
Public Member Functions inherited from EasyDelegate::ITypedDelegate< returnType, parameters...> | |
ITypedDelegate (const bool &isMemberDelegate) noexcept | |
Constructor accepting a boolean. More... | |
virtual bool | callsMethod (const StaticMethodPointerType methodPointer) const noexcept=0 |
Returns whether or not this delegate calls the given static method. More... | |
bool | callsMethod (const MemberDelegateFuncPtr< className > methodPointer) const noexcept |
Returns whether or not this delegate calls the given class member method address. More... | |
Public Attributes | |
classType * | mThisPointer |
A pointer to the this object. | |
Public Attributes inherited from EasyDelegate::IDelegate | |
const bool | mIsMemberDelegate |
A boolean representing whether or not this delegate is a member delegate. | |
Additional Inherited Members | |
Protected Member Functions inherited from EasyDelegate::IDelegate | |
IDelegate (const bool &isMemberDelegate) noexcept | |
Constructor accepting a boolean. More... | |
A delegate of a class member method.
The MemberDelegate behaves exactly like the StaticDelegate type except it works against class member methods.
|
inline |
Constructor accepting a this pointer and a member function.
thisPointer | A pointer to the object instance to be considered 'this' during invocation. |
methodPointer | A pointer to the member function to be invoked upon the this pointer. |
|
inline |
Standard copy constructor.
other | The other MemberDelegate pointer with the same signature to copy from. |
|
inlinenoexcept |
Returns whether or not this MemberDelegate calls the given class member method pointer.
methodPointer | A pointer to a class member method to be checked against. |
|
inlinenoexcept |
Returns whether or not this MemberDelegate calls the given static method pointer.
methodPointer | A pointer to a static method to be checked against. |
|
inlinenoexcept |
Returns whether or not this MemeberDelegate calls the given static method address.
methodPointer | A pointer to the static method to be checked against. |
|
inlinenoexcept |
Returns whether or not this MemberDelegate calls the same method as the other MemberDelegate.
other | The other MemberDelegate pointer to compare against. |
|
inlinenoexcept |
Returns whether or not this MemberDelegate calls the same method as the other of a deferring signature.
other | The other MemberDelegate pointer to compare against. |
|
inlinenoexcept |
Returns whether or not this MemberDelegate calls the same method as the StaticDelegate type.
other | The other StaticDelegate pointer to compare against. |
|
inlinenoexcept |
Returns whether or not this MemberDelegate calls against the same this pointer as the StaticDelegate.
other | The other StaticDelegate pointer to compare against. |
|
inlinenoexcept |
Returns whether or not this MemberDelegate calls against the same this pointer as the other.
other | The other MemberDelegate pointer to compare against. |
|
inlinevirtualnoexcept |
Returns whether or not this MemberDelegate calls against the given this pointer.
thisPointer | A pointer referring to the object of interest. |
Implements EasyDelegate::ITypedDelegate< returnType, parameters...>.
|
inlinevirtual |
Invoke the MemberDelegate.
params | Anything; It depends on the method signature specified in the template. |
EasyDelegate::InvalidMethodPointerException | Thrown when the class member method that this delegate is supposed to be invoking is NULL. |
EasyDelegate::InvalidThisPointerException | Thrown when the MemberDelegate's this pointer is NULL. |
std::exception | Potentially thrown by the method called by this MemberDelegate. |
Implements EasyDelegate::ITypedDelegate< returnType, parameters...>.