summaryrefslogtreecommitdiffstats
path: root/src/propertywatchimpl.hpp
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2017-05-22 21:11:09 -0400
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2017-06-19 16:26:48 -0400
commitfccdc39fdf8f97ef4bf3de3b8ddcae28fef4bc8e (patch)
tree734c68fb96a00f64783f846e5a22eda1138ffe21 /src/propertywatchimpl.hpp
parentb97bfff73e44e53571f8a00b80ec947496930d7b (diff)
downloadphosphor-dbus-monitor-fccdc39fdf8f97ef4bf3de3b8ddcae28fef4bc8e.tar.gz
phosphor-dbus-monitor-fccdc39fdf8f97ef4bf3de3b8ddcae28fef4bc8e.zip
Link watches to callbacks
Callbacks must ultimately be triggered when a property is updated by a watch. Add that support. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I20130a11c19ddcf2c4ae45800f2068b31950bcd6
Diffstat (limited to 'src/propertywatchimpl.hpp')
-rw-r--r--src/propertywatchimpl.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/propertywatchimpl.hpp b/src/propertywatchimpl.hpp
index 6e957ae..d0153e4 100644
--- a/src/propertywatchimpl.hpp
+++ b/src/propertywatchimpl.hpp
@@ -3,6 +3,7 @@
#include <sdbusplus/message.hpp>
#include <sdbusplus/bus/match.hpp>
#include <vector>
+#include "callback.hpp"
#include "data_types.hpp"
#include "propertywatch.hpp"
@@ -141,6 +142,12 @@ void PropertyWatchOfType<T, DBusInterfaceType>::propertiesChanged(
}
std::get<2>(item->second).get() = p.second.template get<T>();
+
+ // Invoke callback if present.
+ if (this->alreadyRan && this->callback)
+ {
+ (*this->callback)();
+ }
}
}
OpenPOWER on IntegriCloud