blob: b02d6e11850d442719537731562975adbbccc1fd [file] [log] [blame]
Matthew Barthcd4f4d12017-02-17 17:48:56 -06001#include <algorithm>
Matthew Barth293477d2017-02-17 15:39:36 -06002#include "fan_enclosure.hpp"
3
4
5namespace phosphor
6{
7namespace fan
8{
9namespace presence
10{
11
Matthew Barthb8034452017-02-17 16:39:46 -060012void FanEnclosure::addInventory()
13{
14 //TODO Add this fan to inventory
15}
Matthew Barth293477d2017-02-17 15:39:36 -060016
Matthew Barthcd4f4d12017-02-17 17:48:56 -060017void FanEnclosure::updInventory()
18{
19 auto presPred = [](auto const& s) {return s->isPresent();};
20 // Determine if all sensors show fan is not present
21 auto isPresent = std::any_of(FanEnclosure::sensors.begin(),
22 FanEnclosure::sensors.end(),
23 presPred);
24 if (!isPresent)
25 {
26 //TODO Update inventory for this fan
27 }
28}
29
Matthew Barthd6403822017-02-17 17:10:19 -060030void FanEnclosure::addSensor(
31 std::unique_ptr<Sensor>&& sensor)
32{
33 FanEnclosure::sensors.push_back(std::move(sensor));
34}
35
Matthew Barth293477d2017-02-17 15:39:36 -060036} // namespace presence
37} // namespace fan
38} // namespace phosphor