PLCnext API Documentation  22.9.0.33
Public Types | Public Member Functions | List of all members
Arp::System::Nm::NotificationRegistration< PayloadType > Class Template Reference

Proxy object for a NotificationRegistration More...

#include <NotificationRegistration.hpp>

Inheritance diagram for Arp::System::Nm::NotificationRegistration< PayloadType >:
Inheritance graph

Public Types

using payload_type = PayloadType
 

Public Member Functions

 NotificationRegistration ()=default
 Creates an empty NotificationRegistration More...
 
 NotificationRegistration (const String &notificationName, const String &senderName, Severity severity, INotificationSending &notificationSending)
 Creates a NotificationRegistration More...
 
 NotificationRegistration (const NotificationRegistration &)=delete
 
 NotificationRegistration (NotificationRegistration &&other)
 
NotificationRegistrationoperator= (const NotificationRegistration &)=delete
 
NotificationRegistrationoperator= (NotificationRegistration &&other)
 
template<typename... Args>
NotificationIdType SendNotification (Args &&... args)
 Sends a notification More...
 
template<typename... Args>
NotificationIdType SendNotificationWithTimestamp (const DateTime &timestamp, Args &&... args)
 Sends a notification with a specified timestamp More...
 
NotificationNameIdType GetNotificationNameId () const override
 Returns the NotificationNameId More...
 
- Public Member Functions inherited from Arp::System::Nm::NotificationRegistrationBase< NotificationRegistration< PayloadType > >
 NotificationRegistrationBase (const NotificationRegistrationBase &)=delete
 
NotificationRegistrationBaseoperator= (NotificationRegistrationBase &&other)=default
 
NotificationRegistrationBaseoperator= (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

- Protected Types inherited from Arp::System::Commons::Diagnostics::Logging::Loggable< Derived, IsSingleton, IsStaticClass >
typedef Loggable< Derived, IsSingleton, IsStaticClass > LoggableBase
 
- Protected Member Functions inherited from Arp::System::Commons::Diagnostics::Logging::Loggable< Derived, IsSingleton, IsStaticClass >
 Loggable (bool initialize=true)
 
- Static Protected Member Functions inherited from Arp::System::Commons::Diagnostics::Logging::Loggable< Derived, IsSingleton, IsStaticClass >
static void InitializeLogger (const char *loggerName=nullptr)
 
- Static Protected Attributes inherited from Arp::System::Commons::Diagnostics::Logging::Loggable< Derived, IsSingleton, IsStaticClass >
static Logger< Derived > log
 

Detailed Description

template<typename PayloadType>
class Arp::System::Nm::NotificationRegistration< PayloadType >

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.

Constructor & Destructor Documentation

◆ NotificationRegistration() [1/2]

template<typename PayloadType >
Arp::System::Nm::NotificationRegistration< PayloadType >::NotificationRegistration ( )
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.

◆ NotificationRegistration() [2/2]

template<typename PayloadType >
Arp::System::Nm::NotificationRegistration< PayloadType >::NotificationRegistration ( const String notificationName,
const String senderName,
Severity  severity,
INotificationSending notificationSending 
)

Creates a NotificationRegistration

Parameters
notificationNamename of the notification (e.g. Arp.System.Nm.SomethingInterestingHappened)
senderNamename of the sender of the notification
severityseverity of the notification
notificationSendingreference to the NotificationManager

Member Function Documentation

◆ GetNotificationNameId()

template<class PayloadType >
NotificationNameIdType Arp::System::Nm::NotificationRegistration< PayloadType >::GetNotificationNameId
overridevirtual

◆ SendNotification()

template<typename PayloadType >
template<typename... Args>
NotificationIdType Arp::System::Nm::NotificationRegistration< PayloadType >::SendNotification ( Args &&...  args)

Sends a notification

Parameters
argsArguments to the constructor of PayloadType (variadic)
Returns
NotificationId (Future)

Uses the current time as timestamp.

◆ SendNotificationWithTimestamp()

template<typename PayloadType >
template<typename... Args>
NotificationIdType Arp::System::Nm::NotificationRegistration< PayloadType >::SendNotificationWithTimestamp ( const DateTime timestamp,
Args &&...  args 
)

Sends a notification with a specified timestamp

Parameters
timestamptimestamp to be used
argsArguments to the constructor of PayloadType (variadic)
Returns
NotificationId (Future)

The documentation for this class was generated from the following file: