MeteoIODoc 20241221.207bde49
ProcessingStack.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2/***********************************************************************************/
3/* Copyright 2009 WSL Institute for Snow and Avalanche Research SLF-DAVOS */
4/***********************************************************************************/
5/* This file is part of MeteoIO.
6 MeteoIO is free software: you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 MeteoIO is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public License
17 along with MeteoIO. If not, see <http://www.gnu.org/licenses/>.
18*/
19#ifndef PROCESSINGSTACK_H
20#define PROCESSINGSTACK_H
21
23#include <meteoio/Config.h>
24#include <memory>
25#include <vector>
26#include <string>
27
28namespace mio {
29
37 public:
41 ProcessingStack(const Config& cfg, const std::string& param_name);
42 virtual ~ProcessingStack() {for (size_t ii=0; ii<filter_stack.size(); ii++) delete filter_stack[ii];}
43
44 void process(const std::vector< std::vector<MeteoData> >& ivec,
45 std::vector< std::vector<MeteoData> >& ovec, const bool& second_pass=false);
46 void getWindowSize(ProcessingProperties& o_properties) const;
47 const std::string toString() const;
48
49 static const std::string filter_section, filter_pattern, arg_pattern;
50
51 private:
52 virtual bool applyFilter(const size_t& param, const size_t& jj, const std::vector<MeteoData>& ivec, std::vector<MeteoData> &ovec);
53 virtual bool filterStation(std::vector<MeteoData> ivec, std::vector< std::vector<MeteoData> >& ovec, const bool& second_pass, const size_t& stat_idx);
54
55 std::vector<ProcessingBlock*> filter_stack; //for now: strictly linear chain of processing blocks
56 const std::string param_name;
57 bool data_qa_logs;
58};
59
60} //end namespace
61
62#endif
A class that reads a key/value file. These files (typically named *.ini) follow the INI file format s...
Definition: Config.h:79
Definition: ProcessingBlock.h:36
This builds and runs through a filter stack for filtering a given parameter.
Definition: ProcessingStack.h:36
ProcessingStack(const Config &cfg, const std::string &param_name)
Constructor parses cfg and builds up a filter stack for param_name.
Definition: ProcessingStack.cc:30
void getWindowSize(ProcessingProperties &o_properties) const
Definition: ProcessingStack.cc:47
const std::string toString() const
Definition: ProcessingStack.cc:227
void process(const std::vector< std::vector< MeteoData > > &ivec, std::vector< std::vector< MeteoData > > &ovec, const bool &second_pass=false)
Definition: ProcessingStack.cc:212
virtual ~ProcessingStack()
Definition: ProcessingStack.h:42
static const std::string filter_section
Definition: ProcessingStack.h:49
static const std::string arg_pattern
Definition: ProcessingStack.h:49
static const std::string filter_pattern
Definition: ProcessingStack.h:49
Definition: Config.cc:31