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: Ibc88a5de1e7a11d332410985f29698b24aeae983
diff --git a/src/cpuinfo_main.cpp b/src/cpuinfo_main.cpp
index 0d9c797..4633174 100644
--- a/src/cpuinfo_main.cpp
+++ b/src/cpuinfo_main.cpp
@@ -319,11 +319,11 @@
cpuUpdatedMatch.insert_or_assign(
cpu,
- std::make_unique<sdbusplus::bus::match::match>(
- static_cast<sdbusplus::bus::bus&>(*conn),
+ std::make_unique<sdbusplus::bus::match_t>(
+ static_cast<sdbusplus::bus_t&>(*conn),
sdbusplus::bus::match::rules::interfacesAdded() +
sdbusplus::bus::match::rules::argNpath(0, objectPath.c_str()),
- [conn, cpu](sdbusplus::message::message& msg) {
+ [conn, cpu](sdbusplus::message_t& msg) {
sdbusplus::message::object_path objectName;
boost::container::flat_map<
std::string,
@@ -561,13 +561,13 @@
{
// Get the Cpu configuration
// In case it's not available, set a match for it
- static std::unique_ptr<sdbusplus::bus::match::match> cpuConfigMatch =
- std::make_unique<sdbusplus::bus::match::match>(
+ static std::unique_ptr<sdbusplus::bus::match_t> cpuConfigMatch =
+ std::make_unique<sdbusplus::bus::match_t>(
*conn,
"type='signal',interface='org.freedesktop.DBus.Properties',member='"
"PropertiesChanged',arg0='xyz.openbmc_project."
"Configuration.XeonCPU'",
- [&io, conn, &objServer](sdbusplus::message::message& msg) {
+ [&io, conn, &objServer](sdbusplus::message_t& msg) {
std::cerr << "get cpu configuration match\n";
static boost::asio::steady_timer filterTimer(io);
filterTimer.expires_after(
@@ -644,9 +644,9 @@
conn->request_name(cpu_info::cpuInfoObject);
sdbusplus::asio::object_server server =
sdbusplus::asio::object_server(conn);
- sdbusplus::bus::bus& bus = static_cast<sdbusplus::bus::bus&>(*conn);
- sdbusplus::server::manager::manager objManager(
- bus, "/xyz/openbmc_project/inventory");
+ sdbusplus::bus_t& bus = static_cast<sdbusplus::bus_t&>(*conn);
+ sdbusplus::server::manager_t objManager(bus,
+ "/xyz/openbmc_project/inventory");
cpu_info::hostStateSetup(conn);
diff --git a/src/cpuinfo_utils.cpp b/src/cpuinfo_utils.cpp
index 7265bbb..a96235f 100644
--- a/src/cpuinfo_utils.cpp
+++ b/src/cpuinfo_utils.cpp
@@ -218,7 +218,7 @@
*dbusConn,
sdbusplus::bus::match::rules::sender(service) +
sdbusplus::bus::match::rules::propertiesChanged(object, interface),
- [commonPropHandler](sdbusplus::message::message& reply) {
+ [commonPropHandler](sdbusplus::message_t& reply) {
ChangedPropertiesType changedProps;
// ignore first param (interface name), it has to be correct
reply.read(std::string(), changedProps);
@@ -236,7 +236,7 @@
sdbusplus::bus::match::rules::sender(service) +
sdbusplus::bus::match::rules::interfacesAdded(),
[object = std::string(object), interface = std::string(interface),
- commonPropHandler](sdbusplus::message::message& reply) {
+ commonPropHandler](sdbusplus::message_t& reply) {
sdbusplus::message::object_path changedObject;
reply.read(changedObject);
if (changedObject != object)
diff --git a/src/mdrv2.cpp b/src/mdrv2.cpp
index f7f428b..3949630 100644
--- a/src/mdrv2.cpp
+++ b/src/mdrv2.cpp
@@ -395,13 +395,13 @@
void MDR_V2::systemInfoUpdate()
{
std::string motherboardPath;
- sdbusplus::message::message method =
+ sdbusplus::message_t method =
bus.new_method_call("xyz.openbmc_project.EntityManager",
"/xyz/openbmc_project/EntityManager",
"xyz.openbmc_project.EntityManager", "ReScan");
try
{
- sdbusplus::message::message reply = bus.call(method);
+ sdbusplus::message_t reply = bus.call(method);
reply.read(motherboardPath);
}
catch (const sdbusplus::exception_t& e)
diff --git a/src/mdrv2_main.cpp b/src/mdrv2_main.cpp
index 2699571..7ab907a 100644
--- a/src/mdrv2_main.cpp
+++ b/src/mdrv2_main.cpp
@@ -33,9 +33,9 @@
int main(void)
{
- sdbusplus::bus::bus& bus = static_cast<sdbusplus::bus::bus&>(*connection);
- sdbusplus::server::manager::manager objManager(
- bus, "/xyz/openbmc_project/inventory");
+ sdbusplus::bus_t& bus = static_cast<sdbusplus::bus_t&>(*connection);
+ sdbusplus::server::manager_t objManager(bus,
+ "/xyz/openbmc_project/inventory");
bus.request_name("xyz.openbmc_project.Smbios.MDR_V2");
diff --git a/src/smbios-ipmi-blobs/handler.cpp b/src/smbios-ipmi-blobs/handler.cpp
index 07542fb..5d1921a 100644
--- a/src/smbios-ipmi-blobs/handler.cpp
+++ b/src/smbios-ipmi-blobs/handler.cpp
@@ -32,15 +32,14 @@
bool syncSmbiosData()
{
bool status = false;
- sdbusplus::bus::bus bus =
- sdbusplus::bus::bus(ipmid_get_sd_bus_connection());
- sdbusplus::message::message method =
+ sdbusplus::bus_t bus = sdbusplus::bus_t(ipmid_get_sd_bus_connection());
+ sdbusplus::message_t method =
bus.new_method_call(mdrV2Service, phosphor::smbios::mdrV2Path,
mdrV2Interface, "AgentSynchronizeData");
try
{
- sdbusplus::message::message reply = bus.call(method);
+ sdbusplus::message_t reply = bus.call(method);
reply.read(status);
}
catch (const sdbusplus::exception_t& e)
diff --git a/src/speed_select.cpp b/src/speed_select.cpp
index 2641fff..24fb11d 100644
--- a/src/speed_select.cpp
+++ b/src/speed_select.cpp
@@ -118,7 +118,7 @@
public:
using BaseOperatingConfig::BaseOperatingConfig;
- OperatingConfig(sdbusplus::bus::bus& bus, unsigned int level_,
+ OperatingConfig(sdbusplus::bus_t& bus, unsigned int level_,
std::string path_) :
BaseOperatingConfig(bus, path_.c_str(), action::defer_emit),
path(std::move(path_)), level(level_)
@@ -130,7 +130,7 @@
private:
/** Objects describing all available SST configs - not modifiable. */
std::vector<std::unique_ptr<OperatingConfig>> availConfigs;
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
const uint8_t peciAddress;
const std::string path; ///< D-Bus path of CPU object
const CPUModel cpuModel;
@@ -161,7 +161,7 @@
}
public:
- CPUConfig(sdbusplus::bus::bus& bus_, uint8_t index, CPUModel model) :
+ CPUConfig(sdbusplus::bus_t& bus_, uint8_t index, CPUModel model) :
BaseCurrentOperatingConfig(bus_, generatePath(index).c_str(),
action::defer_emit),
bus(bus_), peciAddress(index + MIN_CLIENT_ADDR),