mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:37:44 +00:00
LibCore: Remove data pointer from CustomEvent
It wasn't used anywhere. Also, if it were used, then it should have been marked AK_NONCOPYABLE(). Or even more cleanly, it should use a RefPtr<> or OwnPtr<> instead of a 'naked' pointer. And because I didn't want to impose any such decision on a possible future use case that we don't even know, I just removed that unused feature.
This commit is contained in:
parent
e5807d17b2
commit
6454969d6b
1 changed files with 7 additions and 11 deletions
|
@ -48,12 +48,12 @@ public:
|
||||||
Custom,
|
Custom,
|
||||||
};
|
};
|
||||||
|
|
||||||
Event() {}
|
Event() { }
|
||||||
explicit Event(unsigned type)
|
explicit Event(unsigned type)
|
||||||
: m_type(type)
|
: m_type(type)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
virtual ~Event() {}
|
virtual ~Event() { }
|
||||||
|
|
||||||
unsigned type() const { return m_type; }
|
unsigned type() const { return m_type; }
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ public:
|
||||||
, m_timer_id(timer_id)
|
, m_timer_id(timer_id)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
~TimerEvent() {}
|
~TimerEvent() { }
|
||||||
|
|
||||||
int timer_id() const { return m_timer_id; }
|
int timer_id() const { return m_timer_id; }
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ public:
|
||||||
, m_fd(fd)
|
, m_fd(fd)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
~NotifierReadEvent() {}
|
~NotifierReadEvent() { }
|
||||||
|
|
||||||
int fd() const { return m_fd; }
|
int fd() const { return m_fd; }
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ public:
|
||||||
, m_fd(fd)
|
, m_fd(fd)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
~NotifierWriteEvent() {}
|
~NotifierWriteEvent() { }
|
||||||
|
|
||||||
int fd() const { return m_fd; }
|
int fd() const { return m_fd; }
|
||||||
|
|
||||||
|
@ -143,21 +143,17 @@ private:
|
||||||
|
|
||||||
class CustomEvent : public Event {
|
class CustomEvent : public Event {
|
||||||
public:
|
public:
|
||||||
CustomEvent(int custom_type, void* data = nullptr)
|
CustomEvent(int custom_type)
|
||||||
: Event(Event::Type::Custom)
|
: Event(Event::Type::Custom)
|
||||||
, m_custom_type(custom_type)
|
, m_custom_type(custom_type)
|
||||||
, m_data(data)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
~CustomEvent() {}
|
~CustomEvent() { }
|
||||||
|
|
||||||
int custom_type() const { return m_custom_type; }
|
int custom_type() const { return m_custom_type; }
|
||||||
void* data() { return m_data; }
|
|
||||||
const void* data() const { return m_data; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_custom_type { 0 };
|
int m_custom_type { 0 };
|
||||||
void* m_data { nullptr };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue