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: Ibd2a0b512bfb7caf65bfab64b271d194da520aac
diff --git a/include/ipmid/types.hpp b/include/ipmid/types.hpp
index 2fc37ff..fb94aeb 100644
--- a/include/ipmid/types.hpp
+++ b/include/ipmid/types.hpp
@@ -197,7 +197,7 @@
using Object = sdbusplus::message::object_path;
using ObjectMap = std::map<Object, InterfaceMap>;
-using IpmiUpdateData = sdbusplus::message::message;
+using IpmiUpdateData = sdbusplus::message_t;
struct SelData
{
diff --git a/include/ipmid/utils.hpp b/include/ipmid/utils.hpp
index 5e049c5..26a2bab 100644
--- a/include/ipmid/utils.hpp
+++ b/include/ipmid/utils.hpp
@@ -57,7 +57,7 @@
* @param[in] bus - The bus associated with and used for looking
* up the service.
*/
- const std::string& getService(sdbusplus::bus::bus& bus);
+ const std::string& getService(sdbusplus::bus_t& bus);
/** @brief Invalidates the current service name */
void invalidate();
@@ -69,16 +69,15 @@
* @param[in] method - The method name
* @return The message containing the method call.
*/
- sdbusplus::message::message newMethodCall(sdbusplus::bus::bus& bus,
- const char* intf,
- const char* method);
+ sdbusplus::message_t newMethodCall(sdbusplus::bus_t& bus, const char* intf,
+ const char* method);
/** @brief Check to see if the current cache is valid
*
* @param[in] bus - The bus used for the service lookup
* @return True if the cache is valid false otherwise.
*/
- bool isValid(sdbusplus::bus::bus& bus) const;
+ bool isValid(sdbusplus::bus_t& bus) const;
private:
/** @brief DBUS interface provided by the service */
@@ -99,7 +98,7 @@
* @param[in] path - DBUS Object Path
*
*/
-std::string getService(sdbusplus::bus::bus& bus, const std::string& intf,
+std::string getService(sdbusplus::bus_t& bus, const std::string& intf,
const std::string& path);
/** @brief Gets the dbus object info implementing the given interface
@@ -110,7 +109,7 @@
* @param[in] match - identifier for object.
* @return On success returns the object having objectpath and servicename.
*/
-DbusObjectInfo getDbusObject(sdbusplus::bus::bus& bus,
+DbusObjectInfo getDbusObject(sdbusplus::bus_t& bus,
const std::string& interface,
const std::string& subtreePath = ROOT,
const std::string& match = {});
@@ -124,7 +123,7 @@
* @param[in] property - name of the property.
* @return On success returns the value of the property.
*/
-Value getDbusProperty(sdbusplus::bus::bus& bus, const std::string& service,
+Value getDbusProperty(sdbusplus::bus_t& bus, const std::string& service,
const std::string& objPath, const std::string& interface,
const std::string& property,
std::chrono::microseconds timeout = IPMI_DBUS_TIMEOUT);
@@ -138,7 +137,7 @@
* @return On success returns the map of name value pair.
*/
PropertyMap
- getAllDbusProperties(sdbusplus::bus::bus& bus, const std::string& service,
+ getAllDbusProperties(sdbusplus::bus_t& bus, const std::string& service,
const std::string& objPath,
const std::string& interface,
std::chrono::microseconds timeout = IPMI_DBUS_TIMEOUT);
@@ -150,7 +149,7 @@
* @param[in] objPath - D-Bus object path.
* @return On success returns the map of name value pair.
*/
-ObjectValueTree getManagedObjects(sdbusplus::bus::bus& bus,
+ObjectValueTree getManagedObjects(sdbusplus::bus_t& bus,
const std::string& service,
const std::string& objPath);
@@ -162,7 +161,7 @@
* @param[in] property - name of the property.
* @param[in] value - value which needs to be set.
*/
-void setDbusProperty(sdbusplus::bus::bus& bus, const std::string& service,
+void setDbusProperty(sdbusplus::bus_t& bus, const std::string& service,
const std::string& objPath, const std::string& interface,
const std::string& property, const Value& value,
std::chrono::microseconds timeout = IPMI_DBUS_TIMEOUT);
@@ -175,7 +174,7 @@
* @param[in] match - Identifier for a path.
* @returns map of object path and service info.
*/
-ObjectTree getAllDbusObjects(sdbusplus::bus::bus& bus,
+ObjectTree getAllDbusObjects(sdbusplus::bus_t& bus,
const std::string& serviceRoot,
const std::string& interface,
const std::string& match = {});
@@ -187,8 +186,7 @@
* @param[in] interface - Dbus interface.
* @param[in] match - Identifier for object.
*/
-void deleteAllDbusObjects(sdbusplus::bus::bus& bus,
- const std::string& serviceRoot,
+void deleteAllDbusObjects(sdbusplus::bus_t& bus, const std::string& serviceRoot,
const std::string& interface,
const std::string& match = {});
@@ -199,7 +197,7 @@
* @param[in] interfaces - Dbus interface list.
* @return map of object path and service info.
*/
-ObjectTree getAllAncestors(sdbusplus::bus::bus& bus, const std::string& path,
+ObjectTree getAllAncestors(sdbusplus::bus_t& bus, const std::string& path,
InterfaceList&& interfaces);
/********* Begin co-routine yielding alternatives ***************/
@@ -434,7 +432,7 @@
* @param[in] interface - Dbus interface.
* @param[in] method - Dbus method.
*/
-void callDbusMethod(sdbusplus::bus::bus& bus, const std::string& service,
+void callDbusMethod(sdbusplus::bus_t& bus, const std::string& service,
const std::string& objPath, const std::string& interface,
const std::string& method);