43 void Module::swap(
const Module &mod)
47 strName = mod.strName;
48 arguments = mod.arguments;
49 strVersion = mod.strVersion;
50 strDescription = mod.strDescription;
51 strHost = mod.strHost;
52 bForced = mod.bForced;
53 authors = mod.authors;
54 outputs = mod.outputs;
56 strXmlFile = mod.strXmlFile;
57 strParam = mod.strParam;
58 strWorkDir = mod.strWorkDir;
59 strStdio = mod.strStdio;
60 strBroker = mod.strBroker;
61 bNeedDeployer = mod.bNeedDeployer;
62 strPrefix = mod.strPrefix;
63 strEnvironment = mod.strEnvironment;
64 strBasePrefix = mod.strBasePrefix;
65 strDisplay = mod.strDisplay;
66 modOwner = mod.modOwner;
67 waitStart = mod.waitStart;
68 waitStop = mod.waitStop;
80 auto* mod =
new Module(*
this);
87 arguments.push_back(argument);
94 auto itr = findArgument(argument);
95 if(itr == arguments.end())
105 outputs.push_back(output);
114 auto itr = findOutput(output);
115 if(itr == outputs.end())
125 inputs.push_back(input);
134 auto itr = findInput(input);
135 if(itr == inputs.end())
145 newres->setOwner(
this);
146 resources.push_back(newres);
153 auto itr = findResource(res);
154 if(itr == resources.end())
156 resources.erase(itr);
164 for(itr=authors.begin(); itr<authors.end(); itr++)
177 for(itr=arguments.begin(); itr<arguments.end(); itr++)
178 if ((*itr) == argument)
180 return arguments.end();
187 for(itr=inputs.begin(); itr<inputs.end(); itr++)
197 for(itr=outputs.begin(); itr<outputs.end(); itr++)
198 if ((*itr) == output)
200 return outputs.end();
206 for(itr=resources.begin(); itr<resources.end(); itr++)
209 return resources.end();
219 strDescription.clear();
222 bNeedDeployer =
false;
232 strEnvironment.clear();
233 strBasePrefix.clear();
235 for(
auto& resource : resources)
241 waitStart = waitStop = 0.0;
252 for(itr=arguments.begin(); itr<arguments.end(); itr++)
255 bool ret = getParamValue((*itr).getParam(), (*itr).isSwitch(), strVal);
259 msg<<
"Error in parsing parameters of "<<
getName() \
260 <<
". ( '"<< (*itr).getParam()<<
"' is not correct. )";
266 if((*itr).isSwitch())
267 (*itr).setValue(strVal.c_str());
271 (*itr).setValue(strVal.c_str());
278 bool Module::getParamValue(
const char* key,
bool bSwitch, std::string ¶m)
284 string strKey = string(
"--") + string(key);
285 size_t pos = strParam.find(strKey);
286 if(pos == string::npos)
299 pos += strKey.size();
300 if((pos >= strParam.length()) || (strParam.at(pos) !=
' '))
304 while(strParam.at(pos++) ==
' ')
306 if(pos >= strParam.length())
312 while((pos2 < strParam.length()) && (strParam.at(pos2) !=
' '))
314 param = strParam.substr(pos, pos2-pos);