path: root/src/templates
diff options
authorMatt Spinler <>2018-02-19 13:09:10 -0600
committerMatt Spinler <>2018-02-23 13:51:02 -0600
commitc458deea83b4356f07194691e301037d8e831d46 (patch)
treea01904097309523a576612c33cdc2c3a17a69095 /src/templates
parent8bbf9d2cc5a502fa0df0e70bd4232208a1ab6c01 (diff)
Add oneshot support to count conditions
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 <>
Diffstat (limited to 'src/templates')
1 files changed, 2 insertions, 1 deletions
diff --git a/src/templates/count.mako.cpp b/src/templates/count.mako.cpp
index 9ac9c3c..f4b4c8f 100644
--- a/src/templates/count.mako.cpp
+++ b/src/templates/count.mako.cpp
@@ -1,4 +1,5 @@
${indent(1)}[](const auto& item){return item ${c.countop} ${c.countbound};},
-${indent(1)}[](const auto& item){return item ${c.op} ${c.bound.argument(loader, indent=indent +1)};})\
+${indent(1)}[](const auto& item){return item ${c.op} ${c.bound.argument(loader, indent=indent +1)};},
+${indent(1)}${c.oneshot.argument(loader, indent=indent +1)})\
OpenPOWER on IntegriCloud