summaryrefslogtreecommitdiff
path: root/project2/iHaveParameters.cpp
blob: 0f1084e9d2c6ef449b011cfc3b7a5341b5b9706a (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
#include "iHaveParameters.h"
#include "xmlObjectLoader.h"
#include <boost/foreach.hpp>

IHaveParameters::IHaveParameters(const xmlpp::Element * p)
{
	xmlpp::NodeSet ps = p->find("parameters");
	Loaders loaders;
	loaders.insert(LoadersVT("param",
			_LoaderBase::Make<_Parameter, _Parameter, unsigned int, _Parameter, &_Parameter::bind>(&parameters)));
	BOOST_FOREACH(xmlpp::Node * psi, ps) {
		_LoaderBase::collectAll(loaders, "", dynamic_cast<const xmlpp::Element *>(psi), false, true);
	}
}

IHaveParameters::~IHaveParameters()
{
}

IHaveParameters::_Parameter::_Parameter(const xmlpp::Element * p) :
	value(p->get_attribute("value")),
	bind(atoi(p->get_attribute_value("bind").c_str()))
{
}