blob: 6ba18dc5b5a3ee4a3ac67eee5bfb4799bae76775 [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>
7#include <string>
Brad Bishopfcbedca2017-07-25 19:59:46 -04008#include "anyof.hpp"
Brad Bishop55935602017-06-13 13:31:24 -04009#include "fallback.hpp"
10#include "fan.hpp"
11#include "gpio.hpp"
12#include "tach.hpp"
13
14using namespace std::string_literals;
15
16namespace phosphor
17{
18namespace fan
19{
20namespace presence
21{
22
23struct ConfigPolicy;
24
25struct ConfigSensors
26{
27 using Sensors = std::array<std::unique_ptr<PresenceSensor>, ${len(sensors)}>;
28
29 static auto& get()
30 {
31 static const Sensors sensors =
32 {
33% for s in sensors:
34 ${s.construct(loader, indent=indent +3)},
35% endfor
36 };
37 return sensors;
38 }
39};
40
41struct ConfigFans
42{
43 using Fans = std::array<Fan, ${len(fans)}>;
44
45 static auto& get()
46 {
47 static const Fans fans =
48 {
49 {
50% for f in fans:
51 Fans::value_type{
52 "${f.name}"s,
53 "${f.path}"s,
54 },
55% endfor
56 }
57 };
58 return fans;
59 }
60};
61
62struct ConfigPolicy
63{
64 using Policies = std::array<std::unique_ptr<RedundancyPolicy>, ${len(policies)}>;
65
66 static auto& get()
67 {
68 static const Policies policies =
69 {
70% for p in policies:
71 ${p.construct(loader, indent=indent +3)},
72% endfor
73 };
74 return policies;
75 }
76};
77} // namespace presence
78} // namespace fan
79} // namespace phosphor