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: If2c7da2a8105c39fb0eadf0a86337165b0fe4aa1
diff --git a/src/entity_manager.cpp b/src/entity_manager.cpp
index 641d3f9..4a730b0 100644
--- a/src/entity_manager.cpp
+++ b/src/entity_manager.cpp
@@ -1090,24 +1090,24 @@
// org.freedesktop.DBus.Properties signals. Similarly if a process exits
// for any reason, expected or otherwise, we'll need a poke to remove
// entities from DBus.
- sdbusplus::bus::match::match nameOwnerChangedMatch(
- static_cast<sdbusplus::bus::bus&>(*systemBus),
+ sdbusplus::bus::match_t nameOwnerChangedMatch(
+ static_cast<sdbusplus::bus_t&>(*systemBus),
sdbusplus::bus::match::rules::nameOwnerChanged(),
- [&](sdbusplus::message::message&) {
+ [&](sdbusplus::message_t&) {
propertiesChangedCallback(systemConfiguration, objServer);
});
// We also need a poke from DBus when new interfaces are created or
// destroyed.
- sdbusplus::bus::match::match interfacesAddedMatch(
- static_cast<sdbusplus::bus::bus&>(*systemBus),
+ sdbusplus::bus::match_t interfacesAddedMatch(
+ static_cast<sdbusplus::bus_t&>(*systemBus),
sdbusplus::bus::match::rules::interfacesAdded(),
- [&](sdbusplus::message::message&) {
+ [&](sdbusplus::message_t&) {
propertiesChangedCallback(systemConfiguration, objServer);
});
- sdbusplus::bus::match::match interfacesRemovedMatch(
- static_cast<sdbusplus::bus::bus&>(*systemBus),
+ sdbusplus::bus::match_t interfacesRemovedMatch(
+ static_cast<sdbusplus::bus_t&>(*systemBus),
sdbusplus::bus::match::rules::interfacesRemoved(),
- [&](sdbusplus::message::message&) {
+ [&](sdbusplus::message_t&) {
propertiesChangedCallback(systemConfiguration, objServer);
});
diff --git a/src/fru_device.cpp b/src/fru_device.cpp
index b4c3668..b503d80 100644
--- a/src/fru_device.cpp
+++ b/src/fru_device.cpp
@@ -1398,8 +1398,8 @@
});
iface->initialize();
- std::function<void(sdbusplus::message::message & message)> eventHandler =
- [&](sdbusplus::message::message& message) {
+ std::function<void(sdbusplus::message_t & message)> eventHandler =
+ [&](sdbusplus::message_t& message) {
std::string objectName;
boost::container::flat_map<
std::string,
@@ -1420,8 +1420,8 @@
}
};
- sdbusplus::bus::match::match powerMatch = sdbusplus::bus::match::match(
- static_cast<sdbusplus::bus::bus&>(*systemBus),
+ sdbusplus::bus::match_t powerMatch = sdbusplus::bus::match_t(
+ static_cast<sdbusplus::bus_t&>(*systemBus),
"type='signal',interface='org.freedesktop.DBus.Properties',path='/xyz/"
"openbmc_project/state/"
"host0',arg0='xyz.openbmc_project.State.Host'",
diff --git a/src/perform_scan.cpp b/src/perform_scan.cpp
index 959a819..bf3c750 100644
--- a/src/perform_scan.cpp
+++ b/src/perform_scan.cpp
@@ -91,7 +91,7 @@
sdbusplus::asio::object_server& objServer,
const std::string& path)
{
- static boost::container::flat_map<std::string, sdbusplus::bus::match::match>
+ static boost::container::flat_map<std::string, sdbusplus::bus::match_t>
dbusMatches;
auto find = dbusMatches.find(path);
@@ -100,13 +100,13 @@
return;
}
- std::function<void(sdbusplus::message::message & message)> eventHandler =
- [&](sdbusplus::message::message&) {
+ std::function<void(sdbusplus::message_t & message)> eventHandler =
+ [&](sdbusplus::message_t&) {
propertiesChangedCallback(systemConfiguration, objServer);
};
- sdbusplus::bus::match::match match(
- static_cast<sdbusplus::bus::bus&>(*systemBus),
+ sdbusplus::bus::match_t match(
+ static_cast<sdbusplus::bus_t&>(*systemBus),
"type='signal',member='PropertiesChanged',path='" + path + "'",
eventHandler);
dbusMatches.emplace(path, std::move(match));
diff --git a/src/utils.cpp b/src/utils.cpp
index 8b7386d..ecd108a 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -43,7 +43,7 @@
namespace fs = std::filesystem;
static bool powerStatusOn = false;
-static std::unique_ptr<sdbusplus::bus::match::match> powerMatch = nullptr;
+static std::unique_ptr<sdbusplus::bus::match_t> powerMatch = nullptr;
bool findFiles(const fs::path& dirPath, const std::string& matchString,
std::vector<fs::path>& foundPaths)
@@ -154,12 +154,12 @@
void setupPowerMatch(const std::shared_ptr<sdbusplus::asio::connection>& conn)
{
- powerMatch = std::make_unique<sdbusplus::bus::match::match>(
- static_cast<sdbusplus::bus::bus&>(*conn),
+ powerMatch = std::make_unique<sdbusplus::bus::match_t>(
+ static_cast<sdbusplus::bus_t&>(*conn),
"type='signal',interface='" + std::string(properties::interface) +
"',path='" + std::string(power::path) + "',arg0='" +
std::string(power::interface) + "'",
- [](sdbusplus::message::message& message) {
+ [](sdbusplus::message_t& message) {
std::string objectName;
boost::container::flat_map<std::string, std::variant<std::string>>
values;