summaryrefslogtreecommitdiff
path: root/project2/checkHost.cpp
blob: 05e7d588fb7f2470063aa77fe09691212b67324f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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()
{
}