Commit 4b39c3fe authored by maximilianlohoefer's avatar maximilianlohoefer
Browse files

Fix to runner_pt. Did not compile without MCL_POS.


git-svn-id: https://svn.rwth-aachen.de/repos/sw440870_load_leveller/trunk@43 36cca2a8-63f0-4188-8a56-663e3b0d1cf3
parent 07e90136
......@@ -62,6 +62,7 @@ bool parser :: read_file(std::string input)
}
}
file.close();
readVals.clear();
return true;
}
......@@ -69,7 +70,11 @@ std::string parser::return_value_of(std::string name)
{
std::map<std::string,std::string>::iterator it;
it=vars.find(name);
if(it!=vars.end()) return (*it).second;
if(it!=vars.end())
{
readVals.push_back(name);
return (*it).second;
}
else {
std::cerr << "#PARSER: NO VARIABLE WITH NAME " << name << " FOUND!" << std::endl;
return "";
......@@ -80,7 +85,10 @@ std::string parser::value_or_default(std::string name, std::string defa)
{
std::map<std::string,std::string>::iterator it;
it=vars.find(name);
if(it!=vars.end()) return (*it).second;
if(it!=vars.end()) {
readVals.push_back(name);
return (*it).second;
}
else return defa;
}
......@@ -145,3 +153,23 @@ void parser :: get_all_with_one_from_specified_array(std::string sfai, int fai,
}
}
std::vector<std::string> parser::unused_parameters() {
std::vector<std::string> unused;
std::vector<std::string>::iterator re;
for (std::map<std::string, std::string>::iterator va = vars.begin(); va != vars.end(); ++va) {
for (re = readVals.begin(); re != readVals.end(); ++re) {
if (va->first == (*re))
break;
}
unused.push_back(va->first);
}
for (std::map<std::string, std::vector<std::string> >::iterator va = arrs.begin(); va != arrs.end(); ++va) {
for (re = readVals.begin(); re != readVals.end(); ++re) {
if (va->first == (*re))
break;
}
unused.push_back(va->first);
}
return unused;
}
......@@ -47,6 +47,7 @@ class parser
if(it != vars.end()) {
buffer << vars[name];
buffer >> ret;
readVals.push_back(name);
return ret;
} else {
std::cerr<<"#PARSER: NO VARIABLE WITH NAME "<<name<<" FOUND!"<< std::endl;
......@@ -72,6 +73,7 @@ class parser
if(it != vars.end()) {
buffer << vars[name];
buffer >> ret;
readVals.push_back(name);
return ret;
} else return defa;
};
......@@ -102,17 +104,21 @@ class parser
buffer>>tmp;
ret.push_back(tmp);
}
readVals.push_back(name);
return ret;
};
template <class Type>
std::vector< Type > vector(std::string name) {return return_vector<Type>(name);}
std::vector<std::string> unused_parameters();
private:
std::string notfine, comment, array;
std::map<std::string,std::string> vars;
std::map<std::string,std::vector<std::string> > arrs;
std::vector<std::string> readVals;
};
......
......@@ -318,13 +318,14 @@ void runner_pt :: M_report_acc_ratio() {
afile << "\n";
afile.close();
}
#ifdef MCL_POS
void runner_pt::M_report_pt_positions() {
std::ofstream afile(positionsfile.c_str(), std::ios::out | std::ios::app);
afile << pt_position_order.str();
afile.close();
pt_position_order.str("");
}
#endif
void runner_pt :: M_global_update()
{
......
......@@ -80,7 +80,9 @@ class runner_pt
void M_update(int);
void M_report();
void M_report_acc_ratio();
#ifdef MCL_POS
void M_report_pt_positions();
#endif
void M_global_update();
// slave stuff
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment