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: I6a559082fed34ae62b648345ead793436d2d03f6
diff --git a/src/sdbusplus.hpp b/src/sdbusplus.hpp
index 1e0b978..3767282 100644
--- a/src/sdbusplus.hpp
+++ b/src/sdbusplus.hpp
@@ -26,7 +26,7 @@
private:
static auto& getWatches()
{
- static std::vector<sdbusplus::bus::match::match> watches;
+ static std::vector<sdbusplus::bus::match_t> watches;
return watches;
}
@@ -74,13 +74,13 @@
const std::string& method, Args&&... args)
{
Ret resp;
- sdbusplus::message::message respMsg = callMethod<Args...>(
+ sdbusplus::message_t respMsg = callMethod<Args...>(
busName, path, interface, method, std::forward<Args>(args)...);
try
{
respMsg.read(resp);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
// Empty responses are expected sometimes, and the calling
// code is set up to handle it.
@@ -89,9 +89,8 @@
}
/** @brief Register a DBus signal callback. */
- static auto
- addMatch(const std::string& match,
- const sdbusplus::bus::match::match::callback_t& callback)
+ static auto addMatch(const std::string& match,
+ const sdbusplus::bus::match_t::callback_t& callback)
{
getWatches().emplace_back(getBus(), match, callback);
}
@@ -114,7 +113,7 @@
name = object.begin()->first;
}
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
// Empty responses are expected sometimes, and the calling
// code is set up to handle it.