summaryrefslogtreecommitdiff
path: root/project2/checkHost.cpp
blob: a39c1768e4812eb4085df3a84532807718f187d3 (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
#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()
{
}