ReXGlue SDK
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>
22#include <rex/module.h>
23#include <rex/platform.h>
24#include <rex/result.h>
25#include <rex/types.h>
26
27namespace rex::kernel {
28
30using XNotificationID = u32;
31
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
49union XNotificationKey {
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
Definition notification_broadcaster.h:32
Interfaces, factory and module declaration.
#define REX_DECLARE_INTERFACE(Name, version)
Definition module.h:114
Definition export.h:24
u32 XNotificationID
Definition notification_broadcaster.h:30
std::expected< T, Error > Result
Definition result.h:98
Platform flags, packing macros and export markers.
Integer types, byte order wrappers and size literals.
XNotificationID id
Definition notification_broadcaster.h:50