Support custom callback function on timer expiration

Change-Id: I39b32d608ef342d63c57cbc1902e927fb39861c7
Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
diff --git a/softoff/timer.hpp b/softoff/timer.hpp
index 9d597f8..cbd3444 100644
--- a/softoff/timer.hpp
+++ b/softoff/timer.hpp
@@ -1,5 +1,6 @@
 #pragma once
 
+#include <functional>
 #include <systemd/sd-event.h>
 namespace phosphor
 {
@@ -22,9 +23,12 @@
         /** @brief Constructs timer object
          *
          *  @param[in] events - sd_event pointer
+         *  @param[in] funcCallBack - optional function callback for timer
+         *                            expirations
          */
-        Timer(sd_event* events)
-            : timeEvent(events)
+        Timer(sd_event* events,
+              std::function<void()> userCallBack = nullptr)
+            : timeEvent(events), userCallBack(userCallBack)
         {
             // Initialize the timer
             initialize();
@@ -87,6 +91,9 @@
 
         /** @brief Gets the current time from steady clock */
         static std::chrono::microseconds getTime();
+
+        /** @brief Optional function to call on timer expiration */
+        std::function<void()> userCallBack;
 };
 
 } // namespace ipmi