clang-format: Update to match docs repo
Update the .clang-format file and run clang-format-6.0.
This .clang-format matches the example one in
https://github.com/openbmc/docs/blob/master/cpp-style-and-conventions.md#clang-formatting
Change-Id: Id6760866dedbaeafd83ea8ef2e0303e30b8955aa
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/occ_manager.hpp b/occ_manager.hpp
index 542c7d9..20002e4 100644
--- a/occ_manager.hpp
+++ b/occ_manager.hpp
@@ -1,13 +1,14 @@
#pragma once
-#include <cstring>
-#include <vector>
-#include <functional>
-#include <sdbusplus/bus.hpp>
#include "occ_pass_through.hpp"
#include "occ_status.hpp"
#include "powercap.hpp"
+#include <cstring>
+#include <functional>
+#include <sdbusplus/bus.hpp>
+#include <vector>
+
namespace sdbusRule = sdbusplus::bus::match::rules;
namespace open_power
{
@@ -19,102 +20,99 @@
*/
struct Manager
{
- public:
- Manager() = delete;
- Manager(const Manager&) = delete;
- Manager& operator=(const Manager&) = delete;
- Manager(Manager&&) = delete;
- Manager& operator=(Manager&&) = delete;
- ~Manager() = default;
+ public:
+ Manager() = delete;
+ Manager(const Manager&) = delete;
+ Manager& operator=(const Manager&) = delete;
+ Manager(Manager&&) = delete;
+ Manager& operator=(Manager&&) = delete;
+ ~Manager() = default;
- /** @brief Adds OCC pass-through and status objects on the bus
- * when corresponding CPU inventory is created.
- *
- * @param[in] bus - handle to the bus
- * @param[in] event - Unique ptr reference to sd_event
- */
- Manager(sdbusplus::bus::bus& bus,
- EventPtr& event) :
- bus(bus),
- event(event)
- {
+ /** @brief Adds OCC pass-through and status objects on the bus
+ * when corresponding CPU inventory is created.
+ *
+ * @param[in] bus - handle to the bus
+ * @param[in] event - Unique ptr reference to sd_event
+ */
+ Manager(sdbusplus::bus::bus& bus, EventPtr& event) : bus(bus), event(event)
+ {
#ifdef I2C_OCC
- // I2C OCC status objects are initialized directly
- initStatusObjects();
+ // I2C OCC status objects are initialized directly
+ initStatusObjects();
#else
- findAndCreateObjects();
+ findAndCreateObjects();
#endif
- }
+ }
- inline auto getNumOCCs() const
- {
- return activeCount;
- }
+ inline auto getNumOCCs() const
+ {
+ return activeCount;
+ }
- private:
- /** @brief Checks if the CPU inventory is present and if so, creates
- * the occ D-Bus objects. Else, registers a handler to be
- * called when inventory is created.
- */
- void findAndCreateObjects();
+ private:
+ /** @brief Checks if the CPU inventory is present and if so, creates
+ * the occ D-Bus objects. Else, registers a handler to be
+ * called when inventory is created.
+ */
+ void findAndCreateObjects();
- /** @brief Callback that responds to cpu creation in the inventory -
- * by creating the needed objects.
- *
- * @param[in] msg - bus message
- *
- * @returns 0 to indicate success
- */
- int cpuCreated(sdbusplus::message::message& msg);
+ /** @brief Callback that responds to cpu creation in the inventory -
+ * by creating the needed objects.
+ *
+ * @param[in] msg - bus message
+ *
+ * @returns 0 to indicate success
+ */
+ int cpuCreated(sdbusplus::message::message& msg);
- /** @brief Create child OCC objects.
- *
- * @param[in] occ - the occ name, such as occ0.
- */
- void createObjects(const std::string& occ);
+ /** @brief Create child OCC objects.
+ *
+ * @param[in] occ - the occ name, such as occ0.
+ */
+ void createObjects(const std::string& occ);
- /** @brief Callback handler invoked by Status object when the OccActive
- * property is changed. This is needed to make sure that the
- * error detection is started only after all the OCCs are bound.
- * Similarly, when one of the OCC gets its OccActive property
- * un-set, then the OCC error detection needs to be stopped on
- * all the OCCs
- *
- * @param[in] status - OccActive status
- */
- void statusCallBack(bool status);
+ /** @brief Callback handler invoked by Status object when the OccActive
+ * property is changed. This is needed to make sure that the
+ * error detection is started only after all the OCCs are bound.
+ * Similarly, when one of the OCC gets its OccActive property
+ * un-set, then the OCC error detection needs to be stopped on
+ * all the OCCs
+ *
+ * @param[in] status - OccActive status
+ */
+ void statusCallBack(bool status);
- /** @brief Sends a Heartbeat command to host control command handler */
- void sendHeartBeat();
+ /** @brief Sends a Heartbeat command to host control command handler */
+ void sendHeartBeat();
- /** @brief reference to the bus */
- sdbusplus::bus::bus& bus;
+ /** @brief reference to the bus */
+ sdbusplus::bus::bus& bus;
- /** @brief reference to sd_event wrapped in unique_ptr */
- EventPtr& event;
+ /** @brief reference to sd_event wrapped in unique_ptr */
+ EventPtr& event;
- /** @brief OCC pass-through objects */
- std::vector<std::unique_ptr<PassThrough>> passThroughObjects;
+ /** @brief OCC pass-through objects */
+ std::vector<std::unique_ptr<PassThrough>> passThroughObjects;
- /** @brief OCC Status objects */
- std::vector<std::unique_ptr<Status>> statusObjects;
+ /** @brief OCC Status objects */
+ std::vector<std::unique_ptr<Status>> statusObjects;
- /** @brief Power cap monitor and occ notification object */
- std::unique_ptr<open_power::occ::powercap::PowerCap> pcap;
+ /** @brief Power cap monitor and occ notification object */
+ std::unique_ptr<open_power::occ::powercap::PowerCap> pcap;
- /** @brief sbdbusplus match objects */
- std::vector<sdbusplus::bus::match_t> cpuMatches;
+ /** @brief sbdbusplus match objects */
+ std::vector<sdbusplus::bus::match_t> cpuMatches;
- /** @brief Number of OCCs that are bound */
- uint8_t activeCount = 0;
+ /** @brief Number of OCCs that are bound */
+ uint8_t activeCount = 0;
#ifdef I2C_OCC
- /** @brief Init Status objects for I2C OCC devices
- *
- * It iterates in /sys/bus/i2c/devices, finds all occ hwmon devices
- * and creates status objects.
- */
- void initStatusObjects();
+ /** @brief Init Status objects for I2C OCC devices
+ *
+ * It iterates in /sys/bus/i2c/devices, finds all occ hwmon devices
+ * and creates status objects.
+ */
+ void initStatusObjects();
#endif
};