add .clang-format
Change-Id: I6627b5569c2e0f730be7331403218b823a2c622f
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/dbus/util.hpp b/dbus/util.hpp
index 5b1522f..e459524 100644
--- a/dbus/util.hpp
+++ b/dbus/util.hpp
@@ -14,46 +14,44 @@
class DbusHelperInterface
{
- public:
- virtual ~DbusHelperInterface() = default;
+ public:
+ virtual ~DbusHelperInterface() = default;
- /** @brief Get the service providing the interface for the path.
- */
- virtual std::string GetService(sdbusplus::bus::bus& bus,
- const std::string& intf,
- const std::string& path) = 0;
+ /** @brief Get the service providing the interface for the path.
+ */
+ virtual std::string GetService(sdbusplus::bus::bus& bus,
+ const std::string& intf,
+ const std::string& path) = 0;
- /** @brief Get all Sensor.Value properties for a service and path.
- *
- * @param[in] bus - A bus to use for the call.
- * @param[in] service - The service providing the interface.
- * @param[in] path - The dbus path.
- * @param[out] prop - A pointer to a properties struct to fill out.
- */
- virtual void GetProperties(sdbusplus::bus::bus& bus,
- const std::string& service,
- const std::string& path,
- struct SensorProperties* prop) = 0;
+ /** @brief Get all Sensor.Value properties for a service and path.
+ *
+ * @param[in] bus - A bus to use for the call.
+ * @param[in] service - The service providing the interface.
+ * @param[in] path - The dbus path.
+ * @param[out] prop - A pointer to a properties struct to fill out.
+ */
+ virtual void GetProperties(sdbusplus::bus::bus& bus,
+ const std::string& service,
+ const std::string& path,
+ struct SensorProperties* prop) = 0;
};
class DbusHelper : public DbusHelperInterface
{
- public:
- DbusHelper() = default;
- ~DbusHelper() = default;
- DbusHelper(const DbusHelper&) = default;
- DbusHelper& operator=(const DbusHelper&) = default;
- DbusHelper(DbusHelper&&) = default;
- DbusHelper& operator=(DbusHelper&&) = default;
+ public:
+ DbusHelper() = default;
+ ~DbusHelper() = default;
+ DbusHelper(const DbusHelper&) = default;
+ DbusHelper& operator=(const DbusHelper&) = default;
+ DbusHelper(DbusHelper&&) = default;
+ DbusHelper& operator=(DbusHelper&&) = default;
- std::string GetService(sdbusplus::bus::bus& bus,
- const std::string& intf,
- const std::string& path) override;
+ std::string GetService(sdbusplus::bus::bus& bus, const std::string& intf,
+ const std::string& path) override;
- void GetProperties(sdbusplus::bus::bus& bus,
- const std::string& service,
- const std::string& path,
- struct SensorProperties* prop) override;
+ void GetProperties(sdbusplus::bus::bus& bus, const std::string& service,
+ const std::string& path,
+ struct SensorProperties* prop) override;
};
std::string GetSensorPath(const std::string& type, const std::string& id);
@@ -64,14 +62,14 @@
{
template <typename T>
std::enable_if_t<std::is_arithmetic<T>::value, float>
- operator()(const T &t) const
+ operator()(const T& t) const
{
return static_cast<float>(t);
}
template <typename T>
std::enable_if_t<!std::is_arithmetic<T>::value, float>
- operator()(const T &t) const
+ operator()(const T& t) const
{
throw std::invalid_argument("Cannot translate type to float");
}
@@ -81,14 +79,14 @@
{
template <typename T>
std::enable_if_t<std::is_arithmetic<T>::value, double>
- operator()(const T &t) const
+ operator()(const T& t) const
{
return static_cast<double>(t);
}
template <typename T>
std::enable_if_t<!std::is_arithmetic<T>::value, double>
- operator()(const T &t) const
+ operator()(const T& t) const
{
throw std::invalid_argument("Cannot translate type to double");
}