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/event.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/event.hpp')
-rw-r--r-- | src/event.hpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/event.hpp b/src/event.hpp index ad02986..b5f1e90 100644 --- a/src/event.hpp +++ b/src/event.hpp @@ -46,10 +46,11 @@ class EventBase : public IndexedCallback for (const auto& n : index) { const auto& path = std::get<pathIndex>(n.first); - const auto& propertyMeta = std::get<propertyIndex>(n.first); - const auto& value = std::get<valueIndex>(n.second); + const auto& propertyMeta = std::get<metaIndex>(n.first); + const auto& storage = std::get<storageIndex>(n.second); + const auto& value = std::get<valueIndex>(storage.get()); - if (!value.get().empty()) + if (!value.empty()) { createEvent( path, |