MeteoIODoc  MeteoIODoc-2.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DataGenerator.h
Go to the documentation of this file.
1 /***********************************************************************************/
2 /* Copyright 2013 WSL Institute for Snow and Avalanche Research SLF-DAVOS */
3 /***********************************************************************************/
4 /* This file is part of MeteoIO.
5  MeteoIO is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  MeteoIO is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with MeteoIO. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef DATAGENERATOR_H
20 #define DATAGENERATOR_H
21 
22 #include <meteoio/Config.h>
25 
26 #include <vector>
27 #include <map>
28 #include <set>
29 
30 namespace mio {
31 
44  public:
45  DataGenerator(const Config& cfg);
46  DataGenerator(const DataGenerator& c) : mapGenerators(c.mapGenerators) {}
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 
56  private:
57  static void getParameters(const Config& cfg, const std::string& key_pattern, std::set<std::string>& set_parameters);
58  static size_t getAlgorithmsForParameter(const Config& cfg, const std::string& key_pattern, const std::string& parname, std::vector<std::string>& vecAlgorithms);
59  static size_t getArgumentsForAlgorithm(const Config& cfg, const std::string& parname,
60  const std::string& algorithm,
61  std::vector<std::string>& vecArgs);
62 
63  std::map< std::string, std::vector<GeneratorAlgorithm*> > mapGenerators; //per parameter data generators algorithms
64 };
65 
66 } //end namespace
67 
68 #endif
DataGenerator & operator=(const DataGenerator &source)
Definition: DataGenerator.cc:62
std::vector< MeteoData > METEO_SET
Definition: MeteoData.h:29
~DataGenerator()
Definition: DataGenerator.cc:51
DataGenerator(const Config &cfg)
Definition: DataGenerator.cc:25
A class to generate meteo data from user-selected models or parametrizations. This class sits in betw...
Definition: DataGenerator.h:43
const std::string toString() const
Definition: DataGenerator.cc:205
A class that reads a key/value file. These files (typically named *.ini) follow the INI file format s...
Definition: Config.h:58
DataGenerator(const DataGenerator &c)
Definition: DataGenerator.h:46
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:77