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: I41103c892db258a85640aa1442acd9a295c8a847
diff --git a/chassis_state_manager.cpp b/chassis_state_manager.cpp
index 0e962c1..9c16ea0 100644
--- a/chassis_state_manager.cpp
+++ b/chassis_state_manager.cpp
@@ -78,7 +78,7 @@
SYSTEMD_SERVICE, SYSTEMD_OBJ_PATH, SYSTEMD_INTERFACE, "Subscribe");
this->bus.call(method);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Failed to subscribe to systemd signals: {ERROR}", "ERROR", e);
elog<InternalFailure>();
@@ -179,7 +179,7 @@
}
}
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
// It's acceptable for the pgood state service to not be available
// since it will notify us of the pgood state when it comes up.
@@ -248,7 +248,7 @@
auto mapperResponseMsg = bus.call(mapper);
mapperResponseMsg.read(mapperResponse);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Error in mapper GetSubTree call for UPS: {ERROR}", "ERROR", e);
throw;
@@ -326,7 +326,7 @@
return false;
}
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Error reading UPS property, error: {ERROR}, "
"service: {SERVICE} path: {PATH}",
@@ -354,7 +354,7 @@
auto mapperResponseMsg = bus.call(mapper);
mapperResponseMsg.read(mapperResponse);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Error in mapper GetSubTree call for PowerSystemInputs: {ERROR}",
"ERROR", e);
@@ -392,7 +392,7 @@
return false;
}
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error(
"Error reading Power System Inputs property, error: {ERROR}, "
@@ -405,7 +405,7 @@
return true;
}
-void Chassis::uPowerChangeEvent(sdbusplus::message::message& msg)
+void Chassis::uPowerChangeEvent(sdbusplus::message_t& msg)
{
debug("UPS Property Change Event Triggered");
std::string statusInterface;
@@ -444,7 +444,7 @@
return;
}
-void Chassis::powerSysInputsChangeEvent(sdbusplus::message::message& msg)
+void Chassis::powerSysInputsChangeEvent(sdbusplus::message_t& msg)
{
debug("Power System Inputs Property Change Event Triggered");
std::string statusInterface;
@@ -507,7 +507,7 @@
auto result = this->bus.call(method);
result.read(unitTargetPath);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Error in GetUnit call: {ERROR}", "ERROR", e);
return false;
@@ -525,7 +525,7 @@
auto result = this->bus.call(method);
result.read(currentState);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Error in ActiveState Get: {ERROR}", "ERROR", e);
return false;
@@ -536,7 +536,7 @@
currentStateStr == ACTIVATING_STATE;
}
-int Chassis::sysStateChange(sdbusplus::message::message& msg)
+int Chassis::sysStateChange(sdbusplus::message_t& msg)
{
sdbusplus::message::object_path newStateObjPath;
std::string newStateUnit{};
@@ -550,7 +550,7 @@
uint32_t newStateID{};
msg.read(newStateID, newStateObjPath, newStateUnit, newStateResult);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Error in state change - bad encoding: {ERROR} {REPLY_SIG}",
"ERROR", e, "REPLY_SIG", msg.get_signature());