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: Ic0fe1ed7e19cf114b8666d49d4d670c7d9ec595d
diff --git a/power-supply/average.hpp b/power-supply/average.hpp
index cf54a7d..6b667f2 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 7c5fcad..0a6f965 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 d48f60f..2d3fa46 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 d936d28..373da01 100644
--- a/power-supply/power_supply.cpp
+++ b/power-supply/power_supply.cpp
@@ -70,7 +70,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),
@@ -188,7 +188,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;
@@ -224,7 +224,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 d997423..0ba0812 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;
@@ -270,7 +270,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
@@ -296,7 +296,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