PLCnext API Documentation  21.9.0.40
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | List of all members
Arp::System::Nm::NonBlockingNotificationRegistration< PayloadType > Class Template Reference

Proxy object for a non-blocking NotificationRegistration More...

#include <NonBlockingNotificationRegistration.hpp>

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

Public Types

using payload_type = PayloadType
 

Public Member Functions

 NonBlockingNotificationRegistration ()=default
 Creates an empty NotificationRegistration More...
 
 NonBlockingNotificationRegistration (const String &notificationName, const String &senderName, Severity severity, INonBlockingNotificationSending &notificationSending)
 Creates a NotificationRegistration More...
 
 NonBlockingNotificationRegistration (const String &notificationName, const String &senderName, Severity severity, NonBlockingNotificationSendingAdapter *adapter)
 
 NonBlockingNotificationRegistration (NonBlockingNotificationRegistration &&other)
 
NonBlockingNotificationRegistrationoperator= (NonBlockingNotificationRegistration &&other)
 
 NonBlockingNotificationRegistration (const NonBlockingNotificationRegistration &)=delete
 
NonBlockingNotificationRegistrationoperator= (const NonBlockingNotificationRegistration &)=delete
 
template<typename... Args>
Future< NotificationIdTypeSendNotification (Args &&... args)
 Sends a notification More...
 
template<typename... Args>
Future< NotificationIdTypeSendNotificationWithTimestamp (const DateTime &timestamp, 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...
 
- Public Member Functions inherited from Arp::System::Nm::NotificationRegistrationBase< NonBlockingNotificationRegistration< 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< NotificationRegistrationBase< NonBlockingNotificationRegistration< PayloadType > > >
typedef Loggable< NotificationRegistrationBase< NonBlockingNotificationRegistration< PayloadType > >, false, false > LoggableBase
 
- Protected Member Functions inherited from Arp::System::Commons::Diagnostics::Logging::Loggable< NotificationRegistrationBase< NonBlockingNotificationRegistration< PayloadType > > >
 Loggable (bool initialize=true)
 
- Static Protected Member Functions inherited from Arp::System::Commons::Diagnostics::Logging::Loggable< NotificationRegistrationBase< NonBlockingNotificationRegistration< PayloadType > > >
static void InitializeLogger (const char *loggerName=nullptr)
 
- Static Protected Attributes inherited from Arp::System::Commons::Diagnostics::Logging::Loggable< NotificationRegistrationBase< NonBlockingNotificationRegistration< PayloadType > > >
static Logger< NotificationRegistrationBase< NonBlockingNotificationRegistration< PayloadType > > > log
 

Detailed Description

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

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.

Constructor & Destructor Documentation

◆ NonBlockingNotificationRegistration() [1/2]

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

◆ NonBlockingNotificationRegistration() [2/2]

template<typename PayloadType >
Arp::System::Nm::NonBlockingNotificationRegistration< PayloadType >::NonBlockingNotificationRegistration ( const String notificationName,
const String senderName,
Severity  severity,
INonBlockingNotificationSending 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

◆ GetLastNotificationId()

template<class PayloadType >
NotificationIdType Arp::System::Nm::NonBlockingNotificationRegistration< PayloadType >::GetLastNotificationId ( ) const

Returns the id of the last send Notification

◆ GetNotificationNameId()

template<class PayloadType >
NotificationNameIdType Arp::System::Nm::NonBlockingNotificationRegistration< PayloadType >::GetNotificationNameId ( ) const
overridevirtual

◆ IsCompleted()

template<class PayloadType >
bool Arp::System::Nm::NonBlockingNotificationRegistration< PayloadType >::IsCompleted ( ) const

Returns true if the last operation is completed

◆ SendNotification()

template<typename PayloadType >
template<typename... Args>
Future< NotificationIdType > Arp::System::Nm::NonBlockingNotificationRegistration< 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>
Future< NotificationIdType > Arp::System::Nm::NonBlockingNotificationRegistration< 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: