summaryrefslogtreecommitdiff
path: root/src/lib/monitor_checker.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-10-09 19:19:45 +0100
committerCarl Hetherington <cth@carlh.net>2018-10-09 20:11:33 +0100
commit2eab969654eca2ef4b222790c8b730a6eb709565 (patch)
treebe8b463ce2c56692275e550fd419b7bce707d414 /src/lib/monitor_checker.h
parentbc5b4d4dc178dad75eacb02fd2d4e98c7d3801ec (diff)
swaroop: required monitors checks.
Diffstat (limited to 'src/lib/monitor_checker.h')
-rw-r--r--src/lib/monitor_checker.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/lib/monitor_checker.h b/src/lib/monitor_checker.h
new file mode 100644
index 000000000..4f856f41f
--- /dev/null
+++ b/src/lib/monitor_checker.h
@@ -0,0 +1,45 @@
+/*
+ Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic 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.
+
+ DCP-o-matic 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 DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "signaller.h"
+#include <boost/signals2.hpp>
+
+class MonitorChecker : public Signaller, public boost::noncopyable
+{
+public:
+ ~MonitorChecker ();
+
+ void run ();
+
+ bool ok () const;
+ boost::signals2::signal<void (void)> StateChanged;
+
+ static MonitorChecker* instance ();
+private:
+ static MonitorChecker* _instance;
+
+ MonitorChecker ();
+ void thread ();
+
+ boost::thread* _thread;
+ mutable boost::mutex _mutex;
+ bool _terminate;
+ bool _ok;
+};