10#include "JSONProperty.hpp"
12#include <boost/property_tree/ptree.hpp>
13#include <boost/algorithm/string.hpp>
54 for (
auto &formulation_parameter : config) {
55 options.emplace(formulation_parameter.first,
geojson::JSONProperty(formulation_parameter.first, formulation_parameter.second));
58 if (global !=
nullptr) {
59 for(
auto &global_option : *global) {
60 if (options.count(global_option.first) == 0) {
61 options.emplace(global_option.first, global_option.second);
72 std::vector<std::string> missing_parameters;
75 for (
auto parameter : required_parameters) {
76 if (options.count(parameter) == 0) {
77 missing_parameters.push_back(parameter);
81 if (missing_parameters.size() > 0) {
82 std::string message =
"A " +
get_formulation_type() +
" formulation cannot be created; the following parameters are missing: ";
84 for (
int missing_parameter_index = 0; missing_parameter_index < missing_parameters.size(); missing_parameter_index++) {
85 message += missing_parameters[missing_parameter_index];
87 if (missing_parameter_index < missing_parameters.size() - 1) {
92 throw std::runtime_error(message);
@TODO: Convert JSONProperty into a variant of the supported types
Definition JSONProperty.hpp:165
std::map< std::string, JSONProperty > PropertyMap
Shorthand for a mapping between strings and properties.
Definition JSONProperty.hpp:21
Definition Bmi_C_Formulation.hpp:11