69 void assign(
const std::string& keyword, T val) {
70 ParamMap::iterator i = parameters_.find(keyword);
71 if (i != parameters_.end()) {
72 bool result = i->second->setData(val);
75 ss <<
"Error in parsing " << keyword <<
": expected "
76 << i->second->getParamType() <<
" but got " << &val <<
"\n";
79 }
else if (deprecatedKeywords_.find(keyword) !=
80 deprecatedKeywords_.end()) {
81 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
82 "%s keyword has been deprecated in OpenMD. Please update your "
86 painCave.severity = OPENMD_WARNING;
90 ss << keyword <<
" is not a recognized keyword.\n";
95 virtual void validate() {
97 for (i = parameters_.begin(); i != parameters_.end(); ++i) {
98 if (!i->second->isOptional() && i->second->empty()) {
100 ss << i->second->getKeyword() <<
" must be set.\n";
107 using ParamMap = std::map<std::string, ParameterBase*>;
109 ParamMap parameters_;
110 std::set<std::string> deprecatedKeywords_;