X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/013aee5c38d6c531af7a469a89d6474a19233d3f..f1e469ce075c0a1ad21a7fd0fdb587f9a3cb5289:/src/surf/xml/surfxml_sax_cb.cpp diff --git a/src/surf/xml/surfxml_sax_cb.cpp b/src/surf/xml/surfxml_sax_cb.cpp index ae13da939b..f33d9108dd 100644 --- a/src/surf/xml/surfxml_sax_cb.cpp +++ b/src/surf/xml/surfxml_sax_cb.cpp @@ -1,24 +1,13 @@ - /* Copyright (c) 2006-2015. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2006-2017. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include -#include -#include /* va_arg */ - -#include "simgrid/link.h" -#include "simgrid/s4u/engine.hpp" +#include "simgrid/s4u/Engine.hpp" #include "simgrid/sg_config.h" #include "src/kernel/routing/NetPoint.hpp" #include "src/surf/network_interface.hpp" -#include "src/surf/surf_private.h" -#include "xbt/dict.h" #include "xbt/file.h" -#include "xbt/log.h" -#include "xbt/misc.h" -#include "xbt/str.h" #include "src/surf/xml/platf_private.hpp" #include @@ -297,7 +286,7 @@ static std::vector surf_parse_get_all_speeds(char* speeds, const char* e /* 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* 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 */ @@ -485,7 +474,7 @@ void STag_surfxml_prop() XBT_DEBUG("Set AS property %s -> %s", A_surfxml_prop_id, A_surfxml_prop_value); simgrid::s4u::NetZone* netzone = simgrid::s4u::Engine::instance()->netzoneByNameOrNull(A_surfxml_AS_id); - netzone->setProperty(A_surfxml_prop_id, xbt_strdup(A_surfxml_prop_value)); + netzone->setProperty(A_surfxml_prop_id, A_surfxml_prop_value); } else{ if (!current_property_set) @@ -985,9 +974,10 @@ void STag_surfxml_argument(){ 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(); - 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 */}