WSL/SLF GitLab Repository

Commit 6a52089f authored by Mathias Bavay's avatar Mathias Bavay
Browse files

White spaces and better documentation in the filters template

parent 6b70a7be
......@@ -73,16 +73,16 @@ IF(UNIX)
SET(CMAKE_SHARED_LINKER_FLAGS "-framework CoreFoundation")
#set(CMAKE_OSX_SYSROOT iphoneos2.2.1) #for IOS
#set a full rpath for both build & install tree
# add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
# the RPATH to be used when installing, but only if it's not a system directory
IF("${isSystemDir}" STREQUAL "-1")
......@@ -25,7 +25,12 @@ TEMPLATE::TEMPLATE(const std::vector<std::string>& vec_args, const std::string&
: FilterBlock(name) //this has to match the class you are inheriting from! ie FilterBlock or ProcessingBlock or WindowedFilter
properties.stage = ProcessingProperties::first; //for the rest: default values
//the filters can be called at two points: before the temporal resampling (first stage, ProcessingProperties::first)
//or after the temporal resampling (second stage, ProcessingProperties::second) or both (ProcessingProperties::both)
//filters that do not depend on past data can safely use "both" (such as min/max filters) while
//corrections should only use "first" (such as undercatch correction) in order to avoid double-correcting the data
//filters relying on past data (through variance or other statistical parameters) usually should use "first"
properties.stage = ProcessingProperties::first;
void TEMPLATE::process(const unsigned int& param, const std::vector<MeteoData>& ivec,
......@@ -45,13 +50,27 @@ void TEMPLATE::process(const unsigned int& param, const std::vector<MeteoData>&
void TEMPLATE::parse_args(std::vector<std::string> vec_args) {
//implement the parsing of the arguments
//you can inspire yourself with the min filter
void TEMPLATE::parse_args(std::vector<std::string> vec_args)
//for a filter that does not take any arguments
if ( !vec_args.empty() ) //ie if there are arguments, throw an exception
throw InvalidArgumentException("Wrong number of arguments for filter " + getName(), AT);
//for a filter taking one or two arguments
vector<double> filter_args;
//parse the vector of strings and extract a vector of double
//at least (1) argument is expected, maximum (2)
convert_args(1, 2, vec_args, filter_args);
arg1 = filter_args[0];
if (filter_args.size() == 2){
arg2 = filter_args[1];
} else {
arg2 = arg2_default_value;
} //end namespace
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