NGen
Loading...
Searching...
No Matches
forcing.hpp
1#ifndef NGEN_REALIZATION_CONFIG_FORCING_H
2#define NGEN_REALIZATION_CONFIG_FORCING_H
3
4#include <boost/property_tree/ptree.hpp>
5
6#include "JSONProperty.hpp"
7
8namespace realization{
9 namespace config{
10
15 struct Forcing{
21
26 Forcing():parameters(geojson::PropertyMap()){};
27
33 Forcing(const boost::property_tree::ptree& tree){
34 //get forcing info
35 for (auto &forcing_parameter : tree) {
36 this->parameters.emplace(
37 forcing_parameter.first,
38 geojson::JSONProperty(forcing_parameter.first, forcing_parameter.second)
39 );
40 }
41 }
42
50 bool has_key(const std::string& key) const{
51 return parameters.count(key) > 0;
52 }
53 };
54
55
56 }//end namespace config
57}//end namespace realization
58#endif //NGEN_REALIZATION_CONFIG_FORCING_H
@TODO: Convert JSONProperty into a variant of the supported types
Definition JSONProperty.hpp:165
Definition FeatureBuilder.hpp:17
std::map< std::string, JSONProperty > PropertyMap
Shorthand for a mapping between strings and properties.
Definition JSONProperty.hpp:21
Definition Bmi_C_Formulation.hpp:11
Structure for holding forcing configuration information.
Definition forcing.hpp:15
bool has_key(const std::string &key) const
Test if a particualr forcing parameter exists.
Definition forcing.hpp:50
geojson::PropertyMap parameters
key -> Property mapping for forcing parameters
Definition forcing.hpp:20
Forcing()
Construct a new, empty Forcing object.
Definition forcing.hpp:26
Forcing(const boost::property_tree::ptree &tree)
Construct a new Forcing object from a property_tree.
Definition forcing.hpp:33