diff options
| author | randomdan <randomdan@localhost> | 2011-08-31 21:48:04 +0000 |
|---|---|---|
| committer | randomdan <randomdan@localhost> | 2011-08-31 21:48:04 +0000 |
| commit | c6375740de642a3c954fe19614fbe55e1c8d2c9c (patch) | |
| tree | 77abf662b898321a61058fb0a0da603e336bcad9 /project2/common/if.h | |
| parent | Adds RDBMS table caching solution (diff) | |
| download | project2-c6375740de642a3c954fe19614fbe55e1c8d2c9c.tar.bz2 project2-c6375740de642a3c954fe19614fbe55e1c8d2c9c.tar.xz project2-c6375740de642a3c954fe19614fbe55e1c8d2c9c.zip | |
The big reshuffle
Diffstat (limited to 'project2/common/if.h')
| -rw-r--r-- | project2/common/if.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/project2/common/if.h b/project2/common/if.h new file mode 100644 index 0000000..b33bca1 --- /dev/null +++ b/project2/common/if.h @@ -0,0 +1,38 @@ +#ifndef IF_H +#define IF_H + +#include "iHaveSubTasks.h" +#include "view.h" +#include "paramChecker.h" + +class IfSet : public virtual IntrusivePtrBase { + public: + IfSet(const xmlpp::Element *); + bool passes() const; + + private: + virtual const std::string & getName() const = 0; + enum Mode { And, Or }; + Mode mode; + typedef ANONORDEREDSTORAGEOF(ParamChecker) ParamCheckers; + ParamCheckers checks; +}; + +/// Project2 component to conditionally execute its children +class If : public IHaveSubTasks, public View, public IfSet { + public: + If(const xmlpp::Element *); + + virtual void loadComplete(const CommonObjects*); + virtual void execute(const Presenter*) const; + virtual void execute() const; + + private: + typedef ANONSTORAGEOF(View) SubViews; + SubViews subViews; + + const std::string & getName() const; +}; + +#endif + |
