summaryrefslogtreecommitdiff
path: root/project2/checkHost.cpp
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2011-07-14 19:50:11 +0000
committerrandomdan <randomdan@localhost>2011-07-14 19:50:11 +0000
commitd2f60795927647c09acbeceb32efb8a29314c340 (patch)
tree5dc1f6f9b8331a17e67863c847ea63ca97f5d92c /project2/checkHost.cpp
parentFix unused_result warning when compiled with optimization enabled (diff)
downloadproject2-d2f60795927647c09acbeceb32efb8a29314c340.tar.bz2
project2-d2f60795927647c09acbeceb32efb8a29314c340.tar.xz
project2-d2f60795927647c09acbeceb32efb8a29314c340.zip
All new dynamic transformations and processing and tidyup and stuff
Diffstat (limited to 'project2/checkHost.cpp')
-rw-r--r--project2/checkHost.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/project2/checkHost.cpp b/project2/checkHost.cpp
new file mode 100644
index 0000000..05e7d58
--- /dev/null
+++ b/project2/checkHost.cpp
@@ -0,0 +1,39 @@
+#include "checkHost.h"
+#include "appEngine.h"
+#include <boost/foreach.hpp>
+
+CheckHost::CheckHost(const std::string & group, const std::string & name) :
+ XmlScriptParser(group, name, false)
+{
+ loader.supportedStorers.insert(Storer::into(&parameterChecks));
+}
+
+CheckHost::CheckHost(const std::string & file) :
+ XmlScriptParser(file, false)
+{
+ loader.supportedStorers.insert(Storer::into(&parameterChecks));
+}
+
+CheckHost::~CheckHost()
+{
+}
+
+void
+CheckHost::runChecks() const
+{
+ BOOST_FOREACH(const ParamCheckers::value_type & pc, parameterChecks) {
+ if (!pc->performCheck()) {
+ ApplicationEngine::getCurrent()->logMessage(false, pc->group(), pc->message());
+ throw CheckFailure(pc);
+ }
+ }
+}
+
+CheckHost::CheckFailure::CheckFailure(ParamCheckerCPtr fc) : failedCheck(fc)
+{
+}
+
+CheckHost::CheckFailure::~CheckFailure() throw()
+{
+}
+