summaryrefslogtreecommitdiff
path: root/project2/common/checkHost.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'project2/common/checkHost.cpp')
-rw-r--r--project2/common/checkHost.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/project2/common/checkHost.cpp b/project2/common/checkHost.cpp
new file mode 100644
index 0000000..a39c176
--- /dev/null
+++ b/project2/common/checkHost.cpp
@@ -0,0 +1,34 @@
+#include "checkHost.h"
+#include "appEngine.h"
+#include <boost/foreach.hpp>
+
+CheckHost::CheckHost(const boost::filesystem::path & file) :
+ XmlScriptParser(file, false)
+{
+ loader.supportedStorers.insert(Storer::into(&parameterChecks));
+}
+
+CheckHost::~CheckHost()
+{
+}
+
+void
+CheckHost::runChecks() const
+{
+ parseDocument();
+ 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()
+{
+}
+