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
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ief05bd757cffb1453e058a719ee4b060861752e7
diff --git a/power-supply/average.hpp b/power-supply/average.hpp
index bbbda54..2a05912 100644
--- a/power-supply/average.hpp
+++ b/power-supply/average.hpp
@@ -11,7 +11,7 @@
{
template <typename T>
-using ServerObject = typename sdbusplus::server::object::object<T>;
+using ServerObject = typename sdbusplus::server::object_t<T>;
using AverageInterface =
sdbusplus::org::open_power::Sensor::Aggregation::History::server::Average;
@@ -42,7 +42,7 @@
* @param[in] bus - D-Bus object
* @param[in] objectPath - the D-Bus object path
*/
- Average(sdbusplus::bus::bus& bus, const std::string& objectPath) :
+ Average(sdbusplus::bus_t& bus, const std::string& objectPath) :
ServerObject<AverageInterface>(bus, objectPath.c_str())
{
unit(Average::Unit::Watts);
diff --git a/power-supply/main.cpp b/power-supply/main.cpp
index 00dae73..b526264 100644
--- a/power-supply/main.cpp
+++ b/power-supply/main.cpp
@@ -127,7 +127,7 @@
psuDevice->enableHistory(basePath, numRecords, syncGPIOPath, gpioNum);
// Systemd object manager
- sdbusplus::server::manager::manager objManager{bus, basePath.c_str()};
+ sdbusplus::server::manager_t objManager{bus, basePath.c_str()};
std::string busName =
std::string{INPUT_HISTORY_BUSNAME_ROOT} + '.' + name;
diff --git a/power-supply/maximum.hpp b/power-supply/maximum.hpp
index 2056510..599548e 100644
--- a/power-supply/maximum.hpp
+++ b/power-supply/maximum.hpp
@@ -11,7 +11,7 @@
{
template <typename T>
-using ServerObject = typename sdbusplus::server::object::object<T>;
+using ServerObject = typename sdbusplus::server::object_t<T>;
using MaximumInterface =
sdbusplus::org::open_power::Sensor::Aggregation::History::server::Maximum;
@@ -42,7 +42,7 @@
* @param[in] bus - D-Bus object
* @param[in] objectPath - the D-Bus object path
*/
- Maximum(sdbusplus::bus::bus& bus, const std::string& objectPath) :
+ Maximum(sdbusplus::bus_t& bus, const std::string& objectPath) :
ServerObject<MaximumInterface>(bus, objectPath.c_str())
{
unit(Maximum::Unit::Watts);
diff --git a/power-supply/power_supply.cpp b/power-supply/power_supply.cpp
index 548895d..ce6a43a 100644
--- a/power-supply/power_supply.cpp
+++ b/power-supply/power_supply.cpp
@@ -43,7 +43,7 @@
PowerSupply::PowerSupply(const std::string& name, size_t inst,
const std::string& objpath, const std::string& invpath,
- sdbusplus::bus::bus& bus, const sdeventplus::Event& e,
+ sdbusplus::bus_t& bus, const sdeventplus::Event& e,
std::chrono::seconds& t, std::chrono::seconds& p) :
Device(name, inst),
monitorPath(objpath), pmbusIntf(objpath),
@@ -175,7 +175,7 @@
return;
}
-void PowerSupply::inventoryChanged(sdbusplus::message::message& msg)
+void PowerSupply::inventoryChanged(sdbusplus::message_t& msg)
{
std::string msgSensor;
std::map<std::string, std::variant<uint32_t, bool>> msgData;
@@ -211,7 +211,7 @@
bus, this->present);
}
-void PowerSupply::powerStateChanged(sdbusplus::message::message& msg)
+void PowerSupply::powerStateChanged(sdbusplus::message_t& msg)
{
int32_t state = 0;
std::string msgSensor;
diff --git a/power-supply/power_supply.hpp b/power-supply/power_supply.hpp
index b3410af..c87df39 100644
--- a/power-supply/power_supply.hpp
+++ b/power-supply/power_supply.hpp
@@ -52,7 +52,7 @@
*/
PowerSupply(const std::string& name, size_t inst,
const std::string& objpath, const std::string& invpath,
- sdbusplus::bus::bus& bus, const sdeventplus::Event& e,
+ sdbusplus::bus_t& bus, const sdeventplus::Event& e,
std::chrono::seconds& t, std::chrono::seconds& p);
/**
@@ -115,7 +115,7 @@
std::string inventoryPath;
/** @brief Connection for sdbusplus bus */
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/** @brief True if the power supply is present. */
bool present = false;
@@ -287,7 +287,7 @@
* @param[in] msg - Data associated with Present change signal
*
*/
- void inventoryChanged(sdbusplus::message::message& msg);
+ void inventoryChanged(sdbusplus::message_t& msg);
/**
* Updates the presence status by querying D-Bus
@@ -313,7 +313,7 @@
*
* @param[in] msg - Data associated with the power state signal
*/
- void powerStateChanged(sdbusplus::message::message& msg);
+ void powerStateChanged(sdbusplus::message_t& msg);
/**
* @brief Wrapper for PMBus::read() and adding metadata