summaryrefslogtreecommitdiffstats
path: root/src/propertywatch.hpp
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2017-06-06 23:58:09 -0400
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2017-06-19 16:28:06 -0400
commitce4fbe111da9375e9614e018547e90092df6ec4b (patch)
treedd81218e07476a9affd8adcf64bc66167b637f87 /src/propertywatch.hpp
parent18b228ee24bc6446292785cd1821d417a7c6a0c8 (diff)
downloadphosphor-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/propertywatch.hpp')
-rw-r--r--src/propertywatch.hpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/propertywatch.hpp b/src/propertywatch.hpp
index 3eb05df..55f6e5b 100644
--- a/src/propertywatch.hpp
+++ b/src/propertywatch.hpp
@@ -37,8 +37,8 @@ class PropertyWatch : public Watch
virtual ~PropertyWatch() = default;
PropertyWatch(
const PropertyIndex& watchIndex,
- Callback* cb = nullptr)
- : Watch(), index(watchIndex), callback(cb), alreadyRan(false) {}
+ Callback* callback = nullptr)
+ : Watch(), index(watchIndex), cb(callback), alreadyRan(false) {}
/** @brief Start the watch.
*
@@ -46,6 +46,12 @@ class PropertyWatch : public Watch
*/
void start() override;
+ /** @brief Run the watch callback method.
+ *
+ * Watch callback interface implementation for PropertyWatch.
+ */
+ void callback() override;
+
/** @brief Update properties.
*
* Subclasses to query the properties specified by the index
@@ -89,7 +95,7 @@ class PropertyWatch : public Watch
const PropertyIndex& index;
/** @brief Optional callback method. */
- Callback* const callback;
+ Callback* const cb;
/** @brief The start method should only be invoked once. */
bool alreadyRan;
OpenPOWER on IntegriCloud