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: I2d7ce287e0adc0be60796a80e9bb4cca908434ce
diff --git a/nvme_main.cpp b/nvme_main.cpp
index 8552593..c9e3a96 100644
--- a/nvme_main.cpp
+++ b/nvme_main.cpp
@@ -13,7 +13,7 @@
int main(void)
{
- sdbusplus::bus::bus bus = sdbusplus::bus::new_default();
+ sdbusplus::bus_t bus = sdbusplus::bus::new_default();
sd_event* event = nullptr;
auto eventDeleter = [](sd_event* e) { e = sd_event_unref(e); };
@@ -25,7 +25,7 @@
// attach bus to this event loop
bus.attach_event(sdEvent.get(), SD_EVENT_PRIORITY_NORMAL);
- sdbusplus::server::manager::manager objManager(bus, NVME_OBJ_PATH_ROOT);
+ sdbusplus::server::manager_t objManager(bus, NVME_OBJ_PATH_ROOT);
phosphor::nvme::Nvme objMgr(bus);
diff --git a/nvme_manager.hpp b/nvme_manager.hpp
index 391a768..0ee23df 100644
--- a/nvme_manager.hpp
+++ b/nvme_manager.hpp
@@ -35,7 +35,7 @@
* @param[in] bus - Handle to system dbus
* @param[in] objPath - The dbus path of nvme
*/
- Nvme(sdbusplus::bus::bus& bus) :
+ Nvme(sdbusplus::bus_t& bus) :
bus(bus), _event(sdeventplus::Event::get_default()),
_timer(_event, std::bind(&Nvme::read, this))
{
@@ -134,7 +134,7 @@
private:
/** @brief sdbusplus bus client connection. */
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/** @brief the Event Loop structure */
sdeventplus::Event _event;
/** @brief Read Timer */
diff --git a/nvmes.hpp b/nvmes.hpp
index 436dd38..e11c891 100644
--- a/nvmes.hpp
+++ b/nvmes.hpp
@@ -18,9 +18,8 @@
using WarningInterface =
sdbusplus::xyz::openbmc_project::Sensor::Threshold::server::Warning;
-using NvmeIfaces =
- sdbusplus::server::object::object<ValueIface, CriticalInterface,
- WarningInterface>;
+using NvmeIfaces = sdbusplus::server::object_t<ValueIface, CriticalInterface,
+ WarningInterface>;
class NvmeSSD : public NvmeIfaces
{
@@ -37,7 +36,7 @@
* @param[in] bus - Handle to system dbus
* @param[in] objPath - The Dbus path of nvme
*/
- NvmeSSD(sdbusplus::bus::bus& bus, const char* objPath) :
+ NvmeSSD(sdbusplus::bus_t& bus, const char* objPath) :
NvmeIfaces(bus, objPath), bus(bus)
{
ValueIface::unit(Unit::DegreesC);
@@ -54,7 +53,7 @@
void setSensorMaxMin(int8_t maxValue, int8_t minValue);
private:
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
};
} // namespace nvme
} // namespace phosphor
diff --git a/sdbusplus.hpp b/sdbusplus.hpp
index 186a88d..c0a1848 100644
--- a/sdbusplus.hpp
+++ b/sdbusplus.hpp
@@ -20,10 +20,10 @@
{
public:
template <typename T>
- static auto
- setProperty(sdbusplus::bus::bus& bus, const std::string& busName,
- const std::string& objPath, const std::string& interface,
- const std::string& property, const T& value)
+ static auto setProperty(sdbusplus::bus_t& bus, const std::string& busName,
+ const std::string& objPath,
+ const std::string& interface,
+ const std::string& property, const T& value)
{
std::variant<T> data = value;
@@ -47,10 +47,10 @@
}
template <typename Property>
- static auto
- getProperty(sdbusplus::bus::bus& bus, const std::string& busName,
- const std::string& objPath, const std::string& interface,
- const std::string& property)
+ static auto getProperty(sdbusplus::bus_t& bus, const std::string& busName,
+ const std::string& objPath,
+ const std::string& interface,
+ const std::string& property)
{
auto methodCall = bus.new_method_call(busName.c_str(), objPath.c_str(),
DBUS_PROPERTY_IFACE, "Get");
@@ -76,7 +76,7 @@
}
template <typename... Args>
- static auto CallMethod(sdbusplus::bus::bus& bus, const std::string& busName,
+ static auto CallMethod(sdbusplus::bus_t& bus, const std::string& busName,
const std::string& objPath,
const std::string& interface,
const std::string& method, Args&&... args)