watchdog: Support multiple timeout actions

This change adds the infrastructure to support having different actions
map to different systemd targets being started when the watchdog
expires. Right now this maintains compatability with the current
--target argument and populates all of the watchdog actions, except for
None, with the same target. A follow up patch will implement setting
independent targets for each action.

Change-Id: I0f0601f9e94d488650f20a9cebfc7c967007d78c
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/watchdog.hpp b/watchdog.hpp
index f9657ac..757029c 100644
--- a/watchdog.hpp
+++ b/watchdog.hpp
@@ -27,20 +27,25 @@
         Watchdog(Watchdog&&) = delete;
         Watchdog& operator=(Watchdog &&) = delete;
 
+        /** @brief Type used to hold the name of a systemd target.
+         */
+        using TargetName = std::string;
+
         /** @brief Constructs the Watchdog object
          *
-         *  @param[in] bus     - DBus bus to attach to.
-         *  @param[in] objPath - Object path to attach to.
-         *  @param[in] event   - reference to sd_event unique pointer
-         *  @param[in] target  - systemd target to be called into on timeout
+         *  @param[in] bus            - DBus bus to attach to.
+         *  @param[in] objPath        - Object path to attach to.
+         *  @param[in] event          - reference to sd_event unique pointer
+         *  @param[in] actionTargets  - map of systemd targets called on timeout
          */
         Watchdog(sdbusplus::bus::bus& bus,
                 const char* objPath,
                 EventPtr& event,
-                std::string&& target = std::string()) :
+                std::map<Action, TargetName>&& actionTargets =
+                    std::map<Action, TargetName>()) :
             WatchdogInherits(bus, objPath),
             bus(bus),
-            target(std::move(target)),
+            actionTargets(std::move(actionTargets)),
             timer(event, std::bind(&Watchdog::timeOutHandler, this))
         {
             // Nothing
@@ -92,8 +97,8 @@
         /** @brief sdbusplus handle */
         sdbusplus::bus::bus& bus;
 
-        /** @brief Systemd unit to be started when the timer expires */
-        std::string target;
+        /** @brief Map of systemd units to be started when the timer expires */
+        std::map<Action, TargetName> actionTargets;
 
         /** @brief Contained timer object */
         Timer timer;