blob: 61a2f509b30709003c568e0c0c36403c9fae1d43 [file] [log] [blame]
Matthew Barthccc77702017-07-28 13:43:04 -05001#pragma once
2
3namespace phosphor
4{
5namespace fan
6{
7namespace control
8{
9namespace precondition
10{
11
12/**
13 * @brief A precondition to compare a group of property values and
14 * subscribe/unsubscribe a set speed event group
15 * @details Compares each entry within the precondition group to a given value
16 * that when each entry's property value matches the given value, the set speed
17 * event is then initialized. At any point a precondition entry's value no
18 * longer matches, the set speed event is removed from being active and fans
19 * are set to full speed.
20 *
21 * @param[in] pg - Precondition property group of property values
22 * @param[in] sse - Set speed event definition
23 *
24 * @return Lambda function
25 * A lambda function to compare precondition property value states
26 * and either subscribe or unsubscribe a set speed event group.
27 */
28auto property_states_match(std::vector<PrecondGroup>&& pg,
29 SetSpeedEvent&& sse)
30{
31 return [pg = std::move(pg),
32 sse = std::move(sse)](auto& zone, auto& group)
33 {
34 // TODO Read/Compare given precondition entries
35 // TODO Only init the event when the precondition(s) are true
36 // TODO Remove the event properties when the precondition(s) are false
37 };
38}
39
40} // namespace precondition
41} // namespace control
42} // namespace fan
43} // namespace phosphor