7#include "Arp/Base/Core/Detail/DelegateFunctorBase.hxx"
9namespace Arp::Base::Core
14template <
typename T>
class MethodFunctor;
17template<
class C,
class R,
class ...A>
18class MethodFunctor<R(C::*)(A...)> :
public DelegateFunctorBase<MethodFunctor<R(C::*)(A...)>>
21 using MethodPtr = R(C::*)(A...);
24 MethodFunctor(C* pObject, R(C::*pMethod)(A...))
30 MethodFunctor(C&
object, R(C::*pMethod)(A...))
37 template<
class ...Args>
38 static R Invoke(IDelegateFunctor* pFunctor, Args... args)
40 auto* pThis =
dynamic_cast<MethodFunctor*
>(pFunctor);
41 return std::invoke(pThis->pMethod, pThis->pObject, args...);
45 bool EqualsTo(
const MethodFunctor& other)
override
47 return this->pObject == other.pObject && this->pMethod == other.pMethod;