summaryrefslogtreecommitdiff
path: root/project2/iHaveParameters.cpp
blob: c13eddf4c70f511cd21e522164882803824654f3 (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
#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) :
	source(p->get_attribute_value("source")),
	id(p->get_attribute_value("id")),
	bind(atoi(p->get_attribute_value("bind").c_str()))
{
}