summaryrefslogtreecommitdiffstats
path: root/presence/templates/generated.mako.hpp
blob: 3afd29f5415b1ed6487164adac1ce2acdd7563c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
## This file is a template, the comment below is emitted into the generated file
/* This is an auto generated file. Do not edit. */
#pragma once

#include <array>
#include <memory>
#include <string>
#include "fallback.hpp"
#include "fan.hpp"
#include "gpio.hpp"
#include "tach.hpp"

using namespace std::string_literals;

namespace phosphor
{
namespace fan
{
namespace presence
{

struct ConfigPolicy;

struct ConfigSensors
{
    using Sensors = std::array<std::unique_ptr<PresenceSensor>, ${len(sensors)}>;

    static auto& get()
    {
        static const Sensors sensors =
        {
% for s in sensors:
            ${s.construct(loader, indent=indent +3)},
% endfor
        };
        return sensors;
    }
};

struct ConfigFans
{
    using Fans = std::array<Fan, ${len(fans)}>;

    static auto& get()
    {
        static const Fans fans =
        {
            {
% for f in fans:
                Fans::value_type{
                    "${f.name}"s,
                    "${f.path}"s,
                },
% endfor
            }
        };
        return fans;
    }
};

struct ConfigPolicy
{
    using Policies = std::array<std::unique_ptr<RedundancyPolicy>, ${len(policies)}>;

    static auto& get()
    {
        static const Policies policies =
        {
% for p in policies:
            ${p.construct(loader, indent=indent +3)},
% endfor
        };
        return policies;
    }
};
} // namespace presence
} // namespace fan
} // namespace phosphor
OpenPOWER on IntegriCloud