8#include "Arp/System/Core/Impl/DelegateFunctorBase.hxx"
10namespace Arp {
namespace System {
namespace Core {
namespace Impl
15template <
typename T>
class MethodFunctor;
20template<
class C,
class R,
class ...A>
21class MethodFunctor<R(C::*)(A...)> :
public DelegateFunctorBase<MethodFunctor<R(C::*)(A...)>>
24 using MethodPtr = R(C::*)(A...);
27 MethodFunctor(C* pObjectArg, R(C::*pMethodArg)(A...)) : pObject(pObjectArg), pMethod(pMethodArg) {}
28 MethodFunctor(C& objectArg, R(C::*pMethodArg)(A...)) : pObject(&objectArg), pMethod(pMethodArg) {}
29 MethodFunctor(
const MethodFunctor& arg) =
default;
30 MethodFunctor& operator=(
const MethodFunctor& arg) =
default;
31 virtual ~MethodFunctor(
void)
noexcept =
default;
34 template<
class ...Args>
35 static R Invoke(
void* pArg, Args&& ... args)
37 MethodFunctor* pThis =
static_cast<MethodFunctor*
>(pArg);
38 return ((pThis->pObject)->*(pThis->pMethod))(std::forward<Args>(args)...);
42 bool Equals(
const MethodFunctor& other)
override
44 return this->pObject == other.pObject && this->pMethod == other.pMethod;
@ Equals
Start recording if TriggerVariable1 is equal to TriggerVariable2.
Root namespace for the PLCnext API