Enable multiple filters
Add support for specifying multiple filters for a given event.
All filters must evaluate true to trigger the associated action.
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Change-Id: I86d3e98e5c9e23b65e2e9733c817b38d2ab59465
diff --git a/pimgen.py b/pimgen.py
index 5e2cf00..a7d2a2e 100755
--- a/pimgen.py
+++ b/pimgen.py
@@ -314,6 +314,9 @@
filters = [
self.filter_map[x['name']](**x) for x in kw.pop('filters', [])]
+ filters = Vector(
+ templates=[Template(name='FilterBasePtr', namespace=['details'])],
+ args=filters)
event = MethodCall(
name='make_shared',
@@ -321,7 +324,7 @@
templates=[Template(
name=kw.pop('event'),
namespace=kw.pop('event_namespace', []))],
- args=kw.pop('event_args', []) + [filters[0]])
+ args=kw.pop('event_args', []) + [filters])
events = Vector(
templates=[Template(name='EventBasePtr', namespace=['details'])],