1 ## This file is a template, the comment below is emitted into the generated file 2 /* This is an auto generated file. Do not edit. */ 3 #pragma once 4 5 #include <array> 6 #include <memory> 7 #include <optional> 8 #include <string> 9 #include "anyof.hpp" 10 #include "fallback.hpp" 11 #include "fan.hpp" 12 #include "gpio.hpp" 13 #include "tach.hpp" 14 15 using namespace std::string_literals; 16 17 namespace phosphor 18 { 19 namespace fan 20 { 21 namespace presence 22 { 23 24 struct ConfigPolicy; 25 26 struct ConfigSensors 27 { 28 using Sensors = std::array<std::unique_ptr<PresenceSensor>, ${len(sensors)}>; 29 30 static auto& get() 31 { 32 static const Sensors sensors = 33 { 34 % for s in sensors: 35 ${s.construct(loader, indent=indent +3)}, 36 % endfor 37 }; 38 return sensors; 39 } 40 }; 41 42 struct ConfigFans 43 { 44 using Fans = std::array<Fan, ${len(fans)}>; 45 46 static auto& get() 47 { 48 static const Fans fans = 49 { 50 { 51 % for f in fans: 52 Fans::value_type{ 53 "${f.name}"s, 54 "${f.path}"s, 55 std::nullopt 56 }, 57 % endfor 58 } 59 }; 60 return fans; 61 } 62 }; 63 64 struct ConfigPolicy 65 { 66 using Policies = std::array<std::unique_ptr<RedundancyPolicy>, ${len(policies)}>; 67 68 static auto& get() 69 { 70 static const Policies policies = 71 { 72 % for p in policies: 73 ${p.construct(loader, indent=indent +3)}, 74 % endfor 75 }; 76 return policies; 77 } 78 }; 79 } // namespace presence 80 } // namespace fan 81 } // namespace phosphor 82