-/*----[ Registering stuff ]-----------------------------------------------*/
-/** @brief Register an element within a config set
- *
- * @param cfg the config set
- * @param name the name of the config element
- * @param desc a description for this item (used by xbt_cfg_help())
- * @param type the type of the config element
- * @param cb_set callback function called when a value is set
- */
-static void xbt_cfg_register(
- xbt_cfg_t * cfg, const char *name, const char *desc, e_xbt_cfgelm_type_t type,
- xbt_cfg_cb_t cb_set,
- std::function<void(const char* value)> callback = std::function<void(const char* value)>())
-{
- if (*cfg == NULL)
- *cfg = xbt_cfg_new();
- xbt_assert(type >= xbt_cfgelm_int && type <= xbt_cfgelm_boolean,
- "type of %s not valid (%d should be between %d and %d)",
- name, (int)type, xbt_cfgelm_int, xbt_cfgelm_boolean);
-
- xbt_cfgelm_t res = (xbt_cfgelm_t) xbt_dict_get_or_null((xbt_dict_t) * cfg, name);
- xbt_assert(NULL == res, "Refusing to register the config element '%s' twice.", name);
-
- res = new s_xbt_cfgelm_t();
- XBT_DEBUG("Register cfg elm %s (%s) (%s (=%d) @%p in set %p)",
- name, desc, xbt_cfgelm_type_name[type], (int)type, res, *cfg);
- res->type = type;
- if (desc)
- res->desc = desc;
- res->cb_set = cb_set;
- res->callback = std::move(callback);
-
- switch (type) {
- case xbt_cfgelm_int:
- res->content = xbt_dynar_new(sizeof(int), NULL);
- break;
- case xbt_cfgelm_double:
- res->content = xbt_dynar_new(sizeof(double), NULL);
- break;
- case xbt_cfgelm_string:
- res->content = xbt_dynar_new(sizeof(char *), xbt_free_ref);
- break;
- case xbt_cfgelm_boolean:
- res->content = xbt_dynar_new(sizeof(int), NULL);
- break;
- default:
- XBT_ERROR("%d is an invalid type code", (int)type);
- break;
+/** @brief Displays the declared options and their description */
+void Config::help()
+{
+ for (auto const& elm : options) {
+ simgrid::config::ConfigurationElement* variable = this->options.at(elm.first);
+ printf(" %s: %s\n", elm.first.c_str(), variable->get_description().c_str());
+ printf(" Type: %s; ", variable->get_type_name());
+ printf("Current value: %s\n", variable->get_string_value().c_str());