blob: f214f1892d69366459d5a6a759b5ad03f33253bf [file] [log] [blame]
Matthew Barth293477d2017-02-17 15:39:36 -06001#pragma once
2
Matthew Barthb8034452017-02-17 16:39:46 -06003#include <sdbusplus/bus.hpp>
4#include "fan_properties.hpp"
5
Matthew Barth293477d2017-02-17 15:39:36 -06006
7namespace phosphor
8{
9namespace fan
10{
11namespace presence
12{
13
14class FanEnclosure
15{
16 public:
17 FanEnclosure() = delete;
18 FanEnclosure(const FanEnclosure&) = delete;
19 FanEnclosure(FanEnclosure&&) = default;
20 FanEnclosure& operator=(const FanEnclosure&) = delete;
Matthew Barthb8034452017-02-17 16:39:46 -060021 FanEnclosure& operator=(FanEnclosure&&) = delete;
Matthew Barth293477d2017-02-17 15:39:36 -060022 ~FanEnclosure() = default;
23
Matthew Barthb8034452017-02-17 16:39:46 -060024 FanEnclosure(sdbusplus::bus::bus& bus,
25 const phosphor::fan::Properties& fanProp) :
26 bus(bus),
27 invPath(std::get<0>(fanProp)),
28 fanDesc(std::get<1>(fanProp))
29 {
30 //Add this fan to inventory
31 addInventory();
32 }
33
Matthew Barth293477d2017-02-17 15:39:36 -060034 private:
Matthew Barthb8034452017-02-17 16:39:46 -060035 sdbusplus::bus::bus& bus;
36 const std::string invPath;
37 const std::string fanDesc;
38
39 void addInventory();
Matthew Barth293477d2017-02-17 15:39:36 -060040
41};
42
43} // namespace presence
44} // namespace fan
45} // namespace phosphor