Added a prefix data in eoParser - and the setPrefix method -
for multi-population parameter input. Now you can call the make_xxx functions from teh src/do directory several times for different populations provided you do different calls to setPrefix inbetween
This commit is contained in:
parent
fe9de42802
commit
87ddb6f8b5
2 changed files with 18 additions and 2 deletions
|
|
@ -125,7 +125,7 @@ eoParam* eoParser::getParamWithLongName(std::string _name)
|
|||
typedef MultiMapType::const_iterator It;
|
||||
for (It p = params.begin(); p != params.end(); ++p)
|
||||
{
|
||||
if (p->second->longName() == _name)
|
||||
if (p->second->longName() == prefix+_name)
|
||||
return p->second;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -161,6 +161,13 @@ eoValueParam<ValueType>& eoParser::getORcreateParam (
|
|||
|
||||
void eoParser::processParam(eoParam& param, std::string section)
|
||||
{
|
||||
// this param enters the parser: add the prefix to the long name
|
||||
if (prefix != "")
|
||||
{
|
||||
param.setLongName(prefix+param.longName());
|
||||
section = prefix + section; // and to section
|
||||
}
|
||||
|
||||
doRegisterParam(param); // plainly register it
|
||||
params.insert(make_pair(section, ¶m));
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue