summaryrefslogtreecommitdiff
path: root/project2/common/if.h
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2011-12-20 00:30:20 +0000
committerrandomdan <randomdan@localhost>2011-12-20 00:30:20 +0000
commit31b8a0fc5616d9c2f27e49e1c706a59c90d15a45 (patch)
treebd4191cdd1a2c84635c3c8a7d50fd2fd3723ffd6 /project2/common/if.h
parentImproved connection failure logging and instantiation (diff)
downloadproject2-31b8a0fc5616d9c2f27e49e1c706a59c90d15a45.tar.bz2
project2-31b8a0fc5616d9c2f27e49e1c706a59c90d15a45.tar.xz
project2-31b8a0fc5616d9c2f27e49e1c706a59c90d15a45.zip
Split check and test functionality... if and check now take tests as children, adds all, any, none and not as building blocks
Diffstat (limited to 'project2/common/if.h')
-rw-r--r--project2/common/if.h22
1 files changed, 9 insertions, 13 deletions
diff --git a/project2/common/if.h b/project2/common/if.h
index e27003d..bcf83cd 100644
--- a/project2/common/if.h
+++ b/project2/common/if.h
@@ -3,24 +3,19 @@
#include "iHaveSubTasks.h"
#include "view.h"
-#include "paramChecker.h"
+#include "test.h"
-class IfSet : public virtual IntrusivePtrBase {
+class CompoundTest : public Test {
public:
- IfSet(ScriptNodePtr);
- bool passes() const;
+ CompoundTest(ScriptNodePtr);
- private:
- virtual const std::string & getName() const = 0;
- enum Mode { And, Or };
- Mode mode;
- typedef ANONORDEREDSTORAGEOF(ParamChecker) ParamCheckers;
protected:
- ParamCheckers checks;
+ typedef ANONORDEREDSTORAGEOF(Test) Tests;
+ Tests tests;
};
/// Project2 component to conditionally execute its children
-class If : public IHaveSubTasks, public View, public IfSet {
+class If : public IHaveSubTasks, public View {
public:
If(ScriptNodePtr);
@@ -28,10 +23,11 @@ class If : public IHaveSubTasks, public View, public IfSet {
virtual void execute() const;
private:
+ bool passes() const;
+
typedef ANONSTORAGEOF(View) SubViews;
SubViews subViews;
-
- const std::string & getName() const;
+ TestPtr test;
};
#endif