mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:37:34 +00:00
LibCore: Simplify Core::Notifier by only allowing one event type
Not a single client of this API actually used the event mask feature to listen for readability AND writability. Let's simplify the API and have only one hook: on_activation.
This commit is contained in:
parent
1587caef84
commit
411d36719e
24 changed files with 80 additions and 99 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2018-2023, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
|
@ -21,8 +21,7 @@ public:
|
|||
Invalid = 0,
|
||||
Quit,
|
||||
Timer,
|
||||
NotifierRead,
|
||||
NotifierWrite,
|
||||
NotifierActivation,
|
||||
DeferredInvoke,
|
||||
ChildAdded,
|
||||
ChildRemoved,
|
||||
|
@ -79,29 +78,14 @@ private:
|
|||
int m_timer_id;
|
||||
};
|
||||
|
||||
class NotifierReadEvent final : public Event {
|
||||
class NotifierActivationEvent final : public Event {
|
||||
public:
|
||||
explicit NotifierReadEvent(int fd)
|
||||
: Event(Event::NotifierRead)
|
||||
explicit NotifierActivationEvent(int fd)
|
||||
: Event(Event::NotifierActivation)
|
||||
, m_fd(fd)
|
||||
{
|
||||
}
|
||||
~NotifierReadEvent() = default;
|
||||
|
||||
int fd() const { return m_fd; }
|
||||
|
||||
private:
|
||||
int m_fd;
|
||||
};
|
||||
|
||||
class NotifierWriteEvent final : public Event {
|
||||
public:
|
||||
explicit NotifierWriteEvent(int fd)
|
||||
: Event(Event::NotifierWrite)
|
||||
, m_fd(fd)
|
||||
{
|
||||
}
|
||||
~NotifierWriteEvent() = default;
|
||||
~NotifierActivationEvent() = default;
|
||||
|
||||
int fd() const { return m_fd; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue