blob: f360886833531ac92a06dda953895e06eaa4a7bd [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
14/**
15 * @brief A precondition to compare a group of property values and
16 * subscribe/unsubscribe a set speed event group
17 * @details Compares each entry within the precondition group to a given value
18 * that when each entry's property value matches the given value, the set speed
19 * event is then initialized. At any point a precondition entry's value no
20 * longer matches, the set speed event is removed from being active and fans
21 * are set to full speed.
22 *
23 * @param[in] pg - Precondition property group of property values
24 * @param[in] sse - Set speed event definition
25 *
26 * @return Lambda function
27 * A lambda function to compare precondition property value states
28 * and either subscribe or unsubscribe a set speed event group.
29 */
Matthew Barth03aff082018-12-12 15:20:22 -060030Action property_states_match(std::vector<PrecondGroup>&& pg,
31 std::vector<SetSpeedEvent>&& sse);
Matthew Barthccc77702017-07-28 13:43:04 -050032
Matthew Barth36cfcec2018-12-14 10:18:53 -060033/**
34 * @brief A precondition to determine if there are any missing owners
35 * of the services for the group to init/remove a set speed event
36 * @details Checks each service associated with a group has an owner and
37 * if any of the services are missing an owner, the precondition passes
38 * and the events are initialized. Once all services associated with a
39 * group have an owner, the events are removed from being active.
40 *
41 * @param[in] sse - Set speed event definitions
42 *
43 * @return Lambda function
44 * A lambda function precondition to check for group member services
45 * that are not owned to either initialize or remove set speed events.
46 */
47Action services_missing_owner(std::vector<SetSpeedEvent>&& sse);
48
Matthew Barthccc77702017-07-28 13:43:04 -050049} // namespace precondition
50} // namespace control
51} // namespace fan
52} // namespace phosphor