1 #pragma once
2 
3 #include "types.hpp"
4 #include "zone.hpp"
5 
6 namespace phosphor
7 {
8 namespace fan
9 {
10 namespace control
11 {
12 namespace trigger
13 {
14 
15 /**
16  * @brief A trigger to start a timer for an event
17  * @details Creates and starts a timer according to the configuration given
18  * that will call an event's actions upon each timer expiration.
19  *
20  * @param[in] tConf - Timer configuration parameters
21  *
22  * @return Trigger lambda function
23  *     A Trigger function that creates and starts a timer
24  */
25 Trigger timer(TimerConf&& tConf);
26 
27 /**
28  * @brief A trigger of a signal for an event
29  * @details Subscribes to the defined signal match.
30  *
31  * @param[in] match - Signal match to subscribe to
32  * @param[in] handler - Handler function for the received signal
33  *
34  * @return Trigger lambda function
35  *     A Trigger function that subscribes to a signal
36  */
37 Trigger signal(const std::string& match, SignalHandler&& handler);
38 
39 /**
40  * @brief A trigger for actions to run at event init
41  * @details Runs the event actions when the event is initialized. An event
42  * is initialized at application start or each time an event's precondition
43  * transitions to a valid state.
44  *
45  * @param[in] handler - Handler function to use for event init
46  *
47  * @return Trigger lambda function
48  *     A Trigger function that runs actions at event init
49  */
50 Trigger init(MethodHandler&& handler = nullptr);
51 
52 } // namespace trigger
53 } // namespace control
54 } // namespace fan
55 } // namespace phosphor
56