summaryrefslogtreecommitdiffstats
path: root/control/zone.hpp
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2018-10-30 19:00:27 -0700
committerWilliam A. Kennington III <wak@google.com>2018-11-05 11:43:07 -0800
commit94fe1a0c83ba2d0dadc549b1d8afedf6478d2dcf (patch)
treed46070fc9ad670f751387f94c20e9fde90df89a0 /control/zone.hpp
parent122b843fdef01a66c602d1270d50b7db576e7167 (diff)
downloadphosphor-fan-presence-94fe1a0c83ba2d0dadc549b1d8afedf6478d2dcf.tar.gz
phosphor-fan-presence-94fe1a0c83ba2d0dadc549b1d8afedf6478d2dcf.zip
control/zone: Refactor addTimer
Anything adding a timer uses roughly the same process of building the event data and timer from the event group, actions, and timer config. We can adjust the method to do this for all callers. Tested: Builds and passes unit tests. Change-Id: I4013ff2f7bff65095a6e1db7075bc013da374f51 Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'control/zone.hpp')
-rw-r--r--control/zone.hpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/control/zone.hpp b/control/zone.hpp
index e035a64..4f4dfb6 100644
--- a/control/zone.hpp
+++ b/control/zone.hpp
@@ -367,15 +367,13 @@ class Zone
/**
* @brief Add a timer to the list of timer based events
*
- * @param[in] data - Event data for timer
- * @param[in] timer - Timer to be added
+ * @param[in] group - Group associated with a timer
+ * @param[in] actions - List of actions associated with a timer
+ * @param[in] tConf - Configuration for the new timer
*/
- inline void addTimer(
- std::unique_ptr<EventData>&& data,
- std::unique_ptr<phosphor::fan::util::Timer>&& timer)
- {
- _timerEvents.emplace_back(std::move(data), std::move(timer));
- };
+ void addTimer(const Group& group,
+ const std::vector<Action>& actions,
+ const TimerConf& tConf);
/**
* @brief Remove the given timer event
OpenPOWER on IntegriCloud