aboutsummaryrefslogtreecommitdiffstats
path: root/src/StateFile.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-10 19:08:42 +0100
committerMax Kellermann <max@duempel.org>2013-01-14 11:12:28 +0100
commitd3a479b7fa1d1e52f9d3950139643fe7e3ff5a57 (patch)
tree4996c42d621876770a6d80bc8d031be9ee97676a /src/StateFile.hxx
parent92fb0e829a9b61d1b1db4bdbe6096c1772b7c819 (diff)
downloadmpd-d3a479b7fa1d1e52f9d3950139643fe7e3ff5a57.tar.gz
mpd-d3a479b7fa1d1e52f9d3950139643fe7e3ff5a57.tar.xz
mpd-d3a479b7fa1d1e52f9d3950139643fe7e3ff5a57.zip
event/TimeoutMonitor: wrapper for g_timeout_source_new()
Diffstat (limited to 'src/StateFile.hxx')
-rw-r--r--src/StateFile.hxx13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/StateFile.hxx b/src/StateFile.hxx
index 0888b25ad..39c3fcdf6 100644
--- a/src/StateFile.hxx
+++ b/src/StateFile.hxx
@@ -20,21 +20,17 @@
#ifndef MPD_STATE_FILE_HXX
#define MPD_STATE_FILE_HXX
-#include <glib.h>
+#include "event/TimeoutMonitor.hxx"
+#include "gcc.h"
#include <string>
struct Partition;
-class EventLoop;
-class StateFile {
+class StateFile final : private TimeoutMonitor {
std::string path;
Partition &partition;
- EventLoop &loop;
-
- /** the GLib source id for the save timer */
- guint source_id;
/**
* These version numbers determine whether we need to save the state
@@ -45,14 +41,13 @@ class StateFile {
public:
StateFile(const char *path, Partition &partition, EventLoop &loop);
- ~StateFile();
void Read();
void Write();
void AutoWrite();
private:
- static gboolean TimerCallback(gpointer data);
+ virtual bool OnTimeout() override;
};
#endif /* STATE_FILE_H */