MeteoIODoc  MeteoIODoc-2.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DataCreator.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 DATACREATOR_H
20 #define DATACREATOR_H
21 
22 #include <meteoio/Config.h>
25 
26 #include <vector>
27 #include <map>
28 #include <set>
29 
30 namespace mio {
31 
43 class DataCreator {
44  public:
45  DataCreator(const Config& cfg);
46  DataCreator(const DataCreator& c) : mapCreators(c.mapCreators) {}
47  ~DataCreator();
48 
49  void createParameters(std::vector<METEO_SET>& vecVecMeteo) const;
50 
51  DataCreator& operator=(const DataCreator& source);
52  const std::string toString() const;
53 
54  private:
55  static void getParameters(const Config& cfg, const std::string& key_pattern, std::set<std::string>& set_parameters);
56  static size_t getAlgorithmsForParameter(const Config& cfg, const std::string& key_pattern, const std::string& parname, std::vector<std::string>& vecAlgorithms);
57  static size_t getArgumentsForAlgorithm(const Config& cfg, const std::string& parname,
58  const std::string& algorithm,
59  std::vector<std::string>& vecArgs);
60 
61  std::map< std::string, std::vector<GeneratorAlgorithm*> > mapCreators; //per parameter data creators algorithms
62 };
63 
64 } //end namespace
65 
66 #endif
const std::string toString() const
Definition: DataCreator.cc:145
DataCreator & operator=(const DataCreator &source)
Definition: DataCreator.cc:62
DataCreator(const DataCreator &c)
Definition: DataCreator.h:46
A class to create new meteo data parameters from user-selected models or parametrizations. This class sits in between the actual implementation of the various methods and the IOManager in order to offer some high level interface. It basically reads the arguments and creates the objects for the various data generators in its constructor and loop through the parameters and stations when called.
Definition: DataCreator.h:43
A class that reads a key/value file. These files (typically named *.ini) follow the INI file format s...
Definition: Config.h:58
DataCreator(const Config &cfg)
Definition: DataCreator.cc:25
~DataCreator()
Definition: DataCreator.cc:51
void createParameters(std::vector< METEO_SET > &vecVecMeteo) const
create new parameters from parametrizations This relies on data creators defined by the user for each...
Definition: DataCreator.cc:77