25 friend CallbackStream;
28 EventPriority priority;
31 LLAPI
explicit ListenerBase(EventPriority priority, std::weak_ptr<mod::Mod> mod = mod::NativeMod::current());
34 std::weak_ptr<mod::Mod> modPtr;
36 ListenerBase(ListenerBase&&) =
delete;
37 ListenerBase(ListenerBase
const&) =
delete;
38 ListenerBase& operator=(ListenerBase&&) =
delete;
39 ListenerBase& operator=(ListenerBase
const&) =
delete;
41 [[nodiscard]]
constexpr ListenerId getId()
const {
return id; }
42 [[nodiscard]]
constexpr EventPriority getPriority()
const {
return priority; }
44 [[nodiscard]]
constexpr bool operator==(ListenerBase
const& other)
const noexcept {
return id == other.id; }
46 [[nodiscard]]
constexpr std::strong_ordering operator<=>(ListenerBase
const& other)
const noexcept {
47 if (priority != other.priority) {
48 return priority <=> other.priority;
50 return id <=> other.id;
53 virtual ~ListenerBase() =
default;
55 virtual void call(
Event& event) = 0;