Start using .clang-format
Used the one from docs/style/cpp.
Change-Id: I3bdc2b353bf18a437266b362d8205b8463a9ce2b
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/device_monitor.hpp b/device_monitor.hpp
index 3bde1b5..191c2bc 100644
--- a/device_monitor.hpp
+++ b/device_monitor.hpp
@@ -1,11 +1,12 @@
#pragma once
+#include "device.hpp"
+
#include <phosphor-logging/log.hpp>
#include <sdbusplus/bus.hpp>
#include <sdbusplus/server.hpp>
#include <sdeventplus/clock.hpp>
#include <sdeventplus/event.hpp>
#include <sdeventplus/utility/timer.hpp>
-#include "device.hpp"
namespace witherspoon
{
@@ -23,62 +24,59 @@
*/
class DeviceMonitor
{
- public:
+ public:
+ DeviceMonitor() = delete;
+ ~DeviceMonitor() = default;
+ DeviceMonitor(const DeviceMonitor&) = delete;
+ DeviceMonitor& operator=(const DeviceMonitor&) = delete;
+ DeviceMonitor(DeviceMonitor&&) = delete;
+ DeviceMonitor& operator=(DeviceMonitor&&) = delete;
- DeviceMonitor() = delete;
- ~DeviceMonitor() = default;
- DeviceMonitor(const DeviceMonitor&) = delete;
- DeviceMonitor& operator=(const DeviceMonitor&) = delete;
- DeviceMonitor(DeviceMonitor&&) = delete;
- DeviceMonitor& operator=(DeviceMonitor&&) = delete;
+ /**
+ * Constructor
+ *
+ * @param[in] d - device to monitor
+ * @param[in] e - event object
+ * @param[in] i - polling interval in ms
+ */
+ DeviceMonitor(std::unique_ptr<Device>&& d, const sdeventplus::Event& e,
+ std::chrono::milliseconds i) :
+ device(std::move(d)),
+ timer(e, std::bind(&DeviceMonitor::analyze, this), i)
+ {
+ }
- /**
- * Constructor
- *
- * @param[in] d - device to monitor
- * @param[in] e - event object
- * @param[in] i - polling interval in ms
- */
- DeviceMonitor(std::unique_ptr<Device>&& d,
- const sdeventplus::Event& e,
- std::chrono::milliseconds i) :
- device(std::move(d)),
- timer(e, std::bind(&DeviceMonitor::analyze, this), i)
- {
- }
+ /**
+ * Starts the timer to monitor the device on an interval.
+ */
+ virtual int run()
+ {
+ return timer.get_event().loop();
+ }
- /**
- * Starts the timer to monitor the device on an interval.
- */
- virtual int run()
- {
- return timer.get_event().loop();
- }
+ protected:
+ /**
+ * Analyzes the device for faults
+ *
+ * Runs in the timer callback
+ *
+ * Override if desired
+ */
+ virtual void analyze()
+ {
+ device->analyze();
+ }
- protected:
+ /**
+ * The device to run the analysis on
+ */
+ std::unique_ptr<Device> device;
- /**
- * Analyzes the device for faults
- *
- * Runs in the timer callback
- *
- * Override if desired
- */
- virtual void analyze()
- {
- device->analyze();
- }
-
- /**
- * The device to run the analysis on
- */
- std::unique_ptr<Device> device;
-
- /**
- * The timer that runs fault check polls.
- */
- sdeventplus::utility::Timer<sdeventplus::ClockId::Monotonic> timer;
+ /**
+ * The timer that runs fault check polls.
+ */
+ sdeventplus::utility::Timer<sdeventplus::ClockId::Monotonic> timer;
};
-}
-}
+} // namespace power
+} // namespace witherspoon