-template XBT_PUBLIC int const& getConfig<int>(const char* name);
-template XBT_PUBLIC double const& getConfig<double>(const char* name);
-template XBT_PUBLIC bool const& getConfig<bool>(const char* name);
-template XBT_PUBLIC std::string const& getConfig<std::string>(const char* name);
+void set_parse(std::string options)
+{
+ XBT_DEBUG("List to parse and set:'%s'", options.c_str());
+ while (not options.empty()) {
+ XBT_DEBUG("Still to parse and set: '%s'", options.c_str());
+
+ // skip separators
+ size_t pos = options.find_first_not_of(" \t\n,");
+ options.erase(0, pos);
+ // find option
+ pos = options.find_first_of(" \t\n,");
+ std::string name = options.substr(0, pos);
+ options.erase(0, pos);
+ XBT_DEBUG("parse now:'%s'; parse later:'%s'", name.c_str(), options.c_str());
+
+ if (name.empty())
+ continue;
+
+ pos = name.find(':');
+ xbt_assert(pos != std::string::npos, "Option '%s' badly formatted. Should be of the form 'name:value'",
+ name.c_str());
+
+ std::string val = name.substr(pos + 1);
+ name.erase(pos);
+
+ const std::string path("path");
+ if (name.compare(0, path.length(), path) != 0)
+ XBT_INFO("Configuration change: Set '%s' to '%s'", name.c_str(), val.c_str());
+
+ set_as_string(name.c_str(), val);
+ }
+}
+
+// ***** get_value *****
+
+template <class T> XBT_PUBLIC T const& get_value(const char* name)
+{
+ return (*simgrid_config)[name].get_value<T>();
+}
+
+template XBT_PUBLIC int const& get_value<int>(const char* name);
+template XBT_PUBLIC double const& get_value<double>(const char* name);
+template XBT_PUBLIC bool const& get_value<bool>(const char* name);
+template XBT_PUBLIC std::string const& get_value<std::string>(const char* name);