xref: /openbmc/pldm/host-bmc/host_condition.hpp (revision a743e384)
1 #pragma once
2 
3 #include "host-bmc/host_pdr_handler.hpp"
4 
5 #include <sdbusplus/bus.hpp>
6 #include <sdbusplus/server/object.hpp>
7 #include <xyz/openbmc_project/Condition/HostFirmware/server.hpp>
8 
9 namespace pldm
10 {
11 namespace dbus_api
12 {
13 
14 using HostIntf = sdbusplus::server::object_t<
15     sdbusplus::xyz::openbmc_project::Condition::server::HostFirmware>;
16 
17 class Host : public HostIntf
18 {
19   public:
20     Host() = delete;
21     Host(const Host&) = delete;
22     Host& operator=(const Host&) = delete;
23     Host(Host&&) = delete;
24     Host& operator=(Host&&) = delete;
25     virtual ~Host() = default;
26 
27     Host(sdbusplus::bus_t& bus, const std::string& path) :
28         HostIntf(bus, path.c_str()) {};
29 
30     /** @brief Override reads to CurrentFirmwareCondition */
31     FirmwareCondition currentFirmwareCondition() const override;
32 
33     /** @brief Store shared pointer to host PDR instance */
34     void setHostPdrObj(std::shared_ptr<HostPDRHandler> obj)
35     {
36         hostPdrObj = obj;
37     }
38 
39   private:
40     std::shared_ptr<HostPDRHandler> hostPdrObj;
41 };
42 } // namespace dbus_api
43 } // namespace pldm
44