summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2012-03-17 23:52:05 +0000
committerrandomdan <randomdan@localhost>2012-03-17 23:52:05 +0000
commit424010de0ad08d60c525ac9b3d9342e4c94296b7 (patch)
tree862566914b8460b852caf015b43e7472bfa926d0
parentFix bug with SqlMerge without an updatewhere clause (diff)
downloadproject2-424010de0ad08d60c525ac9b3d9342e4c94296b7.tar.bz2
project2-424010de0ad08d60c525ac9b3d9342e4c94296b7.tar.xz
project2-424010de0ad08d60c525ac9b3d9342e4c94296b7.zip
RowProcessor level record filtering
-rw-r--r--project2/common/rowProcessor.cpp6
-rw-r--r--project2/common/rowProcessor.h3
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;