From fccdc39fdf8f97ef4bf3de3b8ddcae28fef4bc8e Mon Sep 17 00:00:00 2001 From: Brad Bishop Date: Mon, 22 May 2017 21:11:09 -0400 Subject: 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 Change-Id: I20130a11c19ddcf2c4ae45800f2068b31950bcd6 --- src/propertywatchimpl.hpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/propertywatchimpl.hpp') 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 #include #include +#include "callback.hpp" #include "data_types.hpp" #include "propertywatch.hpp" @@ -141,6 +142,12 @@ void PropertyWatchOfType::propertiesChanged( } std::get<2>(item->second).get() = p.second.template get(); + + // Invoke callback if present. + if (this->alreadyRan && this->callback) + { + (*this->callback)(); + } } } -- cgit v1.2.1