event/*Monitor: add method GetEventLoop()

This commit is contained in:
Max Kellermann 2013-08-08 21:49:17 +02:00
parent b63db1c1aa
commit 090bc6fa79
4 changed files with 16 additions and 1 deletions

View File

@ -44,6 +44,10 @@ public:
Cancel(); Cancel();
} }
EventLoop &GetEventLoop() {
return loop;
}
void Schedule(); void Schedule();
void Cancel(); void Cancel();

View File

@ -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);

View File

@ -66,6 +66,10 @@ public:
~SocketMonitor(); ~SocketMonitor();
EventLoop &GetEventLoop() {
return loop;
}
bool IsDefined() const { bool IsDefined() const {
return fd >= 0; return fd >= 0;
} }

View File

@ -38,6 +38,10 @@ public:
Cancel(); Cancel();
} }
EventLoop &GetEventLoop() {
return loop;
}
bool IsActive() const { bool IsActive() const {
return source != nullptr; return source != nullptr;
} }