PLCnext API Documentation 25.0.2.69
DelegateFunctorBase.hxx
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
8#include "Arp/System/Core/Impl/IDelegateFunctor.hpp"
9
10namespace Arp { namespace System { namespace Core { namespace Impl
11{
12
14
15template<class Derived>
16class DelegateFunctorBase : public IDelegateFunctor
17{
18public: // construction/destruction
19 DelegateFunctorBase(void) = default;
20 DelegateFunctorBase(const DelegateFunctorBase& arg) = default;
21 DelegateFunctorBase& operator=(const DelegateFunctorBase& arg) = default;
22 virtual ~DelegateFunctorBase(void)noexcept = default;
23
24public: // operators
25 bool operator==(const IDelegateFunctor& rhs)override
26 {
27 const Derived* pDerived = dynamic_cast<const Derived*>(&rhs);
28 if (pDerived == nullptr)
29 {
30 return false;
31 }
32 // else call virtual Equals
33 return this->Equals(*pDerived);
34 }
35
36protected: // abstract operations
37 virtual bool Equals(const Derived& other) = 0;
38};
39
41
42}}}} // end of namespace Arp::System::Core::Impl
@ Equals
Start recording if TriggerVariable1 is equal to TriggerVariable2.
Root namespace for the PLCnext API