diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-06-06 23:58:09 -0400 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-06-19 16:28:06 -0400 |
commit | ce4fbe111da9375e9614e018547e90092df6ec4b (patch) | |
tree | dd81218e07476a9affd8adcf64bc66167b637f87 /src/watch.hpp | |
parent | 18b228ee24bc6446292785cd1821d417a7c6a0c8 (diff) | |
download | phosphor-dbus-monitor-ce4fbe111da9375e9614e018547e90092df6ec4b.tar.gz phosphor-dbus-monitor-ce4fbe111da9375e9614e018547e90092df6ec4b.zip |
expose watch callbacks
Allow watch class users to explicitly invoke the watch
callback.
Since watches and callbacks share a common pool of state
all watches must complete their initialization prior to
invoking their callback methods.
Change-Id: I62ebad64da88a145f3d5006b07c01381b0eb6728
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'src/watch.hpp')
-rw-r--r-- | src/watch.hpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/watch.hpp b/src/watch.hpp index 1ba671d..e36af9c 100644 --- a/src/watch.hpp +++ b/src/watch.hpp @@ -15,7 +15,10 @@ namespace monitoring * or initialization. Typical implementations might register dbus * callbacks or perform queries. * - * Watches of any type can be started. + * The callback method is invoked by main() on all watches of any + * type at application startup, after all watches have performed + * their setup. Typical implementations will forward the call + * to their associated callback. */ class Watch { @@ -29,6 +32,10 @@ class Watch /** @brief Start the watch. */ virtual void start() = 0; + + /** @brief Invoke the callback associated with the watch. */ + virtual void callback() = 0; + }; } // namespace monitoring |