event/TimeoutMonitor: wrapper for g_timeout_source_new()

This commit is contained in:
Max Kellermann
2013-01-10 19:08:42 +01:00
parent 92fb0e829a
commit d3a479b7fa
9 changed files with 153 additions and 60 deletions
+5 -6
View File
@@ -20,23 +20,22 @@
#ifndef MPD_INOTIFY_QUEUE_HXX
#define MPD_INOTIFY_QUEUE_HXX
#include <glib.h>
#include "event/TimeoutMonitor.hxx"
#include "gcc.h"
#include <list>
#include <string>
class InotifyQueue {
class InotifyQueue final : private TimeoutMonitor {
std::list<std::string> queue;
guint source_id;
public:
~InotifyQueue();
InotifyQueue(EventLoop &_loop):TimeoutMonitor(_loop) {}
void Enqueue(const char *uri_utf8);
private:
bool Run();
static gboolean Run(gpointer ctx);
virtual bool OnTimeout() override;
};
#endif