MeteoIODoc  MeteoIODoc-2.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GeneratorAlgorithms.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 #ifndef GENERATORALGORITHMS_H
19 #define GENERATORALGORITHMS_H
20 
22 #include <meteoio/Config.h>
23 
24 #include <vector>
25 #include <string>
26 
27 #ifdef _MSC_VER
28  #pragma warning(disable:4512) //we don't need any = operator!
29 #endif
30 
31 namespace mio {
32 
111 
112  public:
113  GeneratorAlgorithm(const std::vector<std::string>& /*vecArgs*/, const std::string& i_algo) : algo(i_algo) {}
114  virtual ~GeneratorAlgorithm() {}
115  //fill one MeteoData, for one station. This is used by the dataGenerators
116  virtual bool generate(const size_t& param, MeteoData& md) = 0;
117  //fill one time series of MeteoData for one station. This is used by the dataCreators
118  virtual bool create(const size_t& param, std::vector<MeteoData>& vecMeteo) = 0;
119  std::string getAlgo() const;
120  protected:
121  virtual void parse_args(const std::vector<std::string>& i_vecArgs);
122  const std::string algo;
123 
124  //These are used by several generators in order work with radiation data by looking at HS and deciding which albedo should be used
125  static const double soil_albedo, snow_albedo, snow_thresh;
126 };
127 
129  public:
130  static GeneratorAlgorithm* getAlgorithm(const Config& cfg, const std::string& i_algoname, const std::vector<std::string>& vecArgs);
131 };
132 
133 } //end namespace mio
134 
135 #endif
Interface class for the generator models. These models generate data for a specific parameter when al...
Definition: GeneratorAlgorithms.h:110
static const double snow_thresh
Definition: GeneratorAlgorithms.h:125
virtual ~GeneratorAlgorithm()
Definition: GeneratorAlgorithms.h:114
static const double snow_albedo
Definition: GeneratorAlgorithms.h:125
virtual void parse_args(const std::vector< std::string > &i_vecArgs)
Definition: GeneratorAlgorithms.cc:163
std::string getAlgo() const
Definition: GeneratorAlgorithms.cc:159
static const double soil_albedo
Definition: GeneratorAlgorithms.h:125
GeneratorAlgorithm(const std::vector< std::string > &, const std::string &i_algo)
Definition: GeneratorAlgorithms.h:113
A class that reads a key/value file. These files (typically named *.ini) follow the INI file format s...
Definition: Config.h:58
virtual bool generate(const size_t &param, MeteoData &md)=0
const std::string algo
Definition: GeneratorAlgorithms.h:122
static GeneratorAlgorithm * getAlgorithm(const Config &cfg, const std::string &i_algoname, const std::vector< std::string > &vecArgs)
Definition: GeneratorAlgorithms.cc:123
virtual bool create(const size_t &param, std::vector< MeteoData > &vecMeteo)=0
A class to represent a singular measurement received from one station at a certain time (represented ...
Definition: MeteoData.h:101
Definition: GeneratorAlgorithms.h:128