1 #pragma once 2 3 #include <sdbusplus/async.hpp> 4 #include <sdbusplus/message/native_types.hpp> 5 6 #include <functional> 7 #include <string> 8 #include <vector> 9 10 namespace entity_manager 11 { 12 13 using interface_list_t = std::vector<std::string>; 14 15 class EntityManagerInterface 16 { 17 public: 18 using Callback_t = std::function<sdbusplus::async::task<>( 19 const sdbusplus::message::object_path&, const std::string&)>; 20 static constexpr auto serviceName = "xyz.openbmc_project.EntityManager"; 21 22 EntityManagerInterface() = delete; 23 24 explicit EntityManagerInterface( 25 sdbusplus::async::context& ctx, const interface_list_t& interfaceNames, 26 Callback_t addedCallback, Callback_t removedCallback); 27 28 /** Get the inventory info from Entity Manager */ 29 auto handleInventoryGet() -> sdbusplus::async::task<>; 30 31 private: 32 /** @brief Handle async inventory add from Entity Manager */ 33 auto handleInventoryAdded() -> sdbusplus::async::task<>; 34 35 /** @brief Handle async inventory remove from Entity Manager */ 36 auto handleInventoryRemoved() -> sdbusplus::async::task<>; 37 38 sdbusplus::async::context& ctx; 39 interface_list_t interfaceNames; 40 Callback_t addedCallback; 41 Callback_t removedCallback; 42 }; 43 44 } // namespace entity_manager 45