blob: 1ee3cf66ab254fecb7ad5309ccdd213bde036a3a [file] [log] [blame]
Matthew Barthccc77702017-07-28 13:43:04 -05001#pragma once
2
Matthew Barth03aff082018-12-12 15:20:22 -06003#include "types.hpp"
Matthew Barth604329e2017-08-04 11:18:28 -05004
Matthew Barthccc77702017-07-28 13:43:04 -05005namespace phosphor
6{
7namespace fan
8{
9namespace control
10{
11namespace precondition
12{
13
Matthew Barth572d4062018-05-08 14:16:04 -050014using namespace phosphor::logging;
15
Matthew Barthccc77702017-07-28 13:43:04 -050016/**
17 * @brief A precondition to compare a group of property values and
18 * subscribe/unsubscribe a set speed event group
19 * @details Compares each entry within the precondition group to a given value
20 * that when each entry's property value matches the given value, the set speed
21 * event is then initialized. At any point a precondition entry's value no
22 * longer matches, the set speed event is removed from being active and fans
23 * are set to full speed.
24 *
25 * @param[in] pg - Precondition property group of property values
26 * @param[in] sse - Set speed event definition
27 *
28 * @return Lambda function
29 * A lambda function to compare precondition property value states
30 * and either subscribe or unsubscribe a set speed event group.
31 */
Matthew Barth03aff082018-12-12 15:20:22 -060032Action property_states_match(std::vector<PrecondGroup>&& pg,
33 std::vector<SetSpeedEvent>&& sse);
Matthew Barthccc77702017-07-28 13:43:04 -050034
35} // namespace precondition
36} // namespace control
37} // namespace fan
38} // namespace phosphor