WSL/SLF GitLab Repository

Commit 2a0f0784 authored by Mathias Bavay's avatar Mathias Bavay
Browse files

changed a few names for consistency, added a few const or static methods

parent 18b10ad0
......@@ -110,7 +110,7 @@ void DataGenerator::fillMissing(std::vector<METEO_SET>& vecVecMeteo) const
void DataGenerator::setAlgorithms(const Config& cfg)
{
set<string> set_of_used_parameters;
get_parameters(cfg, set_of_used_parameters);
getParameters(cfg, set_of_used_parameters);
set<string>::const_iterator it;
for (it = set_of_used_parameters.begin(); it != set_of_used_parameters.end(); ++it) {
......@@ -132,7 +132,7 @@ void DataGenerator::setAlgorithms(const Config& cfg)
}
}
size_t DataGenerator::get_parameters(const Config& cfg, std::set<std::string>& set_parameters)
void DataGenerator::getParameters(const Config& cfg, std::set<std::string>& set_parameters)
{
std::vector<std::string> vec_keys;
cfg.findKeys(vec_keys, std::string(), "Generators");
......@@ -144,8 +144,6 @@ size_t DataGenerator::get_parameters(const Config& cfg, std::set<std::string>& s
set_parameters.insert( IOUtils::strToUpper(tmp) );
}
}
return set_parameters.size();
}
size_t DataGenerator::getAlgorithmsForParameter(const Config& cfg, const std::string& parname, std::vector<std::string>& vecAlgorithms)
......
......@@ -118,7 +118,7 @@ class DataGenerator {
const std::string toString() const;
private:
static size_t get_parameters(const Config& cfg, std::set<std::string>& set_parameters);
static void getParameters(const Config& cfg, std::set<std::string>& set_parameters);
static size_t getAlgorithmsForParameter(const Config& cfg, const std::string& parname, std::vector<std::string>& vecAlgorithms);
static size_t getArgumentsForAlgorithm(const Config& cfg, const std::string& parname,
const std::string& algorithm,
......
......@@ -25,7 +25,7 @@ MeteoProcessor::MeteoProcessor(const Config& cfg) : mi1d(cfg), processing_stack(
{
//Parse [Filters] section, create processing stack for each configured parameter
set<string> set_of_used_parameters;
get_parameters(cfg, set_of_used_parameters);
getParameters(cfg, set_of_used_parameters);
for (set<string>::const_iterator it = set_of_used_parameters.begin(); it != set_of_used_parameters.end(); ++it){
ProcessingStack* tmp = new ProcessingStack(cfg, *it);
......@@ -40,7 +40,7 @@ MeteoProcessor::~MeteoProcessor()
delete it->second;
}
size_t MeteoProcessor::get_parameters(const Config& cfg, std::set<std::string>& set_parameters) const
void MeteoProcessor::getParameters(const Config& cfg, std::set<std::string>& set_parameters)
{
std::vector<std::string> vec_keys;
cfg.findKeys(vec_keys, std::string(), "Filters");
......@@ -52,11 +52,9 @@ size_t MeteoProcessor::get_parameters(const Config& cfg, std::set<std::string>&
set_parameters.insert(tmp);
}
}
return set_parameters.size();
}
void MeteoProcessor::getWindowSize(ProcessingProperties& o_properties)
void MeteoProcessor::getWindowSize(ProcessingProperties& o_properties) const
{
ProcessingProperties tmp;
......@@ -70,7 +68,7 @@ void MeteoProcessor::getWindowSize(ProcessingProperties& o_properties)
compareProperties(tmp, o_properties);
}
void MeteoProcessor::compareProperties(const ProcessingProperties& newprop, ProcessingProperties& current) const
void MeteoProcessor::compareProperties(const ProcessingProperties& newprop, ProcessingProperties& current)
{
current.points_before = MAX(current.points_before, newprop.points_before);
current.points_after = MAX(current.points_after, newprop.points_after);
......
......@@ -64,13 +64,13 @@ class MeteoProcessor {
bool resample(const Date& date, const std::vector<MeteoData>& ivec, MeteoData& md);
void getWindowSize(ProcessingProperties& o_properties);
void getWindowSize(ProcessingProperties& o_properties) const;
const std::string toString() const;
private:
size_t get_parameters(const Config& cfg, std::set<std::string>& set_parameters) const;
void compareProperties(const ProcessingProperties& newprop, ProcessingProperties& current) const;
static void getParameters(const Config& cfg, std::set<std::string>& set_parameters);
static void compareProperties(const ProcessingProperties& newprop, ProcessingProperties& current);
Meteo1DInterpolator mi1d;
std::map<std::string, ProcessingStack*> processing_stack;
......
......@@ -33,7 +33,8 @@ ProcessingStack::ProcessingStack(const Config& cfg, const std::string& parname)
std::ostringstream tmp;
tmp << param_name << "::arg" << (ii+1);
getArgumentsForFilter(cfg, tmp.str(), vec_args); //Read arguments
//Read arguments
cfg.getValue(tmp.str(), "Filters", vec_args, IOUtils::nothrow);
filter_stack.push_back( BlockFactory::getBlock(block_name, vec_args) );
}
}
......@@ -65,13 +66,6 @@ void ProcessingStack::getWindowSize(ProcessingProperties& o_properties)
}
}
void ProcessingStack::getArgumentsForFilter(const Config& cfg, const std::string& keyname,
std::vector<std::string>& vecArguments)
{
// Retrieve the values for a given 'keyname' and store them in a vector calles 'vecArguments'
cfg.getValue(keyname, "Filters", vecArguments, IOUtils::nothrow);
}
//this method applies the whole processing stack for all the stations, all the data points for one meteo param
//(as defined in the constructor)
void ProcessingStack::process(const std::vector< std::vector<MeteoData> >& ivec,
......
......@@ -48,8 +48,6 @@ class ProcessingStack {
const std::string toString() const;
private:
static void getArgumentsForFilter(const Config& cfg, const std::string& keyname, std::vector<std::string>& vecArguments);
std::vector<ProcessingBlock*> filter_stack; //for now: strictly linear chain of processing blocks
const std::string param_name;
};
......
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