blob: 86e1ba92598886551dca1cb63520f278db3caf5e [file] [log] [blame]
#pragma once
#include <sdbusplus/async.hpp>
#include <sdbusplus/message/native_types.hpp>
#include <functional>
#include <string>
#include <vector>
namespace entity_manager
{
using interface_list_t = std::vector<std::string>;
class EntityManagerInterface
{
public:
using Callback_t = std::function<sdbusplus::async::task<>(
const sdbusplus::message::object_path&, const std::string&)>;
static constexpr auto serviceName = "xyz.openbmc_project.EntityManager";
EntityManagerInterface() = delete;
explicit EntityManagerInterface(
sdbusplus::async::context& ctx, const interface_list_t& interfaceNames,
Callback_t addedCallback, Callback_t removedCallback);
/** Get the inventory info from Entity Manager */
auto handleInventoryGet() -> sdbusplus::async::task<>;
private:
/** @brief Handle async inventory add from Entity Manager */
auto handleInventoryAdded() -> sdbusplus::async::task<>;
/** @brief Handle async inventory remove from Entity Manager */
auto handleInventoryRemoved() -> sdbusplus::async::task<>;
sdbusplus::async::context& ctx;
interface_list_t interfaceNames;
Callback_t addedCallback;
Callback_t removedCallback;
};
} // namespace entity_manager