Add/Remove event timers by event name

Using the event name as the key, each timer an event adds to the list of
timers are associated to that event. This allows quick removal of those
timers when the event is removed and more efficient searching for a
timer within the smaller list of timers per event name.

Change-Id: I4624918d3a3bbe2a5224cde4bc3fc529e5b40df3
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/zone.hpp b/control/zone.hpp
index e28e02b..e48a981 100644
--- a/control/zone.hpp
+++ b/control/zone.hpp
@@ -440,35 +440,29 @@
          *
          * @param[in] eventGroup - Group associated with a timer
          * @param[in] eventActions - List of actions associated with a timer
+         * @param[in] eventTimers - List of timers to find the timer in
          *
          * @return - Iterator to the timer event
          */
         std::vector<TimerEvent>::iterator findTimer(
                 const Group& eventGroup,
-                const std::vector<Action>& eventActions);
+                const std::vector<Action>& eventActions,
+                std::vector<TimerEvent>& eventTimers);
 
         /**
          * @brief Add a timer to the list of timer based events
          *
+         * @param[in] name - Event name associated with timer
          * @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
          */
-        void addTimer(const Group& group,
+        void addTimer(const std::string& name,
+                      const Group& group,
                       const std::vector<Action>& actions,
                       const TimerConf& tConf);
 
         /**
-         * @brief Remove the given timer event
-         *
-         * @param[in] teIter - Iterator pointing to the timer event to remove
-         */
-        inline void removeTimer(std::vector<TimerEvent>::iterator& teIter)
-        {
-            _timerEvents.erase(teIter);
-        }
-
-        /**
          * @brief Callback function for event timers that processes the given
          * actions for a group
          *
@@ -775,9 +769,9 @@
         std::map<std::string, std::vector<SignalEvent>> _signalEvents;
 
         /**
-         * @brief List of timers for events
+         * @brief List of timers per event name
          */
-        std::vector<TimerEvent> _timerEvents;
+        std::map<std::string, std::vector<TimerEvent>> _timerEvents;
 
         /**
          * @brief Save the thermal control current mode property