control: Create parameter trigger
Create a new event trigger that will run actions when a parameter is
either added, removed, or changed.
When the trigger is enabled it is added to the Manager class since that
is where parameters are stored, and then the Manager watches for
parameter changes and runs actions as needed.
The JSON config would look like:
{
"class": "parameter",
"parameter": "pcie_floor_index"
}
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I8ff281d49ac780e8ff38f3e8ed02ab95395f1fd3
diff --git a/control/json/triggers/signal.hpp b/control/json/triggers/signal.hpp
index 675bd21..ad44f95 100644
--- a/control/json/triggers/signal.hpp
+++ b/control/json/triggers/signal.hpp
@@ -50,8 +50,8 @@
* @param[in] group - Group to subscribe signal against
* @param[in] actions - Actions to be run when signal is received
*/
-void propertiesChanged(Manager* mgr, const Group& group, SignalActions& actions,
- const json&);
+void propertiesChanged(Manager* mgr, const Group& group,
+ TriggerActions& actions, const json&);
/**
* @brief Subscribes to an interfacesAdded signal
@@ -60,7 +60,7 @@
* @param[in] group - Group to subscribe signal against
* @param[in] actions - Actions to be run when signal is received
*/
-void interfacesAdded(Manager* mgr, const Group& group, SignalActions& actions,
+void interfacesAdded(Manager* mgr, const Group& group, TriggerActions& actions,
const json&);
/**
@@ -70,8 +70,8 @@
* @param[in] group - Group to subscribe signal against
* @param[in] actions - Actions to be run when signal is received
*/
-void interfacesRemoved(Manager* mgr, const Group& group, SignalActions& actions,
- const json&);
+void interfacesRemoved(Manager* mgr, const Group& group,
+ TriggerActions& actions, const json&);
/**
* @brief Subscribes to a nameOwnerChanged signal
@@ -80,7 +80,7 @@
* @param[in] group - Group to subscribe signal against
* @param[in] actions - Actions to be run when signal is received
*/
-void nameOwnerChanged(Manager* mgr, const Group& group, SignalActions& actions,
+void nameOwnerChanged(Manager* mgr, const Group& group, TriggerActions& actions,
const json&);
/**
@@ -90,12 +90,12 @@
* @param[in] group - Group to subscribe signal against
* @param[in] actions - Actions to be run when signal is received
*/
-void member(Manager* mgr, const Group& group, SignalActions& actions,
+void member(Manager* mgr, const Group& group, TriggerActions& actions,
const json&);
// Match setup function for signals
using SignalMatch =
- std::function<void(Manager*, const Group&, SignalActions&, const json&)>;
+ std::function<void(Manager*, const Group&, TriggerActions&, const json&)>;
/* Supported signals to their corresponding match setup functions */
static const std::unordered_map<std::string, SignalMatch> signals = {