1 #pragma once
2 #include <string>
3 #include <tuple>
4 #include <vector>
5 
6 namespace phosphor
7 {
8 namespace fan
9 {
10 namespace control
11 {
12 
13 class Zone;
14 
15 constexpr auto propertyNamePos = 0;
16 constexpr auto propertyInterfacePos = 1;
17 constexpr auto propertyPathPos = 2;
18 constexpr auto propertyValuePos = 3;
19 
20 // TODO openbmc/openbmc#1769: Support more property types.
21 using ConditionProperty = std::tuple<std::string,
22                           std::string,
23                           std::string,
24                           bool>;
25 
26 constexpr auto conditionTypePos = 0;
27 constexpr auto conditionPropertyListPos = 1;
28 using Condition = std::tuple<std::string,
29                              std::vector<ConditionProperty>>;
30 
31 using PropertyVariantType = sdbusplus::message::variant<bool, int64_t>;
32 
33 constexpr auto fanNamePos = 0;
34 constexpr auto sensorListPos = 1;
35 using FanDefinition = std::tuple<std::string, std::vector<std::string>>;
36 
37 constexpr auto intfPos = 0;
38 constexpr auto propPos = 1;
39 using Group = std::map<std::string, std::tuple<std::string, std::string>>;
40 using Handler = std::function<void(sdbusplus::bus::bus&,
41                                    sdbusplus::message::message&,
42                                    Zone&)>;
43 using Action = std::function<void(Zone&, const Group&)>;
44 
45 constexpr auto signaturePos = 0;
46 constexpr auto handlerObjPos = 1;
47 using PropertyChange = std::tuple<std::string, Handler>;
48 
49 constexpr auto groupPos = 0;
50 constexpr auto actionPos = 1;
51 constexpr auto propChangeListPos = 2;
52 using SetSpeedEvent = std::tuple<Group, Action, std::vector<PropertyChange>>;
53 
54 constexpr auto eventGroupPos = 0;
55 constexpr auto eventHandlerPos = 1;
56 constexpr auto eventActionPos = 2;
57 using EventData = std::tuple<Group, Handler, Action>;
58 
59 constexpr auto zoneNumPos = 0;
60 constexpr auto fullSpeedPos = 1;
61 constexpr auto floorSpeedPos = 2;
62 constexpr auto incDelayPos = 3;
63 constexpr auto decIntervalPos = 4;
64 constexpr auto fanListPos = 5;
65 constexpr auto setSpeedEventsPos = 6;
66 using ZoneDefinition = std::tuple<size_t,
67                                   uint64_t,
68                                   uint64_t,
69                                   size_t,
70                                   size_t,
71                                   std::vector<FanDefinition>,
72                                   std::vector<SetSpeedEvent>>;
73 
74 constexpr auto conditionListPos = 0;
75 constexpr auto zoneListPos = 1;
76 using ZoneGroup = std::tuple<std::vector<Condition>,
77                              std::vector<ZoneDefinition>>;
78 
79 }
80 }
81 }
82