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: I223d58649a21565678bd7ef78d955b30d3fd6d84
diff --git a/manager/group.hpp b/manager/group.hpp
index 520ba43..aec0e85 100644
--- a/manager/group.hpp
+++ b/manager/group.hpp
@@ -41,8 +41,8 @@
* @param[in] serialize - Serialize object
* @param[in] callBack - Custom callback when LED group is asserted
*/
- Group(sdbusplus::bus::bus& bus, const std::string& objPath,
- Manager& manager, Serialize& serialize,
+ Group(sdbusplus::bus_t& bus, const std::string& objPath, Manager& manager,
+ Serialize& serialize,
std::function<void(Group*, bool)> callBack = nullptr) :
GroupInherit(bus, objPath.c_str(), GroupInherit::action::defer_emit),
diff --git a/manager/json-config.hpp b/manager/json-config.hpp
index 3b836a1..2c4e16d 100644
--- a/manager/json-config.hpp
+++ b/manager/json-config.hpp
@@ -34,8 +34,7 @@
* @param[in] bus - The D-Bus object
* @param[in] event - sd event handler
*/
- JsonConfig(sdbusplus::bus::bus& bus, sdeventplus::Event& event) :
- event(event)
+ JsonConfig(sdbusplus::bus_t& bus, sdeventplus::Event& event) : event(event)
{
match = std::make_unique<sdbusplus::bus::match_t>(
bus,
@@ -93,7 +92,7 @@
*
* @param[in] msg - The D-Bus message contents
*/
- void ifacesAddedCallback(sdbusplus::message::message& msg)
+ void ifacesAddedCallback(sdbusplus::message_t& msg)
{
sdbusplus::message::object_path path;
std::unordered_map<
@@ -183,7 +182,7 @@
}
confFile.clear();
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
// Property unavailable on object.
lg2::error(
@@ -195,7 +194,7 @@
}
}
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
lg2::error(
"Failed to call the SubTreePaths method, ERROR = {ERROR}, INTERFACE = {INTERFACE}",
diff --git a/manager/lamptest/lamptest.cpp b/manager/lamptest/lamptest.cpp
index 99d0318..57e5a33 100644
--- a/manager/lamptest/lamptest.cpp
+++ b/manager/lamptest/lamptest.cpp
@@ -142,7 +142,7 @@
period = std::get<uint16_t>(properties["Period"]);
dutyOn = std::get<uint8_t>(properties["DutyOn"]);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
lg2::error(
"Failed to get All properties, ERROR = {ERROR}, PATH = {PATH}",
@@ -254,7 +254,7 @@
"xyz.openbmc_project.Led.Group", "Asserted",
assertedValue);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
lg2::error(
"Failed to set Asserted property, ERROR = {ERROR}, PATH = {PATH}",
diff --git a/manager/led-main.cpp b/manager/led-main.cpp
index a6f8f82..86c13f5 100644
--- a/manager/led-main.cpp
+++ b/manager/led-main.cpp
@@ -45,7 +45,7 @@
phosphor::led::Manager manager(bus, systemLedMap);
/** @brief sd_bus object manager */
- sdbusplus::server::manager::manager objManager(bus, OBJPATH);
+ sdbusplus::server::manager_t objManager(bus, OBJPATH);
/** @brief vector of led groups */
std::vector<std::unique_ptr<phosphor::led::Group>> groups;
diff --git a/manager/manager.hpp b/manager/manager.hpp
index 2fbc7f2..ac00d76 100644
--- a/manager/manager.hpp
+++ b/manager/manager.hpp
@@ -76,7 +76,7 @@
* @param [in] bus - sdbusplus handler
* @param [in] GroupMap - LEDs group layout
*/
- Manager(sdbusplus::bus::bus& bus, const GroupMap& ledLayout) :
+ Manager(sdbusplus::bus_t& bus, const GroupMap& ledLayout) :
ledMap(ledLayout), bus(bus)
{
// Nothing here
@@ -126,7 +126,7 @@
private:
/** @brief sdbusplus handler */
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/** Map of physical LED path to service name */
std::unordered_map<std::string, std::string> phyLeds{};