ReXGlue SDK
Loading...
Searching...
No Matches
notify_listener_object.h
Go to the documentation of this file.
1
17
18#pragma once
19
20#include <memory>
21#include <mutex>
22#include <utility>
23#include <vector>
24
25#include <rex/assert.h>
31#include <rex/module.h>
32#include <rex/platform.h>
33#include <rex/platform/sync.h>
34#include <rex/platform/thread.h>
35#include <rex/platform/timer.h>
36#include <rex/result.h>
37#include <rex/types.h>
38#include <rex/utility.h>
40
41namespace rex::kernel {
42
44 public:
45 virtual ~INotifyListenerQueue() = default;
46
53 virtual bool DequeueByID(XNotificationID id, u32* out_data) = 0;
54
62 virtual bool Dequeue(XNotificationID* out_id, u32* out_data) = 0;
63};
64
66inline constexpr u32 kNotifyListenerObjectSize = 0x30;
67
73 REX_KERNEL_API NotifyListenerObject(u64 mask_in, u32 max_version_in);
74
76 std::unique_ptr<rex::platform::Event> wait_handle;
77 std::mutex notifications_lock;
79 std::vector<std::pair<XNotificationID, u32>> notifications;
80 u64 mask = 0;
81 u32 max_version = 0;
82
85
86 REX_KERNEL_API bool DequeueByID(XNotificationID id, u32* out_data) override;
87
88 REX_KERNEL_API bool Dequeue(XNotificationID* out_id, u32* out_data) override;
89};
90
91} // namespace rex::kernel
Definition notify_listener_object.h:43
virtual bool Dequeue(XNotificationID *out_id, u32 *out_data)=0
virtual bool DequeueByID(XNotificationID id, u32 *out_data)=0
Virtual memory flags and typed guest pointers.
Guest list and spin lock structures.
Interfaces, factory and module declaration.
Definition export.h:24
constexpr u32 kNotifyListenerObjectSize
Definition notify_listener_object.h:66
u32 XNotificationID
Definition notification_broadcaster.h:30
Platform flags, packing macros and export markers.
#define REX_KERNEL_API
Definition platform.h:297
std::vector< std::pair< XNotificationID, u32 > > notifications
Definition notify_listener_object.h:79
bool Dequeue(XNotificationID *out_id, u32 *out_data) override
u64 mask
Definition notify_listener_object.h:80
u32 max_version
Definition notify_listener_object.h:81
bool DequeueByID(XNotificationID id, u32 *out_data) override
NotifyListenerObject(u64 mask_in, u32 max_version_in)
void Enqueue(XNotificationID id, u32 data)
std::unique_ptr< rex::platform::Event > wait_handle
Definition notify_listener_object.h:76
Wait objects and wait functions.
Integer types, byte order wrappers and size literals.
Move only function, const propagating pointer and scope guard.