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: I8e2242adb79be342562c9b7f3d2153dfdf578085
diff --git a/host-bmc/dbus_to_event_handler.cpp b/host-bmc/dbus_to_event_handler.cpp
index 5d4d857..9fcf3ba 100644
--- a/host-bmc/dbus_to_event_handler.cpp
+++ b/host-bmc/dbus_to_event_handler.cpp
@@ -108,7 +108,7 @@
const auto& dbusMapping = dbusMappings[offset];
const auto& dbusValueMapping = dbusValMaps[offset];
- auto stateSensorMatch = std::make_unique<sdbusplus::bus::match::match>(
+ auto stateSensorMatch = std::make_unique<sdbusplus::bus::match_t>(
pldm::utils::DBusHandler::getBus(),
propertiesChanged(dbusMapping.objectPath.c_str(),
dbusMapping.interface.c_str()),
diff --git a/host-bmc/dbus_to_event_handler.hpp b/host-bmc/dbus_to_event_handler.hpp
index 8818d67..83cb792 100644
--- a/host-bmc/dbus_to_event_handler.hpp
+++ b/host-bmc/dbus_to_event_handler.hpp
@@ -77,8 +77,7 @@
pldm::dbus_api::Requester& requester;
/** @brief D-Bus property changed signal match */
- std::vector<std::unique_ptr<sdbusplus::bus::match::match>>
- stateSensorMatchs;
+ std::vector<std::unique_ptr<sdbusplus::bus::match_t>> stateSensorMatchs;
/** @brief PLDM request handler */
pldm::requester::Handler<pldm::requester::Request>* handler;
diff --git a/host-bmc/dbus_to_host_effecters.cpp b/host-bmc/dbus_to_host_effecters.cpp
index a4d4be0..86c00e8 100644
--- a/host-bmc/dbus_to_host_effecters.cpp
+++ b/host-bmc/dbus_to_host_effecters.cpp
@@ -175,7 +175,7 @@
return;
}
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
std::cerr << "Error in getting current host state. Will still "
"continue to set the host effecter \n";
@@ -316,18 +316,17 @@
uint16_t effecterId)
{
using namespace sdbusplus::bus::match::rules;
- effecterInfoMatch.emplace_back(
- std::make_unique<sdbusplus::bus::match::match>(
- pldm::utils::DBusHandler::getBus(),
- propertiesChanged(objectPath, interface),
- [this, effecterInfoIndex, dbusInfoIndex,
- effecterId](sdbusplus::message::message& msg) {
- DbusChgHostEffecterProps props;
- std::string iface;
- msg.read(iface, props);
- processHostEffecterChangeNotification(
- props, effecterInfoIndex, dbusInfoIndex, effecterId);
- }));
+ effecterInfoMatch.emplace_back(std::make_unique<sdbusplus::bus::match_t>(
+ pldm::utils::DBusHandler::getBus(),
+ propertiesChanged(objectPath, interface),
+ [this, effecterInfoIndex, dbusInfoIndex,
+ effecterId](sdbusplus::message_t& msg) {
+ DbusChgHostEffecterProps props;
+ std::string iface;
+ msg.read(iface, props);
+ processHostEffecterChangeNotification(props, effecterInfoIndex,
+ dbusInfoIndex, effecterId);
+ }));
}
} // namespace host_effecters
diff --git a/host-bmc/dbus_to_host_effecters.hpp b/host-bmc/dbus_to_host_effecters.hpp
index 3dd8c38..f8e165e 100644
--- a/host-bmc/dbus_to_host_effecters.hpp
+++ b/host-bmc/dbus_to_host_effecters.hpp
@@ -173,7 +173,7 @@
int sockFd; //!< Socket fd to send message to host
const pldm_pdr* pdrRepo; //!< Reference to PDR repo
std::vector<EffecterInfo> hostEffecterInfo; //!< Parsed effecter information
- std::vector<std::unique_ptr<sdbusplus::bus::match::match>>
+ std::vector<std::unique_ptr<sdbusplus::bus::match_t>>
effecterInfoMatch; //!< vector to catch the D-Bus property change
//!< signals for the effecters
const pldm::utils::DBusHandler* dbusHandler; //!< D-bus Handler
diff --git a/host-bmc/host_condition.hpp b/host-bmc/host_condition.hpp
index 6ea9978..f7d67fb 100644
--- a/host-bmc/host_condition.hpp
+++ b/host-bmc/host_condition.hpp
@@ -11,7 +11,7 @@
namespace dbus_api
{
-using HostIntf = sdbusplus::server::object::object<
+using HostIntf = sdbusplus::server::object_t<
sdbusplus::xyz::openbmc_project::Condition::server::HostFirmware>;
class Host : public HostIntf
@@ -24,7 +24,7 @@
Host& operator=(Host&&) = delete;
virtual ~Host() = default;
- Host(sdbusplus::bus::bus& bus, const std::string& path) :
+ Host(sdbusplus::bus_t& bus, const std::string& path) :
HostIntf(bus, path.c_str()){};
/** @brief Override reads to CurrentFirmwareCondition */
diff --git a/host-bmc/host_pdr_handler.cpp b/host-bmc/host_pdr_handler.cpp
index f4c86e6..e74affc 100644
--- a/host-bmc/host_pdr_handler.cpp
+++ b/host-bmc/host_pdr_handler.cpp
@@ -90,12 +90,11 @@
}
}
- hostOffMatch = std::make_unique<sdbusplus::bus::match::match>(
+ hostOffMatch = std::make_unique<sdbusplus::bus::match_t>(
pldm::utils::DBusHandler::getBus(),
propertiesChanged("/xyz/openbmc_project/state/host0",
"xyz.openbmc_project.State.Host"),
- [this, repo, entityTree,
- bmcEntityTree](sdbusplus::message::message& msg) {
+ [this, repo, entityTree, bmcEntityTree](sdbusplus::message_t& msg) {
DbusChangedProps props{};
std::string intf;
msg.read(intf, props);
diff --git a/host-bmc/host_pdr_handler.hpp b/host-bmc/host_pdr_handler.hpp
index 9ea8611..694bcdd 100644
--- a/host-bmc/host_pdr_handler.hpp
+++ b/host-bmc/host_pdr_handler.hpp
@@ -246,7 +246,7 @@
*/
std::map<EntityType, pldm_entity> parents;
/** @brief D-Bus property changed signal match */
- std::unique_ptr<sdbusplus::bus::match::match> hostOffMatch;
+ std::unique_ptr<sdbusplus::bus::match_t> hostOffMatch;
/** @brief sensorMap is a lookup data structure that is build from the
* hostPDR that speeds up the lookup of <TerminusID, SensorID> in