control: Construct events' groups
For each event, using the available groups, construct the groups
configured for the event. Groups with the same profiles configured as an
event can be used and events with no profiles configured, can also use
groups with no profiles configured.
*Note: Profiles are ways to keep specific configuration entries from
being used under specified details given within the `profiles.json`
configuration.
Change-Id: I47ce125ebb68e7075efc1c095d525bc9c96630e7
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/json/event.hpp b/control/json/event.hpp
index 3bc41ae..05459c7 100644
--- a/control/json/event.hpp
+++ b/control/json/event.hpp
@@ -23,6 +23,8 @@
#include <nlohmann/json.hpp>
#include <sdbusplus/bus.hpp>
+#include <optional>
+
namespace phosphor::fan::control::json
{
@@ -46,6 +48,15 @@
*/
class Event : public ConfigBase
{
+ static constexpr auto pathPos = 0;
+ static constexpr auto intfPos = 1;
+ static constexpr auto propPos = 2;
+ static constexpr auto typePos = 3;
+ static constexpr auto valuePos = 4;
+ using eGroup = std::vector<std::tuple<std::string, std::string, std::string,
+ std::optional<std::string>,
+ std::optional<PropertyVariantType>>>;
+
static constexpr auto precondName = 0;
static constexpr auto precondGroups = 1;
static constexpr auto precondEvents = 2;
@@ -123,7 +134,7 @@
Precondition _precond;
/* List of groups associated with the event */
- std::vector<Group> _groups;
+ std::vector<eGroup> _groups;
/* List of triggers for this event */
std::vector<Trigger> _triggers;