ReXGlue SDK
Loading...
Searching...
No Matches
rex::kernel::NotifyListenerObject Struct Reference
Inheritance diagram for rex::kernel::NotifyListenerObject:
[legend]

Public Member Functions

 NotifyListenerObject (u64 mask_in, u32 max_version_in)
void Enqueue (XNotificationID id, u32 data)
bool DequeueByID (XNotificationID id, u32 *out_data) override
bool Dequeue (XNotificationID *out_id, u32 *out_data) override

Public Attributes

std::unique_ptr< rex::platform::Event > wait_handle
std::mutex notifications_lock
std::vector< std::pair< XNotificationID, u32 > > notifications
u64 mask = 0
u32 max_version = 0

Constructor & Destructor Documentation

◆ NotifyListenerObject()

rex::kernel::NotifyListenerObject::NotifyListenerObject ( u64 mask_in,
u32 max_version_in )
Parameters
mask_inThe bit mask of notification areas the listener receives.
max_version_inThe highest notification version the listener receives.

Member Function Documentation

◆ Dequeue()

bool rex::kernel::NotifyListenerObject::Dequeue ( XNotificationID * out_id,
u32 * out_data )
overridevirtual

Removes the oldest notification.

Parameters
out_idReceives the ID.
out_dataReceives the data.
Returns
True when a notification was removed.

Implements rex::kernel::INotifyListenerQueue.

◆ DequeueByID()

bool rex::kernel::NotifyListenerObject::DequeueByID ( XNotificationID id,
u32 * out_data )
overridevirtual

Removes the oldest notification with a given ID.

Parameters
out_dataReceives the data.
Returns
True when a notification was removed.

Implements rex::kernel::INotifyListenerQueue.

◆ Enqueue()

void rex::kernel::NotifyListenerObject::Enqueue ( XNotificationID id,
u32 data )

Queues a notification when it matches the mask and version of the listener.

Member Data Documentation

◆ mask

u64 rex::kernel::NotifyListenerObject::mask = 0

Bit mask of notification areas, bit N admits IDs whose mask_index is N.

◆ max_version

u32 rex::kernel::NotifyListenerObject::max_version = 0

Highest notification version admitted, a higher version is discarded.

◆ notifications

std::vector<std::pair<XNotificationID, u32> > rex::kernel::NotifyListenerObject::notifications

Queued notifications in arrival order, each with its ID and data.

◆ wait_handle

std::unique_ptr<rex::platform::Event> rex::kernel::NotifyListenerObject::wait_handle

Manual reset event set while notifications is not empty.


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