ReXGlue SDK
Toggle main menu visibility
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
>
26
#include <
rex/kernel/object/object.h
>
27
#include <
rex/kernel/types/list.h
>
28
#include <
rex/kernel/types/memory.h
>
29
#include <
rex/kernel/types/status.h
>
30
#include <
rex/kernel/types/thread.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
>
39
#include <
rex/kernel/object/notification_broadcaster.h
>
40
41
namespace
rex::kernel
{
42
43
class
INotifyListenerQueue
{
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
66
inline
constexpr
u32
kNotifyListenerObjectSize
= 0x30;
67
68
struct
NotifyListenerObject
:
INotifyListenerQueue
{
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
84
REX_KERNEL_API
void
Enqueue
(
XNotificationID
id
, u32 data);
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
assert.h
rex::kernel::INotifyListenerQueue
Definition
notify_listener_object.h:43
rex::kernel::INotifyListenerQueue::Dequeue
virtual bool Dequeue(XNotificationID *out_id, u32 *out_data)=0
rex::kernel::INotifyListenerQueue::DequeueByID
virtual bool DequeueByID(XNotificationID id, u32 *out_data)=0
memory.h
Virtual memory flags and typed guest pointers.
thread.h
list.h
Guest list and spin lock structures.
module.h
Interfaces, factory and module declaration.
rex::kernel
Definition
export.h:24
rex::kernel::kNotifyListenerObjectSize
constexpr u32 kNotifyListenerObjectSize
Definition
notify_listener_object.h:66
rex::kernel::XNotificationID
u32 XNotificationID
Definition
notification_broadcaster.h:30
notification_broadcaster.h
object.h
thread.h
platform.h
Platform flags, packing macros and export markers.
REX_KERNEL_API
#define REX_KERNEL_API
Definition
platform.h:297
result.h
status.h
rex::kernel::NotifyListenerObject::notifications
std::vector< std::pair< XNotificationID, u32 > > notifications
Definition
notify_listener_object.h:79
rex::kernel::NotifyListenerObject::Dequeue
bool Dequeue(XNotificationID *out_id, u32 *out_data) override
rex::kernel::NotifyListenerObject::mask
u64 mask
Definition
notify_listener_object.h:80
rex::kernel::NotifyListenerObject::max_version
u32 max_version
Definition
notify_listener_object.h:81
rex::kernel::NotifyListenerObject::DequeueByID
bool DequeueByID(XNotificationID id, u32 *out_data) override
rex::kernel::NotifyListenerObject::NotifyListenerObject
NotifyListenerObject(u64 mask_in, u32 max_version_in)
rex::kernel::NotifyListenerObject::Enqueue
void Enqueue(XNotificationID id, u32 data)
rex::kernel::NotifyListenerObject::wait_handle
std::unique_ptr< rex::platform::Event > wait_handle
Definition
notify_listener_object.h:76
sync.h
Wait objects and wait functions.
timer.h
types.h
Integer types, byte order wrappers and size literals.
utility.h
Move only function, const propagating pointer and scope guard.
rex
kernel
object
notify_listener_object.h
Generated by
1.18.0