sdbusplus: use shorter type aliases
The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are for:
* bus_t
* exception_t
* manager_t
* match_t
* message_t
* object_t
* slot_t
Change-Id: Ie0805a98908ddca5c97471588adc160d9f5633c6
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/health_metric.hpp b/health_metric.hpp
index e0c75f9..01f6836 100644
--- a/health_metric.hpp
+++ b/health_metric.hpp
@@ -42,7 +42,7 @@
HealthMetric(HealthMetric&&) = delete;
virtual ~HealthMetric() = default;
- HealthMetric(sdbusplus::bus::bus& bus, phosphor::health::metric::Type type,
+ HealthMetric(sdbusplus::bus_t& bus, phosphor::health::metric::Type type,
const config::HealthMetric& config, const paths_t& bmcPaths) :
MetricIntf(bus, getPath(config.subType).c_str(), action::defer_emit),
bus(bus), type(type), config(config)
@@ -67,7 +67,7 @@
/** @brief Get the object path for the given subtype */
auto getPath(SubType subType) -> std::string;
/** @brief D-Bus bus connection */
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/** @brief Metric type */
phosphor::health::metric::Type type;
/** @brief Metric configuration */
diff --git a/test/test_health_metric.cpp b/test/test_health_metric.cpp
index 9e9f1f5..1fd0b15 100644
--- a/test/test_health_metric.cpp
+++ b/test/test_health_metric.cpp
@@ -24,7 +24,7 @@
{
public:
sdbusplus::SdBusMock sdbusMock;
- sdbusplus::bus::bus bus = sdbusplus::get_mocked_new(&sdbusMock);
+ sdbusplus::bus_t bus = sdbusplus::get_mocked_new(&sdbusMock);
static constexpr auto busName = "xyz.openbmc_project.test.HealthMon";
const std::set<std::string> properties = {"Value", "MaxValue", "MinValue",
"Unit"};
@@ -49,7 +49,7 @@
TEST_F(HealthMetricTest, TestMetricUnmockedObjectAddRemove)
{
- sdbusplus::bus::bus unmockedBus = sdbusplus::bus::new_bus();
+ sdbusplus::bus_t unmockedBus = sdbusplus::bus::new_bus();
unmockedBus.request_name(busName);
auto metric = std::make_unique<HealthMetric>(unmockedBus, Type::cpu, config,
paths_t());