8#include "Arp/System/Core/Impl/DelegateFunctorBase.hxx"
9#include "Arp/System/Core/Exception.hpp"
11namespace Arp {
namespace System {
namespace Core {
namespace Impl
16template <
typename T>
class LambdaFunctor;
21template<
class R,
class ...A>
22class LambdaFunctor<R(A...)> :
public DelegateFunctorBase<LambdaFunctor<R(A...)>>
25 using Function = std::function<R(A...)>;
28 LambdaFunctor(
const Function& f) : function(f) {}
29 LambdaFunctor(Function&& f) : function(f) {}
30 LambdaFunctor(
const LambdaFunctor& arg) =
default;
31 LambdaFunctor& operator=(
const LambdaFunctor& arg) =
default;
32 virtual ~LambdaFunctor(
void)
noexcept =
default;
35 template<
class ...Args>
36 static R Invoke(
void* pArg, Args&& ... args)
38 LambdaFunctor* pThis =
static_cast<LambdaFunctor*
>(pArg);
39 return pThis->function(std::forward<Args>(args)...);
43 bool Equals(
const LambdaFunctor& )
override
45 throw Exception(
"Equality operation is not supported by lamda expressions or std::function.");
@ Equals
Start recording if TriggerVariable1 is equal to TriggerVariable2.
Root namespace for the PLCnext API