Matthew Barth | ccc7770 | 2017-07-28 13:43:04 -0500 | [diff] [blame^] | 1 | #pragma once |
| 2 | |
| 3 | namespace phosphor |
| 4 | { |
| 5 | namespace fan |
| 6 | { |
| 7 | namespace control |
| 8 | { |
| 9 | namespace 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 | */ |
| 28 | auto 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 |