Add callback contexts
Add the notion of a callback context. This enables callbacks
to have logic around the conditions they were invoked in.
There are two context on which call back can be invoked
1) Startup: during startup all the call backs will be called
2) Signal: As part of condition match on the watched properties.
Callback would behave differently based on the context.
eg: eventCallback
1) Startup: Don't take any action.
2) Signal: Create the Dbus Object for the event.
Change-Id: If455558798ac3e44bbd8a93de0ce1b09d2e308ae
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
diff --git a/src/watch.hpp b/src/watch.hpp
index e36af9c..d420458 100644
--- a/src/watch.hpp
+++ b/src/watch.hpp
@@ -1,5 +1,7 @@
#pragma once
+#include "data_types.hpp"
+
namespace phosphor
{
namespace dbus
@@ -34,7 +36,7 @@
virtual void start() = 0;
/** @brief Invoke the callback associated with the watch. */
- virtual void callback() = 0;
+ virtual void callback(Context ctx) = 0;
};