Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Convert xbt_cfg_set_as_string -> simgrid::config::set_as_string
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 19 Apr 2018 12:44:11 +0000 (14:44 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 19 Apr 2018 16:13:32 +0000 (18:13 +0200)
include/xbt/config.h
include/xbt/config.hpp
src/msg/msg_global.cpp
src/simdag/sd_global.cpp
src/xbt/config.cpp

index 7cd6b61..a709bb1 100644 (file)
@@ -78,7 +78,8 @@ XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::set_value<bool>") XBT_PU
     void xbt_cfg_set_boolean(const char* name, const char* val);
 XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::set_value<std::string>") XBT_PUBLIC
     void xbt_cfg_set_string(const char* name, const char* val);
-XBT_PUBLIC void xbt_cfg_set_as_string(const char* name, const char* val);
+XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::set_as_string") XBT_PUBLIC
+    void xbt_cfg_set_as_string(const char* name, const char* val);
 
 /*
   Set the default value of the cell \a name in \a cfg with the provided value.
index c9fe865..eb16016 100644 (file)
@@ -63,6 +63,8 @@ extern template XBT_PUBLIC void set_value<double>(const char* name, double value
 extern template XBT_PUBLIC void set_value<bool>(const char* name, bool value);
 extern template XBT_PUBLIC void set_value<std::string>(const char* name, std::string value);
 
+XBT_PUBLIC void set_as_string(const char* name, const std::string& value);
+
 // Get config
 
 template <class T> XBT_PUBLIC T const& get_value(const char* name);
index 3fc450f..b3a49bd 100644 (file)
@@ -82,7 +82,7 @@ msg_error_t MSG_main()
  */
 void MSG_config(const char *key, const char *value){
   xbt_assert(msg_global,"ERROR: Please call MSG_init() before using MSG_config()");
-  xbt_cfg_set_as_string(key, value);
+  simgrid::config::set_as_string(key, value);
 }
 
 /** \ingroup msg_simulation
index cf67f8c..81ed28a 100644 (file)
@@ -178,7 +178,7 @@ void SD_init_nocheck(int *argc, char **argv)
  */
 void SD_config(const char *key, const char *value){
   xbt_assert(sd_global,"ERROR: Please call SD_init() before using SD_config()");
-  xbt_cfg_set_as_string(key, value);
+  simgrid::config::set_as_string(key, value);
 }
 
 /**
index 62d44ec..3f05c02 100644 (file)
@@ -395,6 +395,11 @@ template XBT_PUBLIC void set_value<double>(const char* name, double value);
 template XBT_PUBLIC void set_value<bool>(const char* name, bool value);
 template XBT_PUBLIC void set_value<std::string>(const char* name, std::string value);
 
+void set_as_string(const char* name, const std::string& value)
+{
+  (*simgrid_config)[name].set_string_value(value.c_str());
+}
+
 // ***** get_value *****
 
 template <class T> XBT_PUBLIC T const& get_value(const char* name)