Matthew Barth | 1b4de26 | 2018-03-06 13:03:16 -0600 | [diff] [blame] | 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 | |
Matthew Barth | 016bd24 | 2018-03-07 16:06:06 -0600 | [diff] [blame] | 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 | */ |
Matthew Barth | 926df66 | 2018-10-09 09:51:12 -0500 | [diff] [blame] | 37 | Trigger signal(const std::string& match, SignalHandler&& handler); |
Matthew Barth | 016bd24 | 2018-03-07 16:06:06 -0600 | [diff] [blame] | 38 | |
Matthew Barth | cd3bfbc | 2018-03-07 16:26:03 -0600 | [diff] [blame] | 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 | */ |
Matthew Barth | 926df66 | 2018-10-09 09:51:12 -0500 | [diff] [blame] | 50 | Trigger init(MethodHandler&& handler = nullptr); |
Matthew Barth | cd3bfbc | 2018-03-07 16:26:03 -0600 | [diff] [blame] | 51 | |
Matthew Barth | 1b4de26 | 2018-03-06 13:03:16 -0600 | [diff] [blame] | 52 | } // namespace trigger |
| 53 | } // namespace control |
| 54 | } // namespace fan |
| 55 | } // namespace phosphor |