Matthew Barth | 293477d | 2017-02-17 15:39:36 -0600 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Matthew Barth | b803445 | 2017-02-17 16:39:46 -0600 | [diff] [blame] | 3 | #include <sdbusplus/bus.hpp> |
| 4 | #include "fan_properties.hpp" |
Matthew Barth | d640382 | 2017-02-17 17:10:19 -0600 | [diff] [blame^] | 5 | #include "sensor_base.hpp" |
Matthew Barth | b803445 | 2017-02-17 16:39:46 -0600 | [diff] [blame] | 6 | |
Matthew Barth | 293477d | 2017-02-17 15:39:36 -0600 | [diff] [blame] | 7 | |
| 8 | namespace phosphor |
| 9 | { |
| 10 | namespace fan |
| 11 | { |
| 12 | namespace presence |
| 13 | { |
| 14 | |
| 15 | class FanEnclosure |
| 16 | { |
| 17 | public: |
| 18 | FanEnclosure() = delete; |
| 19 | FanEnclosure(const FanEnclosure&) = delete; |
| 20 | FanEnclosure(FanEnclosure&&) = default; |
| 21 | FanEnclosure& operator=(const FanEnclosure&) = delete; |
Matthew Barth | b803445 | 2017-02-17 16:39:46 -0600 | [diff] [blame] | 22 | FanEnclosure& operator=(FanEnclosure&&) = delete; |
Matthew Barth | 293477d | 2017-02-17 15:39:36 -0600 | [diff] [blame] | 23 | ~FanEnclosure() = default; |
| 24 | |
Matthew Barth | b803445 | 2017-02-17 16:39:46 -0600 | [diff] [blame] | 25 | FanEnclosure(sdbusplus::bus::bus& bus, |
| 26 | const phosphor::fan::Properties& fanProp) : |
| 27 | bus(bus), |
| 28 | invPath(std::get<0>(fanProp)), |
| 29 | fanDesc(std::get<1>(fanProp)) |
| 30 | { |
| 31 | //Add this fan to inventory |
| 32 | addInventory(); |
| 33 | } |
| 34 | |
Matthew Barth | d640382 | 2017-02-17 17:10:19 -0600 | [diff] [blame^] | 35 | void addSensor( |
| 36 | std::unique_ptr<Sensor>&& sensor); |
| 37 | |
Matthew Barth | 293477d | 2017-02-17 15:39:36 -0600 | [diff] [blame] | 38 | private: |
Matthew Barth | b803445 | 2017-02-17 16:39:46 -0600 | [diff] [blame] | 39 | sdbusplus::bus::bus& bus; |
| 40 | const std::string invPath; |
| 41 | const std::string fanDesc; |
Matthew Barth | d640382 | 2017-02-17 17:10:19 -0600 | [diff] [blame^] | 42 | std::vector<std::unique_ptr<Sensor>> sensors; |
Matthew Barth | b803445 | 2017-02-17 16:39:46 -0600 | [diff] [blame] | 43 | |
| 44 | void addInventory(); |
Matthew Barth | 293477d | 2017-02-17 15:39:36 -0600 | [diff] [blame] | 45 | |
| 46 | }; |
| 47 | |
| 48 | } // namespace presence |
| 49 | } // namespace fan |
| 50 | } // namespace phosphor |