37 #include "ompl/base/GenericParam.h"
38 #include "ompl/util/Exception.h"
42 std::map<std::string, GenericParamPtr>::const_iterator it = params_.find(key);
43 if (it != params_.end())
44 return it->second->setValue(value);
47 logError(
"Parameter '%s' was not found", key.c_str());
55 for (std::map<std::string, std::string>::const_iterator it = kv.begin() ; it != kv.end() ; ++it)
58 if (!hasParam(it->first))
60 bool r = setParam(it->first, it->second);
68 std::map<std::string, GenericParamPtr>::const_iterator it = params_.find(key);
69 if (it != params_.end())
71 value = it->second->getValue();
80 params.reserve(params_.size());
81 for (std::map<std::string, GenericParamPtr>::const_iterator it = params_.begin() ; it != params_.end() ; ++it)
82 params.push_back(it->first);
87 std::vector<std::string> names;
89 vals.resize(names.size());
90 for (std::size_t i = 0 ; i < names.size() ; ++i)
91 vals[i] = params_.find(names[i])->second->getValue();
101 static GenericParamPtr empty;
102 std::map<std::string, GenericParamPtr>::const_iterator it = params_.find(key);
103 if (it != params_.end())
111 for (std::map<std::string, GenericParamPtr>::const_iterator it = params_.begin() ; it != params_.end() ; ++it)
112 params[it->first] = it->second->getValue();
117 return params_.find(key) != params_.end();
123 throw Exception(
"Parameter '%s' is not defined", key.c_str());
124 return *getParam(key);
129 const std::map<std::string, GenericParamPtr> &p = other.
getParams();
131 for (std::map<std::string, GenericParamPtr>::const_iterator it = p.begin() ; it != p.end() ; ++it)
132 params_[it->first] = it->second;
134 for (std::map<std::string, GenericParamPtr>::const_iterator it = p.begin() ; it != p.end() ; ++it)
135 params_[prefix +
"." + it->first] = it->second;
140 params_[param->getName()] = param;
155 for (std::map<std::string, GenericParamPtr>::const_iterator it = params_.begin() ; it != params_.end() ; ++it)
156 out << it->first <<
" = " << it->second->getValue() << std::endl;