diff options
author | randomdan <randomdan@localhost> | 2012-03-17 23:52:05 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2012-03-17 23:52:05 +0000 |
commit | 05b8ac63e15fd488f65ff8f23135e8e3afae32bc (patch) | |
tree | 862566914b8460b852caf015b43e7472bfa926d0 | |
parent | Fix bug with SqlMerge without an updatewhere clause (diff) | |
download | project2-05b8ac63e15fd488f65ff8f23135e8e3afae32bc.tar.bz2 project2-05b8ac63e15fd488f65ff8f23135e8e3afae32bc.tar.xz project2-05b8ac63e15fd488f65ff8f23135e8e3afae32bc.zip |
RowProcessor level record filtering
-rw-r--r-- | project2/common/rowProcessor.cpp | 6 | ||||
-rw-r--r-- | project2/common/rowProcessor.h | 3 |
2 files changed, 8 insertions, 1 deletions
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 <boost/foreach.hpp> +#include <boost/algorithm/string/predicate.hpp> 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<ElementLoader>(&caches)); + p->script->loader.addLoadTarget(p, Storer::into<ElementLoader>(&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<RowSetPresenterPtr, CachePtr> TargetCache; |