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/utils.cpp b/utils.cpp
index 77b20eb..ced4e90 100644
--- a/utils.cpp
+++ b/utils.cpp
@@ -20,7 +20,7 @@
constexpr auto MAPPER_INTERFACE = "xyz.openbmc_project.ObjectMapper";
constexpr auto PROPERTY_INTERFACE = "org.freedesktop.DBus.Properties";
-std::string getService(sdbusplus::bus::bus& bus, std::string path,
+std::string getService(sdbusplus::bus_t& bus, std::string path,
std::string interface)
{
auto mapper = bus.new_method_call(MAPPER_BUSNAME, MAPPER_PATH,
@@ -44,7 +44,7 @@
throw std::runtime_error("Error no matching service");
}
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Error in mapper call with path {PATH}, interface "
"{INTERFACE}, and exception {ERROR}",
@@ -55,7 +55,7 @@
return mapperResponse.begin()->first;
}
-std::string getProperty(sdbusplus::bus::bus& bus, const std::string& path,
+std::string getProperty(sdbusplus::bus_t& bus, const std::string& path,
const std::string& interface,
const std::string& propertyName)
{
@@ -72,7 +72,7 @@
auto reply = bus.call(method);
reply.read(property);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Error in property Get, error {ERROR}, property {PROPERTY}",
"ERROR", e, "PROPERTY", propertyName);
@@ -89,7 +89,7 @@
return std::get<std::string>(property);
}
-void setProperty(sdbusplus::bus::bus& bus, const std::string& path,
+void setProperty(sdbusplus::bus_t& bus, const std::string& path,
const std::string& interface, const std::string& property,
const std::string& value)
{
@@ -130,7 +130,7 @@
}
void createError(
- sdbusplus::bus::bus& bus, const std::string& errorMsg,
+ sdbusplus::bus_t& bus, const std::string& errorMsg,
sdbusplus::xyz::openbmc_project::Logging::server::Entry::Level errLevel,
std::map<std::string, std::string> additionalData)
{
@@ -146,7 +146,7 @@
method.append(errorMsg, errLevel, additionalData);
auto resp = bus.call(method);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("sdbusplus D-Bus call exception, error {ERROR} trying to create "
"an error with {ERROR_MSG}",
@@ -162,7 +162,7 @@
}
}
-void createBmcDump(sdbusplus::bus::bus& bus)
+void createBmcDump(sdbusplus::bus_t& bus)
{
auto method = bus.new_method_call(
"xyz.openbmc_project.Dump.Manager", "/xyz/openbmc_project/dump/bmc",
@@ -174,7 +174,7 @@
{
bus.call_noreply(method);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Failed to create BMC dump, exception:{ERROR}", "ERROR", e);
// just continue, this is error path anyway so we're just collecting