From 05b8ac63e15fd488f65ff8f23135e8e3afae32bc Mon Sep 17 00:00:00 2001 From: randomdan Date: Sat, 17 Mar 2012 23:52:05 +0000 Subject: RowProcessor level record filtering --- project2/common/rowProcessor.cpp | 6 +++++- project2/common/rowProcessor.h | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/project2/common/rowProcessor.cpp b/project2/common/rowProcessor.cpp index e2ce6ba..a52efc5 100644 --- a/project2/common/rowProcessor.cpp +++ b/project2/common/rowProcessor.cpp @@ -4,6 +4,7 @@ #include "commonObjects.h" #include "scopeObject.h" #include +#include RowProcessor::RowProcessor(ScriptNodePtr p) : IHaveParameters(p), @@ -13,6 +14,7 @@ RowProcessor::RowProcessor(ScriptNodePtr p) : IRSE(p->value("ignoreRowSourceError", false)) { p->script->loader.addLoadTarget(p, Storer::into(&caches)); + p->script->loader.addLoadTarget(p, Storer::into(&tests)); } void @@ -78,6 +80,8 @@ RowProcessor::rowReadyInternal(const RowState * rs) const rs->foreachAttr(boost::bind(&RowSetPresenter::addAttribute, c->get<0>(), _1, _2)); c->get<0>()->finishRow(); } - rowReady(rs); + if (boost::algorithm::all(tests, boost::bind(&Test::passes, _1))) { + rowReady(rs); + } } diff --git a/project2/common/rowProcessor.h b/project2/common/rowProcessor.h index cee9e41..cbbf6c3 100644 --- a/project2/common/rowProcessor.h +++ b/project2/common/rowProcessor.h @@ -6,6 +6,7 @@ #include "iHaveParameters.h" #include "rowSet.h" #include "cache.h" +#include "test.h" #include "scriptStorage.h" class Presenter; @@ -29,6 +30,8 @@ class RowProcessor : public IHaveParameters { friend class RowState; void rowReadyInternal(const RowState *) const; virtual void rowReady(const RowState *) const = 0; + typedef ANONSTORAGEOF(Test) Tests; + Tests tests; typedef ANONORDEREDSTORAGEOF(Cache) Caches; Caches caches; typedef boost::tuple TargetCache; -- cgit v1.2.3