ReXGlue SDK
Toggle main menu visibility
Loading...
Searching...
No Matches
notification_broadcaster.h
Go to the documentation of this file.
1
17
18
#pragma once
19
20
#include <
rex/assert.h
>
21
#include <
rex/kernel/types/status.h
>
22
#include <
rex/module.h
>
23
#include <
rex/platform.h
>
24
#include <
rex/result.h
>
25
#include <
rex/types.h
>
26
27
namespace
rex::kernel
{
28
30
using
XNotificationID
= u32;
31
32
REX_DECLARE_INTERFACE
(
INotificationBroadcaster
, 1)
33
virtual ~
INotificationBroadcaster
() = default;
34
43
[[nodiscard]] virtual
Result
<X_HANDLE> AddNotifyListener(u64 mask, u32 max_version) = 0;
44
46
virtual
void
BroadcastNotification(
XNotificationID
id
, u32 data) = 0;
47
};
48
49
union XNotificationKey {
50
XNotificationID
id
;
51
struct
{
52
u32
local_id
: 16;
53
u32
version
: 9;
54
u32
mask_index
: 6;
55
u32 : 1;
56
};
57
58
constexpr
XNotificationKey(
XNotificationID
notification_id =
static_cast<
XNotificationID
>
(0))
59
:
id
(notification_id) {
60
REX_STATIC_ASSERT_SIZE(*
this
,
sizeof
(
id
));
61
}
62
63
constexpr
operator
XNotificationID
()
const
{
return
id; }
64
};
65
66
}
// namespace rex::kernel
assert.h
rex::kernel::INotificationBroadcaster
Definition
notification_broadcaster.h:32
module.h
Interfaces, factory and module declaration.
REX_DECLARE_INTERFACE
#define REX_DECLARE_INTERFACE(Name, version)
Definition
module.h:114
rex::kernel
Definition
export.h:24
rex::kernel::XNotificationID
u32 XNotificationID
Definition
notification_broadcaster.h:30
rex::Result
std::expected< T, Error > Result
Definition
result.h:98
platform.h
Platform flags, packing macros and export markers.
result.h
status.h
rex::kernel::XNotificationKey::[struct].__unnamed0__::local_id
u32 local_id
rex::kernel::XNotificationKey::[struct].__unnamed0__::version
u32 version
rex::kernel::XNotificationKey::[struct].__unnamed0__::mask_index
u32 mask_index
types.h
Integer types, byte order wrappers and size literals.
rex::kernel::XNotificationKey::id
XNotificationID id
Definition
notification_broadcaster.h:50
rex
kernel
object
notification_broadcaster.h
Generated by
1.18.0