event/TimeoutMonitor: wrapper for g_timeout_source_new()
This commit is contained in:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user