Commit 090bc6fa authored by Max Kellermann's avatar Max Kellermann

event/*Monitor: add method GetEventLoop()

parent b63db1c1
...@@ -44,6 +44,10 @@ public: ...@@ -44,6 +44,10 @@ public:
Cancel(); Cancel();
} }
EventLoop &GetEventLoop() {
return loop;
}
void Schedule(); void Schedule();
void Cancel(); void Cancel();
......
...@@ -63,7 +63,10 @@ public: ...@@ -63,7 +63,10 @@ public:
MultiSocketMonitor(EventLoop &_loop); MultiSocketMonitor(EventLoop &_loop);
~MultiSocketMonitor(); ~MultiSocketMonitor();
public: EventLoop &GetEventLoop() {
return loop;
}
gcc_pure gcc_pure
gint64 GetTime() const { gint64 GetTime() const {
return g_source_get_time(&source->base); return g_source_get_time(&source->base);
......
...@@ -66,6 +66,10 @@ public: ...@@ -66,6 +66,10 @@ public:
~SocketMonitor(); ~SocketMonitor();
EventLoop &GetEventLoop() {
return loop;
}
bool IsDefined() const { bool IsDefined() const {
return fd >= 0; return fd >= 0;
} }
......
...@@ -38,6 +38,10 @@ public: ...@@ -38,6 +38,10 @@ public:
Cancel(); Cancel();
} }
EventLoop &GetEventLoop() {
return loop;
}
bool IsActive() const { bool IsActive() const {
return source != nullptr; return source != nullptr;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment