PLCnext API Documentation 25.0.2.69
|
Proxy class for an subscriber of notifications More...
#include <NotificationSubscriber.hpp>
Public Member Functions | |
NotificationSubscriber () | |
Creates an empty subscriber More... | |
NotificationSubscriber (const String ¬ificationName, INotificationReceiving ¬ificationReceiving) | |
Deprecated! Create a proxy and subscribe to a Notification More... | |
NotificationSubscriber (const String ¬ificationName) | |
Create a proxy and subscribe to a Notification More... | |
NotificationSubscriber (const NotificationSubscriber &)=delete | |
NotificationSubscriber (NotificationSubscriber &&other) | |
NotificationSubscriber & | operator= (const NotificationSubscriber &)=delete |
NotificationSubscriber & | operator= (NotificationSubscriber &&other) |
void | Dispose () noexcept |
Unsubscribe and release alll resources | |
void | Notify (const Notification ¬ification) override |
Called by the NotificationManager when a Notification is dipatched More... | |
const String | GetNotificationName () const |
Returns the NotificationName | |
const NotificationNameIdType | GetNotificationNameId () const |
Returns the NotificationNameId | |
virtual void | Notify (const Notification ¬ification)=0 |
Called to notify about an notification More... | |
Public Attributes | |
Arp::event< const Notification & > | OnNotification |
Event to be fired on a Notification More... | |
Additional Inherited Members | |
![]() | |
static Logger< NotificationSubscriber > | log |
Proxy class for an subscriber of notifications
This class supports move semantics. It can be default constructed (e.g. in a component) and initialized by assigning an object with parameters.
When Notify is called while a move operation takes place there could be a race condition in the list of OnNotification (Arp::event). Therefore this object contains a mutex. Before any move operation the mutexes on this and the moved from object are locked.
|
default |
Creates an empty subscriber
This object is not subscribed to anything. Use move semantics to transfer subscriptions from another object.
Arp::System::Nm::NotificationSubscriber::NotificationSubscriber | ( | const String & | notificationName, |
INotificationReceiving & | notificationReceiving | ||
) |
Deprecated! Create a proxy and subscribe to a Notification
notificationName | Name of the Notification to subscribe to |
notificationReceiving | Reference to the NotificationManager |
|
explicit |
Create a proxy and subscribe to a Notification
notificationName | Name of the Notification to subscribe to |
Uses the NotificationManager singleton
|
overridevirtual |
Called by the NotificationManager when a Notification is dipatched
Override this funtion to implemet custom behavior.
Implements Arp::System::Nm::INotificationSubscriber.
Arp::event<const Notification&> Arp::System::Nm::NotificationSubscriber::OnNotification |
Event to be fired on a Notification
Use += and make_delegate to register a callback.