control: Store/use trigger enable functions on events
Create and store trigger enablement functions on the events based on the
trigger's configuration so that they can be enabled separately from when
the event is created. This will allow actions that load events to be
able to be parsed and then enabled when the action determines that the
events should be enabled. It also supports the use of SIGHUP to reload
the event configuration since the events JSON configuration must
successfully be loaded before the newly created events can be enabled in
place of the currently enabled events.
Change-Id: I31871ee1691d5e6b26fe16cde2a829c426ad6504
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/json/triggers/timer.hpp b/control/json/triggers/timer.hpp
index 1be7fdd..1e6a931 100644
--- a/control/json/triggers/timer.hpp
+++ b/control/json/triggers/timer.hpp
@@ -17,6 +17,7 @@
#include "../manager.hpp"
#include "action.hpp"
+#include "trigger_aliases.hpp"
#include <nlohmann/json.hpp>
@@ -57,8 +58,8 @@
* have their timers started. Once the timer expires, per its configuration,
* the corresponding event's actions are run.
*/
-void triggerTimer(const json& jsonObj, const std::string& eventName,
- Manager* mgr,
- std::vector<std::unique_ptr<ActionBase>>& actions);
+enableTrigger triggerTimer(const json& jsonObj, const std::string& eventName,
+ Manager* mgr,
+ std::vector<std::unique_ptr<ActionBase>>& actions);
} // namespace phosphor::fan::control::json::trigger::timer