Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
uppercase the s4u header files (+cleanups)
[simgrid.git] / src / surf / xml / surfxml_sax_cb.cpp
index ae13da9..f33d910 100644 (file)
@@ -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 <errno.h>
-#include <math.h>
-#include <stdarg.h> /* 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 <boost/algorithm/string.hpp>
@@ -297,7 +286,7 @@ static std::vector<double> 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<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 */
@@ -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<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 */}