RADLib
RADical C++ application framework
RADUi::NotificationModel Class Reference

Notification collection model. More...

#include <RADAppKit.h>

+ Inheritance diagram for RADUi::NotificationModel:
+ Collaboration diagram for RADUi::NotificationModel:

Public Member Functions

uint64_t push (Notification notification)
 Adds a notification and returns assigned id. More...
 
bool dismiss (uint64_t id)
 Removes a notification by id. More...
 
void clear ()
 Clears all notifications. More...
 
const std::vector< Notification > & notifications () const
 Returns notifications. More...
 
bool triggerAction (uint64_t id)
 Triggers notification action. More...
 
- Public Member Functions inherited from RADCore::RADObject
 RADObject ()
 Creates a RADObject bound to the current thread. More...
 
virtual ~RADObject ()
 Disconnects tracked event links and releases lifetime token. More...
 
void registerLink (const ConnectionRecord &record)
 Registers a connection for cleanup when this object is destroyed. More...
 
std::thread::id threadId () const
 Returns the thread id this object is currently associated with. More...
 
EventLoopassociatedEventLoop () const
 Returns the associated event loop, if any. More...
 
ThreadAffinity threadAffinity () const
 Returns both thread id and associated loop atomically. More...
 
std::weak_ptr< void > lifetimeToken () const
 Returns a weak token used to drop queued callbacks after destruction. More...
 
void moveToThread (std::thread::id tId, EventLoop *loop=nullptr)
 Moves the object's affinity to tId and optional loop. More...
 

Public Attributes

RADCore::Event< void() > changed
 Raised when notifications change. More...
 
RADCore::Event< void(uint64_t, std::string) > actionTriggered
 Raised when a notification action is triggered. More...
 

Detailed Description

Notification collection model.

Member Function Documentation

◆ clear()

void RADUi::NotificationModel::clear ( )

Clears all notifications.

◆ dismiss()

bool RADUi::NotificationModel::dismiss ( uint64_t  id)

Removes a notification by id.

◆ notifications()

const std::vector<Notification>& RADUi::NotificationModel::notifications ( ) const

Returns notifications.

◆ push()

uint64_t RADUi::NotificationModel::push ( Notification  notification)

Adds a notification and returns assigned id.

◆ triggerAction()

bool RADUi::NotificationModel::triggerAction ( uint64_t  id)

Triggers notification action.

Member Data Documentation

◆ actionTriggered

RADCore::Event<void (uint64_t, std::string) > RADUi::NotificationModel::actionTriggered

Raised when a notification action is triggered.

◆ changed

RADCore::Event<void () > RADUi::NotificationModel::changed

Raised when notifications change.


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