control: Actions use list of groups set on base object
Remove the reference to a group given when running an action and instead
have each action iterate over the list of groups configured/set on the
base action object. The group configured/set on the base action object
is the only set of groups that the action should use based on its
configuration in an event.
Change-Id: Ia298d270e782ad729b5a29f9cdfe9b6c9ea4bc45
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/json/actions/action.hpp b/control/json/actions/action.hpp
index 0369ec9..9f642df 100644
--- a/control/json/actions/action.hpp
+++ b/control/json/actions/action.hpp
@@ -137,13 +137,11 @@
* @brief Run the action
*
* Run the action function associated to the derived action object
- * that performs a specific task against a group of dbus objects on a zone
- * configured by a user.
+ * that performs a specific tasks on a zone configured by a user.
*
* @param[in] zone - Zone to run the action on
- * @param[in] group - Group of dbus objects the action runs against
*/
- virtual void run(Zone& zone, const Group& group) = 0;
+ virtual void run(Zone& zone) = 0;
/**
* @brief Trigger the action to run against all of its zones
@@ -153,9 +151,8 @@
*/
void run()
{
- // TODO Remove passing a reference of a group to run the action
std::for_each(_zones.begin(), _zones.end(),
- [this](Zone& zone) { this->run(zone, _groups.front()); });
+ [this](Zone& zone) { this->run(zone); });
}
protected: