summaryrefslogtreecommitdiff
path: root/src/event/DeferEvent.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-11-12 17:34:06 +0100
committerMax Kellermann <max@musicpd.org>2017-11-12 17:34:06 +0100
commitb57e2f55215914b2d1e651635a7f1b0c6d97c91d (patch)
tree93b107b737659264dd4da297d6f7549c2c46a1fc /src/event/DeferEvent.cxx
parentbf3ced6a341ab8ca11357e94d7da8f7a41069c40 (diff)
event/DeferredMonitor: eliminate obsolete class
Move its code to DeferEvent instead.
Diffstat (limited to 'src/event/DeferEvent.cxx')
-rw-r--r--src/event/DeferEvent.cxx34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/event/DeferEvent.cxx b/src/event/DeferEvent.cxx
new file mode 100644
index 000000000..1d74b00d5
--- /dev/null
+++ b/src/event/DeferEvent.cxx
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2003-2017 The Music Player Daemon Project
+ * http://www.musicpd.org
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "config.h"
+#include "DeferEvent.hxx"
+#include "Loop.hxx"
+
+void
+DeferEvent::Cancel() noexcept
+{
+ loop.RemoveDeferred(*this);
+}
+
+void
+DeferEvent::Schedule() noexcept
+{
+ loop.AddDeferred(*this);
+}