PLCnext API Documentation  20.6.0.30321
IPlcEventComponent.hpp
1 //
3 // Copyright PHOENIX CONTACT Electronics GmbH
4 //
6 #pragma once
7 #include "Arp/System/Core/Arp.h"
8 #include "Arp/System/Core/event.hxx"
9 #include "Arp/System/Core/delegate.hxx"
10 #include "Arp/Plc/Commons/Domain/PlcEvent.hpp"
11 
12 namespace Arp { namespace Plc { namespace Commons { namespace Domain
13 {
14 
17 
19 using PlcEventReceiver = delegate<void(void*, PlcEvent)>;
20 
22 {
23 public: // typedefs
24  typedef std::shared_ptr<IPlcEventComponent> Ptr;
25 
26 protected: // construction/destruction
28  IPlcEventComponent(void) = default;
30  virtual ~IPlcEventComponent(void) = default;
31 
32 public: // abstract operations
35  virtual PlcEventSender* GetPlcEventSender(void) = 0;
38  virtual PlcEventReceiver* GetPlcEventReceiver(void) = 0;
39 
40 private: // deleted methods (for non-copyable classes)
41  IPlcEventComponent(const IPlcEventComponent& arg) = delete;
42  IPlcEventComponent& operator=(const IPlcEventComponent& arg) = delete;
43 };
44 
45 }}}} // end of namespace Arp::Plc::Commons::Domain
virtual PlcEventSender * GetPlcEventSender(void)=0
Gets the event sender, if this Plc component sends any Plc events.
delegate< void(void *, PlcEvent)> PlcEventReceiver
This delegate defines the signature of Plc event receiver and matches the PlcEventSender signature...
Definition: IPlcEventComponent.hpp:19
Definition: IPlcEventComponent.hpp:21
virtual PlcEventReceiver * GetPlcEventReceiver(void)=0
Gets the event receiver, if this Plc component receives any Plc events.
Use this class to register and invoke several delegates (function pointer in OOP design).
Definition: event.hxx:32
Root namespace for the PLCnext API
virtual ~IPlcEventComponent(void)=default
Destructs this instance and frees all resources.
IPlcEventComponent(void)=default
Constructs an IPlcEventComponent instance.