PLCnext API Documentation  22.9.0.33
NonBlockingNotificationSendingAdapter.hpp
1 //
3 // Copyright PHOENIX CONTACT Electronics GmbH
4 //
6 
7 #pragma once
8 
9 #include "Arp/System/Nm/INonBlockingNotificationSending.hpp"
10 #include "Arp/System/Nm/NonBlockingNotificationRegistration3ArgumentsBufferBase.hpp"
11 #include <limits>
12 #include <memory>
13 
14 namespace Arp { namespace System { namespace Nm
15 {
16 
17 class NotificationManager;
18 class NonBlockingNotificationRegistration3ArgumentsBufferBase;
19 
25 {
26 public:
28  {
29  std::shared_ptr<NonBlockingNotificationRegistration3ArgumentsBufferBase> BufferPtr = nullptr;
30  size_t Index = std::numeric_limits<size_t>::max();
31  };
32  using CreatePayloadFunctor = RawPayloadType (*)(CreatePayloadFunctorArg);
33 
35 
36  NotificationNameIdType RegisterNotification(
37  const String& notificationName, const String& senderName, Severity severity, PayloadTypeIdType payloadTypeId);
38 
40  const String& senderName, Severity severity, PayloadTypeIdType payloadTypeId) override;
41 
42  void NonBlockingRegisterNotification(const String& notificationName, const String& senderName, Severity severity,
44 
46 
48 
50  NotificationNameIdType notificationNameId, Arp::DateTime timestamp, const RawPayloadType& payload) override;
51 
53  NotificationNameIdType notificationNameId, Arp::DateTime timestamp, const IPayload& payload) override;
54 
55  void NonBlockingSendNotification(NotificationNameIdType notificationNameId, Arp::DateTime timestamp,
56  std::function<RawPayloadType()> createPayloadFunctor, Future<NotificationIdType> result);
57 
58  void NonBlockingSendNotification(NotificationNameIdType notificationNameId, Arp::DateTime timestamp,
59  CreatePayloadFunctor createPayloadFunctor, CreatePayloadFunctorArg createPayloadFunctorArg,
61 
62 private:
64 };
65 
66 }}} // namespace Arp::System::Nm
The class contains date and time informations.
Definition: DateTime.hpp:45
Future object as proxy for return value an asynchronous function call
Definition: Future.hpp:191
Future object as proxy for return value an asynchronous function call
Definition: Future.hpp:114
Interface for non blocking sending of Notifications
Definition: INonBlockingNotificationSending.hpp:22
Interface for Paylo objects
Definition: IPayload.hpp:19
Adapter for INonBlockingNotificationSending with additional functions
Definition: NonBlockingNotificationSendingAdapter.hpp:25
Future< NotificationNameIdType > NonBlockingRegisterNotification(const String &notificationName, const String &senderName, Severity severity, PayloadTypeIdType payloadTypeId) override
Registers a new Notification (non-blocking)
Future< void > NonBlockingUnregisterNotification(NotificationNameIdType notificationNameId) override
Unregisters a Nototification (non-blocking)
Future< NotificationIdType > NonBlockingSendNotification(NotificationNameIdType notificationNameId, Arp::DateTime timestamp, const RawPayloadType &payload) override
Sends a notification (non-blocking)
Future< NotificationIdType > NonBlockingSendNotification(NotificationNameIdType notificationNameId, Arp::DateTime timestamp, const IPayload &payload) override
Sends a notification (non-blocking)
Primary access to the NotificationManager
Definition: NotificationManager.hpp:49
@ System
System components used by the System, Device, Plc or Io domains.
Severity
Enumeration of Severities for notifications
Definition: Severity.hpp:15
std::vector< Arp::System::Rsc::Services::RscVariant< RawPayloadTypeLength > > RawPayloadType
type for the internally transferred payloads
Definition: NotificationManagerTypes.hpp:34
Root namespace for the PLCnext API
Definition: NonBlockingNotificationSendingAdapter.hpp:28