From f72596268beeaa0b4bbf83368c64ad02f95feb97 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Mon, 25 Jul 2016 11:43:31 +0200 Subject: [PATCH] well, the emitter would have not been grateful for that --- src/uvw/event.hpp | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/src/uvw/event.hpp b/src/uvw/event.hpp index 3411b881..df003f2d 100644 --- a/src/uvw/event.hpp +++ b/src/uvw/event.hpp @@ -9,8 +9,6 @@ namespace uvw { -// base structures - struct BaseEvent { virtual ~BaseEvent() noexcept = 0; @@ -32,28 +30,10 @@ struct Event: BaseEvent { }; -// empty events - - -struct DefaultEvent: Event { }; - -using AsyncEvent = DefaultEvent; -using CheckEvent = DefaultEvent; -using CloseEvent = DefaultEvent; -using ConnectEvent = DefaultEvent; -using EndEvent = DefaultEvent; -using IdleEvent = DefaultEvent; -using ListenEvent = DefaultEvent; -using PrepareEvent = DefaultEvent; -using SendEvent = DefaultEvent; -using ShutdownEvent = DefaultEvent; -using TimerEvent = DefaultEvent; -using UninitializedEvent = DefaultEvent; -using WorkEvent = DefaultEvent; -using WriteEvent = DefaultEvent; - - -// specialized events +struct AsyncEvent: Event { }; +struct CheckEvent: Event { }; +struct CloseEvent: Event { }; +struct ConnectEvent: Event { }; struct DataEvent: Event { @@ -70,6 +50,9 @@ private: }; +struct EndEvent: Event { }; + + struct ErrorEvent: Event { explicit ErrorEvent(int code = 0) noexcept: ec(code) { } @@ -106,6 +89,13 @@ private: }; +struct IdleEvent: Event { }; +struct ListenEvent: Event { }; +struct PrepareEvent: Event { }; +struct SendEvent: Event { }; +struct ShutdownEvent: Event { }; + + struct SignalEvent: Event { explicit SignalEvent(int sig) noexcept: signum(sig) { } @@ -116,6 +106,9 @@ private: }; +struct TimerEvent: Event { }; + + struct UDPDataEvent: Event { explicit UDPDataEvent(Addr addr, std::unique_ptr ptr, ssize_t l, bool trunc) noexcept : dt{std::move(ptr)}, len{l}, sndr{addr}, part{trunc} @@ -134,4 +127,9 @@ private: }; +struct UninitializedEvent: Event { }; +struct WorkEvent: Event { }; +struct WriteEvent: Event { }; + + }