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: Ieb6587e32446a758676f67d9c868289cc02e50bf
diff --git a/src/IntrusionSensorMain.cpp b/src/IntrusionSensorMain.cpp
index 5d2b666..2745c08 100644
--- a/src/IntrusionSensorMain.cpp
+++ b/src/IntrusionSensorMain.cpp
@@ -230,7 +230,7 @@
std::vector<std::string>{nicTypes.begin(), nicTypes.end()});
}
-static void processLanStatusChange(sdbusplus::message::message& message)
+static void processLanStatusChange(sdbusplus::message_t& message)
{
const std::string& pathName = message.get_path();
std::string interfaceName;
@@ -442,8 +442,8 @@
}
// callback to handle configuration change
- std::function<void(sdbusplus::message::message&)> eventHandler =
- [&](sdbusplus::message::message& message) {
+ std::function<void(sdbusplus::message_t&)> eventHandler =
+ [&](sdbusplus::message_t& message) {
if (message.is_method_error())
{
std::cerr << "callback method error\n";
@@ -458,8 +458,8 @@
}
};
- auto eventMatch = std::make_unique<sdbusplus::bus::match::match>(
- static_cast<sdbusplus::bus::bus&>(*systemBus),
+ auto eventMatch = std::make_unique<sdbusplus::bus::match_t>(
+ static_cast<sdbusplus::bus_t&>(*systemBus),
"type='signal',member='PropertiesChanged',path_namespace='" +
std::string(inventoryPath) + "',arg0namespace='" + sensorType + "'",
eventHandler);
@@ -467,22 +467,20 @@
if (initializeLanStatus(systemBus))
{
// add match to monitor lan status change
- sdbusplus::bus::match::match lanStatusMatch(
- static_cast<sdbusplus::bus::bus&>(*systemBus),
+ sdbusplus::bus::match_t lanStatusMatch(
+ static_cast<sdbusplus::bus_t&>(*systemBus),
"type='signal', member='PropertiesChanged',"
"arg0namespace='org.freedesktop.network1.Link'",
- [](sdbusplus::message::message& msg) {
- processLanStatusChange(msg);
- });
+ [](sdbusplus::message_t& msg) { processLanStatusChange(msg); });
// add match to monitor entity manager signal about nic name config
// change
- sdbusplus::bus::match::match lanConfigMatch(
- static_cast<sdbusplus::bus::bus&>(*systemBus),
+ sdbusplus::bus::match_t lanConfigMatch(
+ static_cast<sdbusplus::bus_t&>(*systemBus),
"type='signal', member='PropertiesChanged',path_namespace='" +
std::string(inventoryPath) + "',arg0namespace='" + nicType +
"'",
- [&systemBus](sdbusplus::message::message& msg) {
+ [&systemBus](sdbusplus::message_t& msg) {
if (msg.is_method_error())
{
std::cerr << "callback method error\n";