PLCnext API Documentation 25.0.2.69
DelegateFunctorBase.hxx
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
7#include "Arp/Base/Core/Detail/IDelegateFunctor.hpp"
8
9namespace Arp::Base::Core
10{
11
13
14template<class T>
15class DelegateFunctorBase : public IDelegateFunctor
16{
17public: // construction/destruction
18 DelegateFunctorBase(void) = default;
19
20protected: // abstract operations
21 virtual bool EqualsTo(const T& other) = 0;
22
23protected: // overridden operations
24 virtual bool Equals(const IDelegateFunctor& other);
25};
26
28// inline methods of class DelegateFunctorBase<T>
29template<class T>
30inline bool DelegateFunctorBase<T>::Equals(const IDelegateFunctor& other)
31{
32 const T* pDerived = dynamic_cast<const T*>(&other);
33 if (pDerived == nullptr)
34 {
35 return false;
36 }
37 // else call virtual EqualsTo
38 return this->EqualsTo(*pDerived);
39}
40
42
43} // end of namespace Arp::Base::Core
@ Equals
Start recording if TriggerVariable1 is equal to TriggerVariable2.