path: root/src/count.hpp
Commit message (Collapse)AuthorAgeFilesLines
* Add constants for tuple fieldsMatt Spinler2018-02-271-4/+5
| | | | | | | | | Add constants for use with std::get. Tested: Run unit tests Change-Id: Ic09c13feeda69d61c98f63d227cae8f08d1bf50e Signed-off-by: Matt Spinler <>
* count: Add missing functional includeBrad Bishop2018-02-271-0/+1
| | | | | | | | std::function is not found with a GCC 7.3 runtime. Change-Id: I4e5289794d405c42ab6291c211289d1ab175b197 Tested: Built repository with GCC 7.3 Signed-off-by: Brad Bishop <>
* Save property check results in CountConditionMatt Spinler2018-02-231-1/+7
| | | | | | | | | | | | 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 <>
* Extend storage array to contain additional dataMatt Spinler2018-02-231-2/+2
| | | | | | | | | | | | | | | | | | | 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 <>
* Add oneshot support to count conditionsMatt Spinler2018-02-231-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | When a count condition is a oneshot, it will only trigger the callback the first time the condition is true. The condition needs to evaluate to false at least once to rearm the callback. A use case for this would be when a group of properties is being watched for a subset of them hit a certain value. Even though every properties changed signal for every property in the group would check the condition, only the first time the condition is true would the callback be issued. This behavior is specified with a 'oneshot: true' entry in the YAML. If not present, it defaults to false which is the original behavior. Tested: Verify this does indeed do what is advertised by modifying condition rules to consistently pass and checking behavior. Change-Id: Ie185621e86c605234bf329a5f38317267dbb6fb6 Signed-off-by: Matt Spinler <>
* Include missing header fileRatan Gupta2018-02-201-0/+2
| | | | | | | | we are using the std algo's in this file but missed to include the c++ algorithm header file. Change-Id: Ib88f810a048dba18526b7c7cf42d87ba095a27be Signed-off-by: Ratan Gupta <>
* Add conditional callbacksBrad Bishop2017-06-191-0/+82
Enable conditional application of callbacks. Change-Id: I9d765e5f585aac40994b65da3b51ea891beae9bf Signed-off-by: Brad Bishop <>
OpenPOWER on IntegriCloud