PLCnext API Documentation
22.9.0.33
|
Proxy object for a NotificationRegistration More...
#include <NotificationRegistration.hpp>
Public Types | |
using | payload_type = PayloadType |
Public Member Functions | |
NotificationRegistration ()=default | |
Creates an empty NotificationRegistration More... | |
NotificationRegistration (const String ¬ificationName, const String &senderName, Severity severity, INotificationSending ¬ificationSending) | |
Creates a NotificationRegistration More... | |
NotificationRegistration (const NotificationRegistration &)=delete | |
NotificationRegistration (NotificationRegistration &&other) | |
NotificationRegistration & | operator= (const NotificationRegistration &)=delete |
NotificationRegistration & | operator= (NotificationRegistration &&other) |
template<typename... Args> | |
NotificationIdType | SendNotification (Args &&... args) |
Sends a notification More... | |
template<typename... Args> | |
NotificationIdType | SendNotificationWithTimestamp (const DateTime ×tamp, Args &&... args) |
Sends a notification with a specified timestamp More... | |
NotificationNameIdType | GetNotificationNameId () const override |
Returns the NotificationNameId More... | |
![]() | |
NotificationRegistrationBase (const NotificationRegistrationBase &)=delete | |
NotificationRegistrationBase & | operator= (NotificationRegistrationBase &&other)=default |
NotificationRegistrationBase & | operator= (const NotificationRegistrationBase &)=delete |
void | Dispose () noexcept |
Unregisters the Notification and release all resources More... | |
const String | GetNotificationName () const |
Returns the notification name More... | |
const String | GetSenderName () const |
Returns the sender name More... | |
Severity | GetSeverity () const |
Returns the Severity More... | |
PayloadTypeIdType | GetPayloadTypeId () const |
Returns the PayloadTypeId More... | |
Additional Inherited Members | |
![]() | |
typedef Loggable< Derived, IsSingleton, IsStaticClass > | LoggableBase |
![]() | |
Loggable (bool initialize=true) | |
![]() | |
static void | InitializeLogger (const char *loggerName=nullptr) |
![]() | |
static Logger< Derived > | log |
Proxy object for a NotificationRegistration
This proxy class represents a Notification registration like a smart pointer. The Notification is registered in the constructor and unregistered in the destructor. Notifications can be send using the SendNotification method. The template parameter PayloadType indicates the Payload class to be used when sending Notifications.
This class supportes move semantics. Ownerchip of a notification registration is transfered by a move operation.
This class uses the INotificationSending interface. All calls to the NotificationManager are synchronous.
|
default |
Creates an empty NotificationRegistration
To be used as a class member, when it cannot be initialized directly. Use move semantics to transfer ownership from another object.
Arp::System::Nm::NotificationRegistration< PayloadType >::NotificationRegistration | ( | const String & | notificationName, |
const String & | senderName, | ||
Severity | severity, | ||
INotificationSending & | notificationSending | ||
) |
Creates a NotificationRegistration
notificationName | name of the notification (e.g. Arp.System.Nm.SomethingInterestingHappened) |
senderName | name of the sender of the notification |
severity | severity of the notification |
notificationSending | reference to the NotificationManager |
|
overridevirtual |
Returns the NotificationNameId
Implements Arp::System::Nm::NotificationRegistrationBase< NotificationRegistration< PayloadType > >.
NotificationIdType Arp::System::Nm::NotificationRegistration< PayloadType >::SendNotification | ( | Args &&... | args | ) |
Sends a notification
args | Arguments to the constructor of PayloadType (variadic) |
Uses the current time as timestamp.
NotificationIdType Arp::System::Nm::NotificationRegistration< PayloadType >::SendNotificationWithTimestamp | ( | const DateTime & | timestamp, |
Args &&... | args | ||
) |
Sends a notification with a specified timestamp
timestamp | timestamp to be used |
args | Arguments to the constructor of PayloadType (variadic) |