PLCnext API Documentation 25.0.2.69
RtEvent.hpp
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
8#include "Arp/System/Commons/Logging.h"
9#include "Arp/Plc/Commons/Esm/RtEventManagerSharedData.hpp"
10
11namespace Arp { namespace Plc { namespace Commons { namespace Esm
12{
13
18class RtEvent : private Loggable<RtEvent>
19{
20public: // usings
23
24public: // construction/destruction
25 RtEvent();
27 RtEvent(const RtEvent& arg) = delete;
29 RtEvent& operator=(const RtEvent& arg) = delete;
30 ~RtEvent(void);
31
32public: // operators
33 void Set(void);
34 bool SetAndWaitOne(unsigned long timeout = 0);
35 bool IsSubscriberReady(void)const;
36
37 bool WaitOne(unsigned long timeout = 0, bool setSubscriberReady = true);
38 void Done(void);
39 void SetSubscriberReady(bool isSubscriberReady);
40
41public: // Impl forward declaration
42 class Impl;
43
44public: // internal operations
45 Impl& GetImpl(void);
46 const Impl& GetImpl(void)const;
47
48private: // Impl usings
50
51private: // Impl fields
52 ImplPtr implPtr = nullptr;
53};
54
55}}}} // end of namespace Arp::Plc::Commons::Esm
Rt event for bidirectional exchange of events in the ESM context. Instances of this will be created b...
Definition: RtEvent.hpp:19
bool IsSubscriberReady(void) const
Returns state of the subscriber to processing incoming signaled events.
Definition: RtEvent.cpp:78
RtEvent()
Constructs an RtEvent instance.
Definition: RtEvent.cpp:14
bool WaitOne(unsigned long timeout=0, bool setSubscriberReady=true)
Waits blocking on the signal of the sender.
Definition: RtEvent.cpp:55
RtEvent & operator=(const RtEvent &arg)=delete
Assignment operator.
void SetSubscriberReady(bool isSubscriberReady)
Sets the state of the subscriber to processing incoming signaled events.
Definition: RtEvent.cpp:71
RtEvent(const RtEvent &arg)=delete
Copy constructor.
Impl & GetImpl(void)
For internal use only.
Definition: RtEvent.cpp:27
bool SetAndWaitOne(unsigned long timeout=0)
Signals the event to the subscriber and waits blocking on the done by the subscriber.
Definition: RtEvent.cpp:64
void Set(void)
Signals the event to the subscriber.
Definition: RtEvent.cpp:39
RtEventManagerSharedData::Ptr< RtEvent > Ptr
Shared pointer type of RtEvent.
Definition: RtEvent.hpp:22
void Done(void)
Signals that the event was processed by the subscriber to the sender.
Definition: RtEvent.cpp:45
~RtEvent(void)
Destructs this instance and frees all resources.
Definition: RtEvent.cpp:20
Derive from this class to inherit logging functionality.
Definition: Loggable.hxx:28
boost::interprocess::offset_ptr< T > Ptr
Returned pointer types are shared memory based offset pointer.
Definition: SharedMemory.hpp:24
Root namespace for the PLCnext API