MeteoIODoc 20241221.207bde49
FilterSuppr.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 FILTERSUPPR_H
20#define FILTERSUPPR_H
21
23#include <vector>
24#include <map>
25#include <string>
26
27namespace mio {
28
71 public:
72 FilterSuppr(const std::vector< std::pair<std::string, std::string> >& vecArgs, const std::string& name, const Config& cfg);
73
74 virtual void process(const unsigned int& param, const std::vector<MeteoData>& ivec,
75 std::vector<MeteoData>& ovec);
76
77 private:
78 typedef enum FILTER_TYPE {
79 NONE,
80 ALL_SUPPR,
81 FRAC_SUPPR,
82 FILE_SUPPR
83 } filter_type;
84
85 void supprByDates(const unsigned int& param, std::vector<MeteoData>& ovec) const;
86 void supprFrac(const unsigned int& param, const std::vector<MeteoData>& ivec, std::vector<MeteoData>& ovec) const;
87
88 std::map< std::string, std::vector<DateRange> > suppr_dates;
89 double range, width;
90 filter_type type;
91};
92
93} //end namespace
94
95#endif
A class that reads a key/value file. These files (typically named *.ini) follow the INI file format s...
Definition: Config.h:79
Suppression filter.
Definition: FilterSuppr.h:70
virtual void process(const unsigned int &param, const std::vector< MeteoData > &ivec, std::vector< MeteoData > &ovec)
Definition: FilterSuppr.cc:81
FilterSuppr(const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &name, const Config &cfg)
Definition: FilterSuppr.cc:32
The base class for all filters that provides the interface and a few helper methods.
Definition: ProcessingBlock.h:67
Definition: Config.cc:31