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: I1c3acea60ea58b8a0f9a76fd32b5d0d007bf1a16
diff --git a/fail-monitor/monitor.hpp b/fail-monitor/monitor.hpp
index a8a387f..9c98fdf 100644
--- a/fail-monitor/monitor.hpp
+++ b/fail-monitor/monitor.hpp
@@ -83,7 +83,7 @@
/**
* The dbus object
*/
- sdbusplus::bus::bus bus;
+ sdbusplus::bus_t bus;
/**
* The source unit
diff --git a/src/associations.cpp b/src/associations.cpp
index 75457d9..79672af 100644
--- a/src/associations.cpp
+++ b/src/associations.cpp
@@ -409,7 +409,7 @@
addSingleAssociation(server, assocPath, endpointPath, owner,
ownerPath, assocMaps);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
// In some case the interface could not be created on DBus and an
// exception is thrown. mapper has no control of the interface/path
diff --git a/src/main.cpp b/src/main.cpp
index 23f3c5f..64031b8 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -53,7 +53,7 @@
// TODO(ed) This signal doesn't get exposed properly in the
// introspect right now. Find out how to register signals in
// sdbusplus
- sdbusplus::message::message m = systemBus->new_signal(
+ sdbusplus::message_t m = systemBus->new_signal(
"/xyz/openbmc_project/object_mapper",
"xyz.openbmc_project.ObjectMapper.Private", "IntrospectionComplete");
m.append(processName);
@@ -669,9 +669,9 @@
InterfaceMapType interfaceMap;
boost::container::flat_map<std::string, std::string> nameOwners;
- std::function<void(sdbusplus::message::message & message)>
- nameChangeHandler = [&interfaceMap, &io, &nameOwners, &server,
- systemBus](sdbusplus::message::message& message) {
+ std::function<void(sdbusplus::message_t & message)> nameChangeHandler =
+ [&interfaceMap, &io, &nameOwners, &server,
+ systemBus](sdbusplus::message_t& message) {
std::string name; // well-known
std::string oldOwner; // unique-name
std::string newOwner; // unique-name
@@ -705,13 +705,12 @@
}
};
- sdbusplus::bus::match::match nameOwnerChanged(
- static_cast<sdbusplus::bus::bus&>(*systemBus),
+ sdbusplus::bus::match_t nameOwnerChanged(
+ static_cast<sdbusplus::bus_t&>(*systemBus),
sdbusplus::bus::match::rules::nameOwnerChanged(), nameChangeHandler);
- std::function<void(sdbusplus::message::message & message)>
- interfacesAddedHandler = [&interfaceMap, &nameOwners, &server](
- sdbusplus::message::message& message) {
+ std::function<void(sdbusplus::message_t & message)> interfacesAddedHandler =
+ [&interfaceMap, &nameOwners, &server](sdbusplus::message_t& message) {
sdbusplus::message::object_path objPath;
InterfacesAdded interfacesAdded;
message.read(objPath, interfacesAdded);
@@ -727,14 +726,14 @@
}
};
- sdbusplus::bus::match::match interfacesAdded(
- static_cast<sdbusplus::bus::bus&>(*systemBus),
+ sdbusplus::bus::match_t interfacesAdded(
+ static_cast<sdbusplus::bus_t&>(*systemBus),
sdbusplus::bus::match::rules::interfacesAdded(),
interfacesAddedHandler);
- std::function<void(sdbusplus::message::message & message)>
- interfacesRemovedHandler = [&interfaceMap, &nameOwners, &server](
- sdbusplus::message::message& message) {
+ std::function<void(sdbusplus::message_t & message)>
+ interfacesRemovedHandler = [&interfaceMap, &nameOwners,
+ &server](sdbusplus::message_t& message) {
sdbusplus::message::object_path objPath;
std::vector<std::string> interfacesRemoved;
message.read(objPath, interfacesRemoved);
@@ -797,14 +796,14 @@
removeUnneededParents(objPath.str, sender, interfaceMap);
};
- sdbusplus::bus::match::match interfacesRemoved(
- static_cast<sdbusplus::bus::bus&>(*systemBus),
+ sdbusplus::bus::match_t interfacesRemoved(
+ static_cast<sdbusplus::bus_t&>(*systemBus),
sdbusplus::bus::match::rules::interfacesRemoved(),
interfacesRemovedHandler);
- std::function<void(sdbusplus::message::message & message)>
+ std::function<void(sdbusplus::message_t & message)>
associationChangedHandler = [&server, &nameOwners, &interfaceMap](
- sdbusplus::message::message& message) {
+ sdbusplus::message_t& message) {
std::string objectName;
boost::container::flat_map<std::string,
std::variant<std::vector<Association>>>
@@ -825,8 +824,8 @@
wellKnown, interfaceMap, associationMaps);
}
};
- sdbusplus::bus::match::match assocChangedMatch(
- static_cast<sdbusplus::bus::bus&>(*systemBus),
+ sdbusplus::bus::match_t assocChangedMatch(
+ static_cast<sdbusplus::bus_t&>(*systemBus),
sdbusplus::bus::match::rules::interface(
"org.freedesktop.DBus.Properties") +
sdbusplus::bus::match::rules::member("PropertiesChanged") +