Update clang format
Style only change
Change-Id: I41c97cbfb6a0ebf155a34166bc627f49a398442b
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/include/ADCSensor.hpp b/include/ADCSensor.hpp
index 2397093..fd248da 100644
--- a/include/ADCSensor.hpp
+++ b/include/ADCSensor.hpp
@@ -7,17 +7,17 @@
class ADCSensor : public Sensor
{
public:
- ADCSensor(const std::string &path,
- sdbusplus::asio::object_server &objectServer,
- std::shared_ptr<sdbusplus::asio::connection> &conn,
- boost::asio::io_service &io, const std::string &sensorName,
- std::vector<thresholds::Threshold> &&thresholds,
+ ADCSensor(const std::string& path,
+ sdbusplus::asio::object_server& objectServer,
+ std::shared_ptr<sdbusplus::asio::connection>& conn,
+ boost::asio::io_service& io, const std::string& sensorName,
+ std::vector<thresholds::Threshold>&& thresholds,
const double scaleFactor, PowerState readState,
- const std::string &sensorConfiguration);
+ const std::string& sensorConfiguration);
~ADCSensor();
private:
- sdbusplus::asio::object_server &objServer;
+ sdbusplus::asio::object_server& objServer;
boost::asio::posix::stream_descriptor inputDev;
boost::asio::deadline_timer waitTimer;
boost::asio::streambuf readBuf;
@@ -25,6 +25,6 @@
double scaleFactor;
PowerState readState;
void setupRead(void);
- void handleResponse(const boost::system::error_code &err);
+ void handleResponse(const boost::system::error_code& err);
void checkThresholds(void) override;
};
diff --git a/include/CPUSensor.hpp b/include/CPUSensor.hpp
index 10c1f4e..a38c84e 100644
--- a/include/CPUSensor.hpp
+++ b/include/CPUSensor.hpp
@@ -7,23 +7,23 @@
class CPUSensor : public Sensor
{
public:
- CPUSensor(const std::string &path, const std::string &objectType,
- sdbusplus::asio::object_server &objectServer,
- std::shared_ptr<sdbusplus::asio::connection> &conn,
- boost::asio::io_service &io, const std::string &fanName,
- std::vector<thresholds::Threshold> &&thresholds,
- const std::string &configuration);
+ CPUSensor(const std::string& path, const std::string& objectType,
+ sdbusplus::asio::object_server& objectServer,
+ std::shared_ptr<sdbusplus::asio::connection>& conn,
+ boost::asio::io_service& io, const std::string& fanName,
+ std::vector<thresholds::Threshold>&& thresholds,
+ const std::string& configuration);
~CPUSensor();
static constexpr unsigned int sensorScaleFactor = 1000;
static constexpr unsigned int sensorPollMs = 1000;
private:
- sdbusplus::asio::object_server &objServer;
+ sdbusplus::asio::object_server& objServer;
boost::asio::posix::stream_descriptor inputDev;
boost::asio::deadline_timer waitTimer;
boost::asio::streambuf readBuf;
int errCount;
void setupRead(void);
- void handleResponse(const boost::system::error_code &err);
+ void handleResponse(const boost::system::error_code& err);
void checkThresholds(void) override;
};
diff --git a/include/ExitAirTempSensor.hpp b/include/ExitAirTempSensor.hpp
index bd8b675..e06c20d 100644
--- a/include/ExitAirTempSensor.hpp
+++ b/include/ExitAirTempSensor.hpp
@@ -18,14 +18,14 @@
std::shared_ptr<ExitAirTempSensor> parent;
- CFMSensor(std::shared_ptr<sdbusplus::asio::connection> &conn,
- const std::string &name, const std::string &sensorConfiguration,
- sdbusplus::asio::object_server &objectServer,
- std::vector<thresholds::Threshold> &&thresholds,
- std::shared_ptr<ExitAirTempSensor> &parent);
+ CFMSensor(std::shared_ptr<sdbusplus::asio::connection>& conn,
+ const std::string& name, const std::string& sensorConfiguration,
+ sdbusplus::asio::object_server& objectServer,
+ std::vector<thresholds::Threshold>&& thresholds,
+ std::shared_ptr<ExitAirTempSensor>& parent);
~CFMSensor();
- bool calculate(double &);
+ bool calculate(double&);
void updateReading(void);
void checkThresholds(void) override;
@@ -35,8 +35,8 @@
boost::container::flat_map<std::string, std::pair<double, double>>
tachRanges;
std::shared_ptr<sdbusplus::asio::connection> dbusConnection;
- sdbusplus::asio::object_server &objServer;
- void addTachRanges(const std::string &serviceName, const std::string &path);
+ sdbusplus::asio::object_server& objServer;
+ void addTachRanges(const std::string& serviceName, const std::string& path);
};
struct ExitAirTempSensor : public Sensor
@@ -54,11 +54,11 @@
boost::container::flat_map<std::string, double> powerReadings;
std::vector<std::unique_ptr<CFMSensor>> cfmSensors;
- ExitAirTempSensor(std::shared_ptr<sdbusplus::asio::connection> &conn,
- const std::string &name,
- const std::string &sensorConfiguration,
- sdbusplus::asio::object_server &objectServer,
- std::vector<thresholds::Threshold> &&thresholds);
+ ExitAirTempSensor(std::shared_ptr<sdbusplus::asio::connection>& conn,
+ const std::string& name,
+ const std::string& sensorConfiguration,
+ sdbusplus::asio::object_server& objectServer,
+ std::vector<thresholds::Threshold>&& thresholds);
~ExitAirTempSensor();
void checkThresholds(void) override;
@@ -73,6 +73,6 @@
std::shared_ptr<sdbusplus::asio::connection> dbusConnection;
std::chrono::time_point<std::chrono::system_clock> lastTime;
double getTotalCFM(void);
- bool calculate(double &val);
+ bool calculate(double& val);
void setupMatches(void);
};
diff --git a/include/HwmonTempSensor.hpp b/include/HwmonTempSensor.hpp
index 3e582ab..9343576 100644
--- a/include/HwmonTempSensor.hpp
+++ b/include/HwmonTempSensor.hpp
@@ -7,21 +7,21 @@
class HwmonTempSensor : public Sensor
{
public:
- HwmonTempSensor(const std::string &path, const std::string &objectType,
- sdbusplus::asio::object_server &objectServer,
- std::shared_ptr<sdbusplus::asio::connection> &conn,
- boost::asio::io_service &io, const std::string &fanName,
- std::vector<thresholds::Threshold> &&thresholds,
- const std::string &sensorConfiguration);
+ HwmonTempSensor(const std::string& path, const std::string& objectType,
+ sdbusplus::asio::object_server& objectServer,
+ std::shared_ptr<sdbusplus::asio::connection>& conn,
+ boost::asio::io_service& io, const std::string& fanName,
+ std::vector<thresholds::Threshold>&& thresholds,
+ const std::string& sensorConfiguration);
~HwmonTempSensor();
private:
- sdbusplus::asio::object_server &objServer;
+ sdbusplus::asio::object_server& objServer;
boost::asio::posix::stream_descriptor inputDev;
boost::asio::deadline_timer waitTimer;
boost::asio::streambuf readBuf;
int errCount;
void setupRead(void);
- void handleResponse(const boost::system::error_code &err);
+ void handleResponse(const boost::system::error_code& err);
void checkThresholds(void) override;
};
\ No newline at end of file
diff --git a/include/IpmbSensor.hpp b/include/IpmbSensor.hpp
index d5b0290..b6bfa32 100644
--- a/include/IpmbSensor.hpp
+++ b/include/IpmbSensor.hpp
@@ -17,11 +17,11 @@
struct IpmbSensor : public Sensor
{
- IpmbSensor(std::shared_ptr<sdbusplus::asio::connection> &conn,
- boost::asio::io_service &io, const std::string &name,
- const std::string &sensorConfiguration,
- sdbusplus::asio::object_server &objectServer,
- std::vector<thresholds::Threshold> &&thresholds,
+ IpmbSensor(std::shared_ptr<sdbusplus::asio::connection>& conn,
+ boost::asio::io_service& io, const std::string& name,
+ const std::string& sensorConfiguration,
+ sdbusplus::asio::object_server& objectServer,
+ std::vector<thresholds::Threshold>&& thresholds,
uint8_t deviceAddress);
~IpmbSensor();
@@ -43,7 +43,7 @@
PowerState readState = PowerState::on;
private:
- sdbusplus::asio::object_server &objectServer;
+ sdbusplus::asio::object_server& objectServer;
std::shared_ptr<sdbusplus::asio::connection> dbusConnection;
boost::asio::deadline_timer waitTimer;
};
\ No newline at end of file
diff --git a/include/TachSensor.hpp b/include/TachSensor.hpp
index 9fc50a6..1e01859 100644
--- a/include/TachSensor.hpp
+++ b/include/TachSensor.hpp
@@ -6,13 +6,13 @@
#include <sdbusplus/asio/object_server.hpp>
#include <sensor.hpp>
-constexpr const char *gpioPath = "/sys/class/gpio/";
+constexpr const char* gpioPath = "/sys/class/gpio/";
class PresenceSensor
{
public:
PresenceSensor(const size_t index, bool inverted,
- boost::asio::io_service &io);
+ boost::asio::io_service& io);
~PresenceSensor();
void monitorPresence(void);
@@ -29,35 +29,35 @@
class RedundancySensor
{
public:
- RedundancySensor(size_t count, const std::vector<std::string> &children,
- sdbusplus::asio::object_server &objectServer);
+ RedundancySensor(size_t count, const std::vector<std::string>& children,
+ sdbusplus::asio::object_server& objectServer);
~RedundancySensor();
- void update(const std::string &name, bool failed);
+ void update(const std::string& name, bool failed);
private:
size_t count;
std::shared_ptr<sdbusplus::asio::dbus_interface> iface;
- sdbusplus::asio::object_server &objectServer;
+ sdbusplus::asio::object_server& objectServer;
boost::container::flat_map<std::string, bool> statuses;
};
class TachSensor : public Sensor
{
public:
- TachSensor(const std::string &path, const std::string &objectType,
- sdbusplus::asio::object_server &objectServer,
- std::shared_ptr<sdbusplus::asio::connection> &conn,
- std::unique_ptr<PresenceSensor> &&presence,
- const std::shared_ptr<RedundancySensor> &redundancy,
- boost::asio::io_service &io, const std::string &fanName,
- std::vector<thresholds::Threshold> &&thresholds,
- const std::string &sensorConfiguration,
- const std::pair<size_t, size_t> &limits);
+ TachSensor(const std::string& path, const std::string& objectType,
+ sdbusplus::asio::object_server& objectServer,
+ std::shared_ptr<sdbusplus::asio::connection>& conn,
+ std::unique_ptr<PresenceSensor>&& presence,
+ const std::shared_ptr<RedundancySensor>& redundancy,
+ boost::asio::io_service& io, const std::string& fanName,
+ std::vector<thresholds::Threshold>&& thresholds,
+ const std::string& sensorConfiguration,
+ const std::pair<size_t, size_t>& limits);
~TachSensor();
private:
- sdbusplus::asio::object_server &objServer;
+ sdbusplus::asio::object_server& objServer;
std::shared_ptr<RedundancySensor> redundancy;
std::unique_ptr<PresenceSensor> presence;
boost::asio::posix::stream_descriptor inputDev;
@@ -65,6 +65,6 @@
boost::asio::streambuf readBuf;
int errCount;
void setupRead(void);
- void handleResponse(const boost::system::error_code &err);
+ void handleResponse(const boost::system::error_code& err);
void checkThresholds(void) override;
};
diff --git a/include/Thresholds.hpp b/include/Thresholds.hpp
index 3f9aa79..8bcc4fa 100644
--- a/include/Thresholds.hpp
+++ b/include/Thresholds.hpp
@@ -17,7 +17,7 @@
};
struct Threshold
{
- Threshold(const Level &lev, const Direction &dir, const double &val,
+ Threshold(const Level& lev, const Direction& dir, const double& val,
bool write = true) :
level(lev),
direction(dir), value(val), writeable(write)
@@ -31,25 +31,25 @@
};
bool parseThresholdsFromConfig(
- const SensorData &sensorData,
- std::vector<thresholds::Threshold> &thresholdVector,
- const std::string *matchLabel = nullptr);
+ const SensorData& sensorData,
+ std::vector<thresholds::Threshold>& thresholdVector,
+ const std::string* matchLabel = nullptr);
-bool parseThresholdsFromAttr(std::vector<thresholds::Threshold> &thresholds,
- const std::string &inputPath,
- const double &scaleFactor);
+bool parseThresholdsFromAttr(std::vector<thresholds::Threshold>& thresholds,
+ const std::string& inputPath,
+ const double& scaleFactor);
bool hasCriticalInterface(
- const std::vector<thresholds::Threshold> &thresholdVector);
+ const std::vector<thresholds::Threshold>& thresholdVector);
bool hasWarningInterface(
- const std::vector<thresholds::Threshold> &thresholdVector);
+ const std::vector<thresholds::Threshold>& thresholdVector);
-void persistThreshold(const std::string &baseInterface, const std::string &path,
- const thresholds::Threshold &threshold,
- std::shared_ptr<sdbusplus::asio::connection> &conn);
+void persistThreshold(const std::string& baseInterface, const std::string& path,
+ const thresholds::Threshold& threshold,
+ std::shared_ptr<sdbusplus::asio::connection>& conn);
// returns false if a critical threshold has been crossed, true otherwise
-bool checkThresholds(Sensor *sensor);
-void assertThresholds(Sensor *sensor, thresholds::Level level,
+bool checkThresholds(Sensor* sensor);
+void assertThresholds(Sensor* sensor, thresholds::Level level,
thresholds::Direction direction, bool assert);
} // namespace thresholds
diff --git a/include/VariantVisitors.hpp b/include/VariantVisitors.hpp
index 7b23977..6549a32 100644
--- a/include/VariantVisitors.hpp
+++ b/include/VariantVisitors.hpp
@@ -22,7 +22,8 @@
struct VariantToFloatVisitor
{
- template <typename T> float operator()(const T &t) const
+ template <typename T>
+ float operator()(const T& t) const
{
if constexpr (std::is_arithmetic_v<T>)
{
@@ -34,7 +35,8 @@
struct VariantToIntVisitor
{
- template <typename T> int operator()(const T &t) const
+ template <typename T>
+ int operator()(const T& t) const
{
if constexpr (std::is_arithmetic_v<T>)
{
@@ -46,7 +48,8 @@
struct VariantToUnsignedIntVisitor
{
- template <typename T> unsigned int operator()(const T &t) const
+ template <typename T>
+ unsigned int operator()(const T& t) const
{
if constexpr (std::is_arithmetic_v<T>)
{
@@ -58,7 +61,8 @@
struct VariantToStringVisitor
{
- template <typename T> std::string operator()(const T &t) const
+ template <typename T>
+ std::string operator()(const T& t) const
{
if constexpr (std::is_same_v<T, std::string>)
{
@@ -74,7 +78,8 @@
struct VariantToDoubleVisitor
{
- template <typename T> double operator()(const T &t) const
+ template <typename T>
+ double operator()(const T& t) const
{
if constexpr (std::is_arithmetic_v<T>)
{
diff --git a/include/sensor.hpp b/include/sensor.hpp
index 73e44d2..de790c8 100644
--- a/include/sensor.hpp
+++ b/include/sensor.hpp
@@ -6,9 +6,9 @@
constexpr size_t sensorFailedPollTimeMs = 5000;
struct Sensor
{
- Sensor(const std::string &name, const std::string &path,
- std::vector<thresholds::Threshold> &&thresholdData,
- const std::string &configurationPath, const std::string &objectType,
+ Sensor(const std::string& name, const std::string& path,
+ std::vector<thresholds::Threshold>&& thresholdData,
+ const std::string& configurationPath, const std::string& objectType,
const double max, const double min) :
name(name),
path(path), thresholds(std::move(thresholdData)),
@@ -32,7 +32,7 @@
bool overridenState = false;
bool internalSet = false;
- int setSensorValue(const double &newValue, double &oldValue)
+ int setSensorValue(const double& newValue, double& oldValue)
{
if (internalSet)
{
@@ -46,16 +46,16 @@
}
void
- setInitialProperties(std::shared_ptr<sdbusplus::asio::connection> &conn)
+ setInitialProperties(std::shared_ptr<sdbusplus::asio::connection>& conn)
{
sensorInterface->register_property("MaxValue", maxValue);
sensorInterface->register_property("MinValue", minValue);
sensorInterface->register_property(
- "Value", value, [&](const double &newValue, double &oldValue) {
+ "Value", value, [&](const double& newValue, double& oldValue) {
return setSensorValue(newValue, oldValue);
});
- for (auto &threshold : thresholds)
+ for (auto& threshold : thresholds)
{
std::shared_ptr<sdbusplus::asio::dbus_interface> iface;
std::string level;
@@ -101,7 +101,7 @@
}
iface->register_property(
level, threshold.value,
- [&](const double &request, double &oldValue) {
+ [&](const double& request, double& oldValue) {
oldValue = request; // todo, just let the config do this?
threshold.value = request;
thresholds::persistThreshold(configurationPath, objectType,
@@ -127,7 +127,7 @@
}
}
- void updateValue(const double &newValue)
+ void updateValue(const double& newValue)
{
// Indicate that it is internal set call
internalSet = true;