summaryrefslogtreecommitdiffstats
path: root/src/watch.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/watch.hpp')
-rw-r--r--src/watch.hpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/watch.hpp b/src/watch.hpp
new file mode 100644
index 0000000..1ba671d
--- /dev/null
+++ b/src/watch.hpp
@@ -0,0 +1,36 @@
+#pragma once
+
+namespace phosphor
+{
+namespace dbus
+{
+namespace monitoring
+{
+
+/** @class Watch
+ * @brief Watch interface.
+ *
+ * The start method is invoked by main() on all watches of any type
+ * at application startup, to allow watches to perform custom setup
+ * or initialization. Typical implementations might register dbus
+ * callbacks or perform queries.
+ *
+ * Watches of any type can be started.
+ */
+class Watch
+{
+ public:
+ Watch() = default;
+ Watch(const Watch&) = default;
+ Watch(Watch&&) = default;
+ Watch& operator=(const Watch&) = default;
+ Watch& operator=(Watch&&) = default;
+ virtual ~Watch() = default;
+
+ /** @brief Start the watch. */
+ virtual void start() = 0;
+};
+
+} // namespace monitoring
+} // namespace dbus
+} // namespace phosphor
OpenPOWER on IntegriCloud