blob: 6395eac31c4ac7756597cad90325b590bd118e6c [file] [log] [blame]
Brad Bishop55935602017-06-13 13:31:24 -04001## 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>
Matt Spinler9e9f5992020-09-30 08:29:24 -05007#include <optional>
Brad Bishop55935602017-06-13 13:31:24 -04008#include <string>
Brad Bishopfcbedca2017-07-25 19:59:46 -04009#include "anyof.hpp"
Brad Bishop55935602017-06-13 13:31:24 -040010#include "fallback.hpp"
11#include "fan.hpp"
12#include "gpio.hpp"
13#include "tach.hpp"
14
15using namespace std::string_literals;
16
17namespace phosphor
18{
19namespace fan
20{
21namespace presence
22{
23
24struct ConfigPolicy;
25
26struct 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
42struct 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,
Matt Spinler9e9f5992020-09-30 08:29:24 -050055 std::nullopt
Brad Bishop55935602017-06-13 13:31:24 -040056 },
57% endfor
58 }
59 };
60 return fans;
61 }
62};
63
64struct 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