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: Ifaeaafa5bbe57eb6c15803d63d0a9a176bd42f33
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/dump/create_pel.cpp b/dump/create_pel.cpp
index 7f79fa5..dad0807 100644
--- a/dump/create_pel.cpp
+++ b/dump/create_pel.cpp
@@ -88,7 +88,7 @@
response.read(reply);
plid = std::get<1>(reply); // platform log id is tuple "second"
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
lg2::error(
"D-Bus call exception OBJPATH={OBJPATH}, INTERFACE={INTERFACE}, "
diff --git a/dump/dump_utils.cpp b/dump/dump_utils.cpp
index 3e0105e..1b2de79 100644
--- a/dump/dump_utils.cpp
+++ b/dump/dump_utils.cpp
@@ -18,11 +18,11 @@
{
bool inProgress = true;
auto bus = sdbusplus::bus::new_system();
- auto match = sdbusplus::bus::match::match(
+ auto match = sdbusplus::bus::match_t(
bus,
sdbusplus::bus::match::rules::propertiesChanged(
path, "xyz.openbmc_project.Common.Progress"),
- [&](sdbusplus::message::message& msg) {
+ [&](sdbusplus::message_t& msg) {
std::string interface;
std::map<std::string, std::variant<std::string, uint8_t>> property;
msg.read(interface, property);
@@ -89,7 +89,7 @@
monitorDumpCreation(reply.str, SBE_DUMP_TIMEOUT);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
lg2::error("D-Bus call createDump exception OBJPATH={OBJPATH}, "
"INTERFACE={INTERFACE}, EXCEPTION={ERROR}",
@@ -114,7 +114,7 @@
}
}
-std::string getService(sdbusplus::bus::bus& bus, const std::string& intf,
+std::string getService(sdbusplus::bus_t& bus, const std::string& intf,
const std::string& path)
{
constexpr auto MAPPER_BUSNAME = "xyz.openbmc_project.ObjectMapper";
@@ -142,7 +142,7 @@
}
return mapperResponse.begin()->first;
}
- catch (const sdbusplus::exception::exception& ex)
+ catch (const sdbusplus::exception_t& ex)
{
lg2::error(
"Mapper call failed for GetObject errorMsg({ERROR}), path({PATH}),"
diff --git a/dump/dump_utils.hpp b/dump/dump_utils.hpp
index 105884a..a37df2c 100644
--- a/dump/dump_utils.hpp
+++ b/dump/dump_utils.hpp
@@ -58,7 +58,7 @@
*
* @return distinct dbus name for input interface/path
**/
-std::string getService(sdbusplus::bus::bus& bus, const std::string& intf,
+std::string getService(sdbusplus::bus_t& bus, const std::string& intf,
const std::string& path);
/**
@@ -73,8 +73,7 @@
*/
template <typename T>
void setProperty(const std::string& interface, const std::string& propertyName,
- const std::string& path, sdbusplus::bus::bus& bus,
- const T& value)
+ const std::string& path, sdbusplus::bus_t& bus, const T& value)
{
constexpr auto PROPERTY_INTF = "org.freedesktop.DBus.Properties";