diff options
author | Matt Spinler <spinler@us.ibm.com> | 2018-02-19 13:34:43 -0600 |
---|---|---|
committer | Matt Spinler <spinler@us.ibm.com> | 2018-02-23 13:51:48 -0600 |
commit | abe43ab439bba463f4727a98ed0cc0c6a5e8251f (patch) | |
tree | 84416bf5d4d38ce4d7ced993596e5b661e3e38da /src/count.hpp | |
parent | c458deea83b4356f07194691e301037d8e831d46 (diff) | |
download | phosphor-dbus-monitor-abe43ab439bba463f4727a98ed0cc0c6a5e8251f.tar.gz phosphor-dbus-monitor-abe43ab439bba463f4727a98ed0cc0c6a5e8251f.zip |
Extend storage array to contain additional data
This array was originally just an array of objects of
type 'any'. This commit changes it to be an array of
tuples of type <any, any> to add an extra field for
use by anything that needs it.
For example, the storage is currently used to store
property values, and a future change to the CountCondition
class will now also store the result of the comparisons done
between the property values and another value specified in
the rule YAML. Then, a callback will be able to see the
result of whether each property passed the check.
Tested: Build and run unit tests
Change-Id: I58f32c9f4068b15a02b1ff7f28871161cafebddb
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Diffstat (limited to 'src/count.hpp')
-rw-r--r-- | src/count.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/count.hpp b/src/count.hpp index 51a76eb..0ac6420 100644 --- a/src/count.hpp +++ b/src/count.hpp @@ -64,12 +64,12 @@ class CountCondition : public IndexedConditional const auto& storage = std::get<2>( item.second); // Don't count properties that don't exist. - if (storage.get().empty()) + if (std::get<0>(storage.get()).empty()) { return false; } const auto& value = any_ns::any_cast<T>( - storage); + std::get<0>(storage.get())); return propertyOp(value); }); // *INDENT-ON* |