From aa7b2946f3f064d76981d7ce77ea5ee3a750720f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Fri, 13 Jan 2017 10:20:51 +0100 Subject: [PATCH] Add shared overload of the EventDriver.events property. This allows accessing the shared "trigger" method from a shared event driver. --- source/eventcore/driver.d | 1 + source/eventcore/drivers/libasync.d | 1 + source/eventcore/drivers/posix.d | 1 + source/eventcore/drivers/winapi.d | 1 + 4 files changed, 4 insertions(+) diff --git a/source/eventcore/driver.d b/source/eventcore/driver.d index 99a38ef..5f8e68b 100644 --- a/source/eventcore/driver.d +++ b/source/eventcore/driver.d @@ -10,6 +10,7 @@ interface EventDriver { @property EventDriverCore core(); @property EventDriverTimers timers(); @property EventDriverEvents events(); + @property shared(EventDriverEvents) events() shared; @property EventDriverSignals signals(); @property EventDriverSockets sockets(); @property EventDriverDNS dns(); diff --git a/source/eventcore/drivers/libasync.d b/source/eventcore/drivers/libasync.d index 8807419..172cf3f 100644 --- a/source/eventcore/drivers/libasync.d +++ b/source/eventcore/drivers/libasync.d @@ -39,6 +39,7 @@ final class LibasyncEventDriver : EventDriver { override @property LibasyncEventDriverDNS dns() { return m_dns; } override @property LibasyncEventDriverTimers timers() { return m_timers; } override @property LibasyncEventDriverEvents events() { return m_events; } + override @property shared(LibasyncEventDriverEvents) events() shared { return m_events; } override @property LibasyncEventDriverSignals signals() { return m_signals; } override @property LibasyncEventDriverWatchers watchers() { return m_watchers; } diff --git a/source/eventcore/drivers/posix.d b/source/eventcore/drivers/posix.d index b634d8b..805de7f 100644 --- a/source/eventcore/drivers/posix.d +++ b/source/eventcore/drivers/posix.d @@ -91,6 +91,7 @@ final class PosixEventDriver(Loop : PosixEventLoop) : EventDriver { // force overriding these in the (final) sub classes to avoid virtual calls final override @property CoreDriver core() { return m_core; } final override @property EventsDriver events() { return m_events; } + final override @property shared(EventsDriver) events() shared { return m_events; } final override @property SignalsDriver signals() { return m_signals; } final override @property TimerDriver timers() { return m_timers; } final override @property SocketsDriver sockets() { return m_sockets; } diff --git a/source/eventcore/drivers/winapi.d b/source/eventcore/drivers/winapi.d index d9c743d..eea77e3 100644 --- a/source/eventcore/drivers/winapi.d +++ b/source/eventcore/drivers/winapi.d @@ -46,6 +46,7 @@ final class WinAPIEventDriver : EventDriver { override @property WinAPIEventDriverDNS dns() { return m_dns; } override @property WinAPIEventDriverTimers timers() { return m_timers; } override @property WinAPIEventDriverEvents events() { return m_events; } + override @property shared(WinAPIEventDriverEvents) events() shared { return m_events; } override @property WinAPIEventDriverSignals signals() { return m_signals; } override @property WinAPIEventDriverWatchers watchers() { return m_watchers; }