PLCnext API Documentation  21.0.0.35466
NotificationRegistrationInfo.hpp
1 //
3 // Copyright PHOENIX CONTACT Electronics GmbH
4 //
6 #pragma once
7 #include "Arp/System/Core/Arp.h"
8 #include "Arp/System/Nm/NotificationManagerTypes.hpp"
9 #include "Arp/System/Nm/Services/NotificationRegistrationStatus.hpp"
10 #include "Arp/System/Nm/Services/Severity.hpp"
11 #include "Arp/System/Rsc/Services/IRscSerializable.hpp"
12 #include "Arp/System/Rsc/Services/RscReader.hpp"
13 #include "Arp/System/Rsc/Services/RscString.hxx"
14 #include "Arp/System/Rsc/Services/RscWriter.hpp"
15 
16 namespace Arp { namespace System { namespace Nm
17 {
18 
19 
22 {
23 public:
25  NotificationRegistrationInfo() = default;
26 
29  NotificationNameIdType notificationNameId, const String& notificationName);
30 
31 
34  const String& notificationName, const String& senderName, Severity severity,
35  PayloadTypeIdType payloadTypeId, NotificationRegistrationStatus initialStatus);
36 
37  ~NotificationRegistrationInfo() override = default;
38 
39  // Methods of IRscSerializable
40  void Serialize(Arp::System::Rsc::Services::RscWriter& writer) const override;
42  static size_t GetFieldCount(void);
43 
46 
48  const String GetNotificationName() const;
49 
51  const String GetSenderName() const;
52 
54  const Severity GetSeverity() const;
55 
57  const PayloadTypeIdType GetPayloadTypeId() const;
58 
61 
64  bool IsSubscribed() const;
65 
67  bool IsRegistered() const;
68 
70  bool IsUnRegistered() const;
71 
74  void SetStatusRegistered();
75 
78  void SetStatusUnregistered();
79 
80 private:
81  NotificationNameIdType NotificationNameId;
84  Severity severity = Severity::Default;
85  PayloadTypeIdType PayloadTypeId;
86  NotificationRegistrationStatus Status = NotificationRegistrationStatus::Subscribed;
87 };
88 
89 }}} // namespace Arp::System::Nm
Reads data from Rsc
Definition: RscReader.hpp:23
void Deserialize(Arp::System::Rsc::Services::RscReader &reader) override
Deserializes the datatype. All fields of the datatype have to be deserialized in use of RscReader...
Writes data to Rsc.
Definition: RscWriter.hpp:32
void Serialize(Arp::System::Rsc::Services::RscWriter &writer) const override
Serializes the datatype. All fields of the datatype have to be serialized in use of RscWriter...
const NotificationNameIdType GetNotificationNameId() const
Returns the NotificationNameId
bool IsRegistered() const
Returns true is the notification is subscribed
const NotificationRegistrationStatus GetStatus() const
Returns the registration status
const PayloadTypeIdType GetPayloadTypeId() const
Returns the PayloadTypeId
const String GetSenderName() const
Returns the sender name
Marshalls structure or class data types. Serialize and Deserialize have to marshal fields in the same...
Definition: IRscSerializable.hpp:18
NotificationRegistrationStatus
Enumeration to represent the status of the Notification
Definition: NotificationRegistrationStatus.hpp:16
Severity
Enumeration of Severities for notifications
Definition: Severity.hpp:15
Root namespace for the PLCnext API
Information about the registration of a Notification
Definition: NotificationRegistrationInfo.hpp:21
const Severity GetSeverity() const
Returns the Severity
bool IsSubscribed() const
Returns true if the notification is subscribed
NotificationRegistrationInfo()=default
Used internally to create the object.
System components used by the System, Device, Plc or Io domains.
bool IsUnRegistered() const
Returns true if the notification is unregistered
const String GetNotificationName() const
Returns the NotificationName