PLCnext API Documentation 25.0.2.69
|
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 (const NonBlockingNotificationRegistration &)=delete | |
NonBlockingNotificationRegistration (NonBlockingNotificationRegistration &&other) | |
NonBlockingNotificationRegistration & | operator= (const NonBlockingNotificationRegistration &)=delete |
NonBlockingNotificationRegistration & | operator= (NonBlockingNotificationRegistration &&other) |
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 | |
bool | IsCompleted () const |
Returns true if the last operation is completed | |
![]() | |
NotificationRegistrationBase (const NotificationRegistrationBase &)=delete | |
NotificationRegistrationBase & | operator= (NotificationRegistrationBase &&other)=default |
NotificationRegistrationBase & | operator= (const NotificationRegistrationBase &)=delete |
void | Dispose () noexcept |
Unregisters the Notification and release all resources | |
virtual NotificationNameIdType | GetNotificationNameId () const=0 |
Returns the notification name id More... | |
String | GetNotificationName () const |
Returns the notification name | |
String | GetSenderName () const |
Returns the sender name | |
Severity | GetSeverity () const |
Returns the Severity | |
PayloadTypeIdType | GetPayloadTypeId () const |
Returns the PayloadTypeId | |
Additional Inherited Members | |
virtual void | DisposeImpl ()=0 |
![]() | |
static Logger< NotificationRegistrationBase< NonBlockingNotificationRegistration< PayloadType > > > | log |
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 |
|
overridevirtual |
Returns the NotificationNameId
Implements Arp::System::Nm::NotificationRegistrationBase< NonBlockingNotificationRegistration< PayloadType > >.
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) |