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: Ibd4b55a2f12c55dee7b9763d62aeba2ddd124c8b
diff --git a/host-interface.hpp b/host-interface.hpp
index 05d76f6..8e56bd4 100644
--- a/host-interface.hpp
+++ b/host-interface.hpp
@@ -18,7 +18,7 @@
* @details A concrete implementation for org.open_power.Control.Host
* DBus API.
*/
-class Host : public sdbusplus::server::object::object<Base::Host>
+class Host : public sdbusplus::server::object_t<Base::Host>
{
public:
/** @brief Constructs Host Control Interface
@@ -26,8 +26,8 @@
* @param[in] bus - The Dbus bus object
* @param[in] objPath - The Dbus object path
*/
- Host(sdbusplus::bus::bus& bus, const char* objPath) :
- sdbusplus::server::object::object<Base::Host>(bus, objPath), bus(bus)
+ Host(sdbusplus::bus_t& bus, const char* objPath) :
+ sdbusplus::server::object_t<Base::Host>(bus, objPath), bus(bus)
{
// Nothing to do
}
@@ -43,7 +43,7 @@
private:
/** @brief sdbusplus DBus bus connection. */
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/** @brief Callback function to be invoked by command manager
*
diff --git a/oemhandler.cpp b/oemhandler.cpp
index a2f4fce..b850e44 100644
--- a/oemhandler.cpp
+++ b/oemhandler.cpp
@@ -79,7 +79,7 @@
return {};
}
-std::string getService(sdbusplus::bus::bus& bus, const std::string& path,
+std::string getService(sdbusplus::bus_t& bus, const std::string& path,
const std::string& interface)
{
auto method = bus.new_method_call(MAPPER_BUS_NAME, MAPPER_OBJ, MAPPER_IFACE,
@@ -103,7 +103,7 @@
return std::string{};
}
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
log<level::ERR>("Error in mapper method call",
entry("ERROR=%s", e.what()));
@@ -345,7 +345,7 @@
ipmi_data_len_t data_len,
ipmi_context_t context)
{
- sdbusplus::bus::bus bus{ipmid_get_sd_bus_connection()};
+ sdbusplus::bus_t bus{ipmid_get_sd_bus_connection()};
// Since this is a one way command (i.e. the host is requesting a power
// off of itself and a reboot of the BMC) we can exceed the 5 second
@@ -369,7 +369,7 @@
{
bus.call_noreply(method);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
log<level::ERR>("Error powering off the chassis",
entry("ERROR=%s", e.what()));
@@ -386,7 +386,7 @@
{
bus.call_noreply(method);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
log<level::ERR>("Error setting factory reset",
entry("ERROR=%s", e.what()));
@@ -415,7 +415,7 @@
{
bus.call_noreply(method);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
log<level::ALERT>("Error calling to reboot the BMC. The BMC needs to "
"be manually rebooted to complete the factory reset.",
@@ -431,7 +431,7 @@
// Storage to keep the object alive during process life
std::unique_ptr<open_power::host::command::Host> opHost
__attribute__((init_priority(101)));
-std::unique_ptr<sdbusplus::server::manager::manager> objManager
+std::unique_ptr<sdbusplus::server::manager_t> objManager
__attribute__((init_priority(101)));
} // namespace
@@ -455,7 +455,7 @@
// Add sdbusplus ObjectManager.
auto& sdbusPlusHandler = ipmid_get_sdbus_plus_handler();
- objManager = std::make_unique<sdbusplus::server::manager::manager>(
+ objManager = std::make_unique<sdbusplus::server::manager_t>(
*sdbusPlusHandler, CONTROL_HOST_OBJ_MGR);
opHost = std::make_unique<open_power::host::command::Host>(