10#include "JSONProperty.hpp"
12#include <boost/property_tree/ptree.hpp>
13#include <boost/algorithm/string.hpp>
47 virtual void check_mass_balance(
const int& iteration,
const int& total_steps,
const std::string& timestamp)
const = 0;
55 for (
auto &formulation_parameter : config) {
56 options.emplace(formulation_parameter.first,
geojson::JSONProperty(formulation_parameter.first, formulation_parameter.second));
59 if (global !=
nullptr) {
60 for(
auto &global_option : *global) {
61 if (options.count(global_option.first) == 0) {
62 options.emplace(global_option.first, global_option.second);
73 std::vector<std::string> missing_parameters;
76 for (
auto parameter : required_parameters) {
77 if (options.count(parameter) == 0) {
78 missing_parameters.push_back(parameter);
82 if (missing_parameters.size() > 0) {
83 std::string message =
"A " +
get_formulation_type() +
" formulation cannot be created; the following parameters are missing: ";
85 for (
int missing_parameter_index = 0; missing_parameter_index < missing_parameters.size(); missing_parameter_index++) {
86 message += missing_parameters[missing_parameter_index];
88 if (missing_parameter_index < missing_parameters.size() - 1) {
93 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