blob: 6ea9978be260e794286229088501857f207a38aa [file] [log] [blame]
Pavithra Barithaya319ebb32021-05-06 06:09:11 -05001#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
9namespace pldm
10{
11namespace dbus_api
12{
13
14using HostIntf = sdbusplus::server::object::object<
15 sdbusplus::xyz::openbmc_project::Condition::server::HostFirmware>;
16
17class 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::bus& 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