free(stype->content);
free(stype->content_type);
xbt_dict_free(&(stype->properties));
- xbt_dict_free(&(stype->model_properties));
+ delete stype->model_properties;
free(stype);
}
xbt_assert(!surf_storage_resource_priv(surf_storage_resource_by_name(id)),
"Storage '%s' declared several times in the platform file", id);
- storage_type_t storage_type = (storage_type_t) xbt_lib_get_or_null(storage_type_lib, type_id,ROUTING_STORAGE_TYPE_LEVEL);
+ storage_type_t storage_type =
+ (storage_type_t)xbt_lib_get_or_null(storage_type_lib, type_id, ROUTING_STORAGE_TYPE_LEVEL);
- double Bread = surf_parse_get_bandwidth((char*)xbt_dict_get(storage_type->model_properties, "Bread"),
- "property Bread, storage",type_id);
- double Bwrite = surf_parse_get_bandwidth((char*)xbt_dict_get(storage_type->model_properties, "Bwrite"),
- "property Bwrite, storage",type_id);
- double Bconnection = surf_parse_get_bandwidth((char*)xbt_dict_get(storage_type->model_properties, "Bconnection"),
- "property Bconnection, storage",type_id);
+ double Bread =
+ surf_parse_get_bandwidth(storage_type->model_properties->at("Bread").c_str(), "property Bread, storage", type_id);
+ double Bwrite = surf_parse_get_bandwidth(storage_type->model_properties->at("Bwrite").c_str(),
+ "property Bwrite, storage", type_id);
+ double Bconnection = surf_parse_get_bandwidth(storage_type->model_properties->at("Bconnection").c_str(),
+ "property Bconnection, storage", type_id);
Storage* storage = new StorageN11(this, id, maxminSystem_, Bread, Bwrite, Bconnection, type_id, (char*)content_name,
content_type, storage_type->size, (char*)attach);
#include "simgrid/host.h"
#include "src/surf/xml/platf.hpp"
-#include <vector>
+#include <map>
#include <string>
+#include <vector>
SG_BEGIN_DECL()
#include "src/surf/xml/simgrid_dtd.h"
const char* content;
const char* content_type;
xbt_dict_t properties;
- xbt_dict_t model_properties;
+ std::map<std::string, std::string>* model_properties;
sg_size_t size;
} s_sg_platf_storage_type_cbarg_t, *sg_platf_storage_type_cbarg_t;
/* The default current property receiver. Setup in the corresponding opening callbacks. */
xbt_dict_t current_property_set = nullptr;
-xbt_dict_t current_model_property_set = nullptr;
+std::map<std::string, std::string>* current_model_property_set = nullptr;
int AS_TAG = 0; // Whether we just opened an AS tag (to see what to do with the properties)
/* dictionary of random generator data */
void STag_surfxml_model___prop(){
if (!current_model_property_set)
- current_model_property_set = xbt_dict_new_homogeneous(xbt_free_f);
+ current_model_property_set = new std::map<std::string, std::string>();
- xbt_dict_set(current_model_property_set, A_surfxml_model___prop_id, xbt_strdup(A_surfxml_model___prop_value), nullptr);
+ current_model_property_set->insert(
+ {std::string(A_surfxml_model___prop_id), std::string(A_surfxml_model___prop_value)});
}
void ETag_surfxml_prop(){/* Nothing to do */}