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: Ie85ba085aedffd41bcb6310ee57adb86cb68273d
diff --git a/lpcsnoop/snoop.hpp b/lpcsnoop/snoop.hpp
index dab3334..dfa11de 100644
--- a/lpcsnoop/snoop.hpp
+++ b/lpcsnoop/snoop.hpp
@@ -10,7 +10,7 @@
constexpr char snoopDbus[] = "xyz.openbmc_project.State.Boot.Raw";
template <typename... T>
-using ServerObject = typename sdbusplus::server::object::object<T...>;
+using ServerObject = typename sdbusplus::server::object_t<T...>;
using PostInterface = sdbusplus::xyz::openbmc_project::State::Boot::server::Raw;
using PostObject = ServerObject<PostInterface>;
using primary_post_code_t = uint64_t;
@@ -20,7 +20,7 @@
class PostReporter : public PostObject
{
public:
- PostReporter(sdbusplus::bus::bus& bus, const char* objPath, bool defer) :
+ PostReporter(sdbusplus::bus_t& bus, const char* objPath, bool defer) :
PostObject(bus, objPath,
defer ? PostObject::action::defer_emit
: PostObject::action::emit_object_added)
diff --git a/lpcsnoop/snoop_listen.hpp b/lpcsnoop/snoop_listen.hpp
index 292745b..3a3682b 100644
--- a/lpcsnoop/snoop_listen.hpp
+++ b/lpcsnoop/snoop_listen.hpp
@@ -35,21 +35,21 @@
class SnoopListen
{
- using message_handler_t = std::function<void(sdbusplus::message::message&)>;
+ using message_handler_t = std::function<void(sdbusplus::message_t&)>;
using postcode_handler_t = std::function<void(FILE*, postcode_t)>;
public:
- SnoopListen(sdbusplus::bus::bus& busIn, sd_bus_message_handler_t handler) :
+ SnoopListen(sdbusplus::bus_t& busIn, sd_bus_message_handler_t handler) :
signal(busIn, GetMatchRule().c_str(), handler, this)
{
}
- SnoopListen(sdbusplus::bus::bus& busIn, message_handler_t handler) :
+ SnoopListen(sdbusplus::bus_t& busIn, message_handler_t handler) :
signal(busIn, GetMatchRule(), handler)
{
}
- SnoopListen(sdbusplus::bus::bus& busIn, postcode_handler_t handler,
+ SnoopListen(sdbusplus::bus_t& busIn, postcode_handler_t handler,
FILE* f = NULL) :
SnoopListen(busIn, std::bind(defaultMessageHandler, handler, f,
std::placeholders::_1))
@@ -71,7 +71,7 @@
* DBus path, and calls the given postcode_handler on each value received.
*/
static void defaultMessageHandler(postcode_handler_t& handler, FILE* f,
- sdbusplus::message::message& m)
+ sdbusplus::message_t& m)
{
std::string messageBusName;
std::map<std::string, std::variant<postcode_t>> messageData;