Call systemd target on timer expiration

User can pass an optional command line argument stating which
systemd target needs to be called on timer expiration. The timeout
handler will make sure that the systemd target is started prior to
exiting.

Change-Id: I37213ab28ad4166a47920dcb3dc79769c7f2af1a
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
diff --git a/watchdog.hpp b/watchdog.hpp
index 1a7a410..79df438 100644
--- a/watchdog.hpp
+++ b/watchdog.hpp
@@ -29,15 +29,18 @@
 
         /** @brief Constructs the Watchdog object
          *
-         *  @param[in] bus     - DBus bus to attach to
-         *  @param[in] objPath - Object path to attach to
+         *  @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
          */
         Watchdog(sdbusplus::bus::bus& bus,
                 const char* objPath,
-                EventPtr& event) :
+                EventPtr& event,
+                std::string&& target = std::string()) :
             WatchdogInherits(bus, objPath),
             bus(bus),
+            target(std::move(target)),
             timer(event, std::bind(&Watchdog::timeOutHandler, this))
         {
             // Nothing
@@ -83,6 +86,9 @@
         /** @brief sdbusplus handle */
         sdbusplus::bus::bus& bus;
 
+        /** @brief Systemd unit to be started when the timer expires */
+        std::string target;
+
         /** @brief Contained timer object */
         Timer timer;