PLCnext API Documentation
21.9.0.40
|
Proxy object for a non-blocking NotificationRegistration More...
#include <NonBlockingNotificationRegistration.hpp>
Public Types | |
using | payload_type = PayloadType |
Public Member Functions | |
NonBlockingNotificationRegistration ()=default | |
Creates an empty NotificationRegistration More... | |
NonBlockingNotificationRegistration (const String ¬ificationName, const String &senderName, Severity severity, INonBlockingNotificationSending ¬ificationSending) | |
Creates a NotificationRegistration More... | |
NonBlockingNotificationRegistration (const String ¬ificationName, const String &senderName, Severity severity, NonBlockingNotificationSendingAdapter *adapter) | |
NonBlockingNotificationRegistration (NonBlockingNotificationRegistration &&other) | |
NonBlockingNotificationRegistration & | operator= (NonBlockingNotificationRegistration &&other) |
NonBlockingNotificationRegistration (const NonBlockingNotificationRegistration &)=delete | |
NonBlockingNotificationRegistration & | operator= (const NonBlockingNotificationRegistration &)=delete |
template<typename... Args> | |
Future< NotificationIdType > | SendNotification (Args &&... args) |
Sends a notification More... | |
template<typename... Args> | |
Future< NotificationIdType > | SendNotificationWithTimestamp (const DateTime ×tamp, Args &&... args) |
Sends a notification with a specified timestamp More... | |
NotificationNameIdType | GetNotificationNameId () const override |
Returns the NotificationNameId More... | |
NotificationIdType | GetLastNotificationId () const |
Returns the id of the last send Notification More... | |
bool | IsCompleted () const |
Returns true if the last operation is completed 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... | |
Proxy object for a non-blocking 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 INonBlockingNotificationSending interface. All calls to the NotificationManager are asynchronous. Use IsCompleted to check if a call is done.
|
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::NonBlockingNotificationRegistration< PayloadType >::NonBlockingNotificationRegistration | ( | const String & | notificationName, |
const String & | senderName, | ||
Severity | severity, | ||
INonBlockingNotificationSending & | 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 |
NotificationIdType Arp::System::Nm::NonBlockingNotificationRegistration< PayloadType >::GetLastNotificationId | ( | ) | const |
Returns the id of the last send Notification
|
overridevirtual |
Returns the NotificationNameId
Implements Arp::System::Nm::NotificationRegistrationBase< NonBlockingNotificationRegistration< PayloadType > >.
bool Arp::System::Nm::NonBlockingNotificationRegistration< PayloadType >::IsCompleted | ( | ) | const |
Returns true if the last operation is completed
Future< NotificationIdType > Arp::System::Nm::NonBlockingNotificationRegistration< PayloadType >::SendNotification | ( | Args &&... | args | ) |
Sends a notification
args | Arguments to the constructor of PayloadType (variadic) |
Uses the current time as timestamp.
Future< NotificationIdType > Arp::System::Nm::NonBlockingNotificationRegistration< 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) |