MeteoIODoc  2.10.0
DataGenerator.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: LGPL-3.0-or-later
2 /***********************************************************************************/
3 /* Copyright 2013 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 
20 #ifndef DATAGENERATOR_H
21 #define DATAGENERATOR_H
22 
23 #include <meteoio/Config.h>
26 
27 #include <vector>
28 #include <map>
29 #include <set>
30 
31 namespace mio {
32 
44  public:
45  DataGenerator(const Config& cfg, const std::set<std::string>& params_to_generate = std::set<std::string>());
46  DataGenerator(const DataGenerator& c) : mapAlgorithms(c.mapAlgorithms), data_qa_logs(c.data_qa_logs) {}
47  virtual ~DataGenerator();
48 
49  void fillMissing(METEO_SET& vecMeteo) const;
50  void fillMissing(std::vector<METEO_SET>& vecVecMeteo) const;
51 
52  DataGenerator& operator=(const DataGenerator& source);
53 
54  const std::string toString() const;
55  private:
56  static std::set<std::string> getParameters(const Config& cfg);
57  static std::vector< GeneratorAlgorithm* > buildStack(const Config& cfg, const std::string& parname);
58 
59  std::map< std::string, std::vector<GeneratorAlgorithm*> > mapAlgorithms; //per parameter data creators algorithms
60  static const std::string cmd_section, cmd_pattern, arg_pattern;
61  bool data_qa_logs;
62 };
63 
64 } //end namespace
65 
66 #endif
A class that reads a key/value file. These files (typically named *.ini) follow the INI file format s...
Definition: Config.h:79
A class to generate meteo data from user-selected models or parametrizations. This class sits in betw...
Definition: DataGenerator.h:43
virtual ~DataGenerator()
Definition: DataGenerator.cc:54
DataGenerator & operator=(const DataGenerator &source)
Definition: DataGenerator.cc:63
DataGenerator(const Config &cfg, const std::set< std::string > &params_to_generate=std::set< std::string >())
Definition: DataGenerator.cc:33
void fillMissing(METEO_SET &vecMeteo) const
generate data to fill missing data points. This relies on data generators defined by the user for eac...
Definition: DataGenerator.cc:79
DataGenerator(const DataGenerator &c)
Definition: DataGenerator.h:46
const std::string toString() const
Definition: DataGenerator.cc:219
Definition: Config.cc:30
std::vector< MeteoData > METEO_SET
Definition: MeteoData.h:31