diff options
author | Max Kellermann <max@duempel.org> | 2013-08-08 21:49:17 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-08-08 23:03:38 +0200 |
commit | 090bc6fa794589afacc8b22f50b6d3aeb39fe0bd (patch) | |
tree | 8e4a4069f4533da140903e5199a9d657a51050b9 | |
parent | b63db1c1aa220cf9866f6b8b01b62f16e15c58a1 (diff) | |
download | mpd-090bc6fa794589afacc8b22f50b6d3aeb39fe0bd.tar.gz mpd-090bc6fa794589afacc8b22f50b6d3aeb39fe0bd.tar.xz mpd-090bc6fa794589afacc8b22f50b6d3aeb39fe0bd.zip |
event/*Monitor: add method GetEventLoop()
Diffstat (limited to '')
-rw-r--r-- | src/event/DeferredMonitor.hxx | 4 | ||||
-rw-r--r-- | src/event/MultiSocketMonitor.hxx | 5 | ||||
-rw-r--r-- | src/event/SocketMonitor.hxx | 4 | ||||
-rw-r--r-- | src/event/TimeoutMonitor.hxx | 4 |
4 files changed, 16 insertions, 1 deletions
diff --git a/src/event/DeferredMonitor.hxx b/src/event/DeferredMonitor.hxx index abc11b0b3..ffa83359d 100644 --- a/src/event/DeferredMonitor.hxx +++ b/src/event/DeferredMonitor.hxx @@ -44,6 +44,10 @@ public: Cancel(); } + EventLoop &GetEventLoop() { + return loop; + } + void Schedule(); void Cancel(); diff --git a/src/event/MultiSocketMonitor.hxx b/src/event/MultiSocketMonitor.hxx index bf0a221a2..781fdeca6 100644 --- a/src/event/MultiSocketMonitor.hxx +++ b/src/event/MultiSocketMonitor.hxx @@ -63,7 +63,10 @@ public: MultiSocketMonitor(EventLoop &_loop); ~MultiSocketMonitor(); -public: + EventLoop &GetEventLoop() { + return loop; + } + gcc_pure gint64 GetTime() const { return g_source_get_time(&source->base); diff --git a/src/event/SocketMonitor.hxx b/src/event/SocketMonitor.hxx index 1abeb82ca..85866280c 100644 --- a/src/event/SocketMonitor.hxx +++ b/src/event/SocketMonitor.hxx @@ -66,6 +66,10 @@ public: ~SocketMonitor(); + EventLoop &GetEventLoop() { + return loop; + } + bool IsDefined() const { return fd >= 0; } diff --git a/src/event/TimeoutMonitor.hxx b/src/event/TimeoutMonitor.hxx index 4ebc6b644..b0550933e 100644 --- a/src/event/TimeoutMonitor.hxx +++ b/src/event/TimeoutMonitor.hxx @@ -38,6 +38,10 @@ public: Cancel(); } + EventLoop &GetEventLoop() { + return loop; + } + bool IsActive() const { return source != nullptr; } |