summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2018-02-19 13:52:59 -0600
committerMatt Spinler <spinler@us.ibm.com>2018-02-23 13:51:48 -0600
commit05a2ac3a9c9f794be8b6cea81a1d46283162b7d3 (patch)
tree4c3078f146f17e5decf07a489bbd64e37639a053
parentabe43ab439bba463f4727a98ed0cc0c6a5e8251f (diff)
downloadphosphor-dbus-monitor-05a2ac3a9c9f794be8b6cea81a1d46283162b7d3.zip
phosphor-dbus-monitor-05a2ac3a9c9f794be8b6cea81a1d46283162b7d3.tar.gz
Save property check results in CountCondition
The CountCondition class checks each property in its index against some condition. Save the result of each of those checks in the 2nd tuple element of the storage entry for that property so that other code may access it. Tested: Build and run unit tests Change-Id: Ie99f02062c28d003e588a43bf042ecd2834ad9b2 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
-rw-r--r--src/count.hpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/count.hpp b/src/count.hpp
index 0ac6420..bde8a91 100644
--- a/src/count.hpp
+++ b/src/count.hpp
@@ -61,6 +61,8 @@ class CountCondition : public IndexedConditional
[this](const auto & item)
// *INDENT-OFF*
{
+ //Get the property value from storage[0],
+ //and save the op result in storage[1].
const auto& storage = std::get<2>(
item.second);
// Don't count properties that don't exist.
@@ -70,7 +72,11 @@ class CountCondition : public IndexedConditional
}
const auto& value = any_ns::any_cast<T>(
std::get<0>(storage.get()));
- return propertyOp(value);
+ auto r = propertyOp(value);
+
+ std::get<1>(storage.get()) = r;
+
+ return r;
});
// *INDENT-ON*
OpenPOWER on IntegriCloud