diff options
author | Ratan Gupta <ratagupt@in.ibm.com> | 2018-02-21 19:03:13 +0530 |
---|---|---|
committer | Ratan Gupta <ratagupt@in.ibm.com> | 2018-02-22 21:05:19 +0530 |
commit | a45e086dc57f51efb882bf864e78fe678238deea (patch) | |
tree | 47099446e3b5f83528435a46af0efc90dd395d2a /src/method.hpp | |
parent | 882d741c2392e2c37c2fbdaf1207e64ea6dc91a7 (diff) | |
download | phosphor-dbus-monitor-a45e086dc57f51efb882bf864e78fe678238deea.tar.gz phosphor-dbus-monitor-a45e086dc57f51efb882bf864e78fe678238deea.zip |
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>
Diffstat (limited to 'src/method.hpp')
-rw-r--r-- | src/method.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/method.hpp b/src/method.hpp index 66c19db..9475fb8 100644 --- a/src/method.hpp +++ b/src/method.hpp @@ -65,7 +65,7 @@ class MethodBase : public Callback method(m) {} /** @brief Callback interface implementation. */ - void operator()() override = 0; + void operator()(Context ctx) override = 0; protected: const std::string& bus; @@ -100,7 +100,7 @@ class Method : public MethodBase args(std::forward<MethodArgs>(arguments)...) {} /** @brief Callback interface implementation. */ - void operator()() override + void operator()(Context ctx) override { std::experimental::apply( detail::CallDBusMethod<DBusInterface, MethodArgs...>::op, |