Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
we will get ride of <include> very soon
[simgrid.git] / src / surf / xml / surfxml_sax_cb.cpp
index 0178db7..b7f147c 100644 (file)
@@ -64,7 +64,7 @@ void surf_parse_assert_netpoint(std::string hostname, std::string pre, std::stri
       return a->name() < b->name();
   });
   bool first = true;
-  for (auto np : list) {
+  for (auto const& np : list) {
     if (np->isNetZone())
       continue;
 
@@ -114,7 +114,7 @@ static std::vector<int>* explodesRadical(std::string radicals)
   // Make all hosts
   std::vector<std::string> radical_elements;
   boost::split(radical_elements, radicals, boost::is_any_of(","));
-  for (auto group : radical_elements) {
+  for (auto const& group : radical_elements) {
     std::vector<std::string> radical_ends;
     boost::split(radical_ends, group, boost::is_any_of("-"));
     int start = surf_parse_get_int(radical_ends.front());
@@ -391,6 +391,7 @@ static std::vector<char*> surf_parsed_filename_stack;
 
 void STag_surfxml_include()
 {
+  XBT_ERROR("<include> tag is deprecated, and will be removed in SimGrid v3.18. Please stop using it now (or tell us why you need it).");
   parse_after_config();
   XBT_DEBUG("STag_surfxml_include '%s'",A_surfxml_include_file);
   surf_parsed_filename_stack.push_back(surf_parsed_filename); // save old file name
@@ -799,7 +800,7 @@ void ETag_surfxml_route(){
   route.link_list   = new std::vector<simgrid::surf::LinkImpl*>();
   route.symmetrical = (A_surfxml_route_symmetrical == A_surfxml_route_symmetrical_YES);
 
-  for (auto link: parsed_link_list)
+  for (auto const& link : parsed_link_list)
     route.link_list->push_back(link);
   parsed_link_list.clear();
 
@@ -829,7 +830,7 @@ void ETag_surfxml_zoneRoute()
 
   ASroute.link_list = new std::vector<simgrid::surf::LinkImpl*>();
 
-  for (auto link: parsed_link_list)
+  for (auto const& link : parsed_link_list)
     ASroute.link_list->push_back(link);
   parsed_link_list.clear();
 
@@ -858,7 +859,7 @@ void ETag_surfxml_bypassRoute(){
   route.symmetrical = false;
   route.link_list   = new std::vector<simgrid::surf::LinkImpl*>();
 
-  for (auto link: parsed_link_list)
+  for (auto const& link : parsed_link_list)
     route.link_list->push_back(link);
   parsed_link_list.clear();
 
@@ -882,7 +883,7 @@ void ETag_surfxml_bypassZoneRoute()
   ASroute.src         = sg_netpoint_by_name_or_null(A_surfxml_bypassZoneRoute_src);
   ASroute.dst         = sg_netpoint_by_name_or_null(A_surfxml_bypassZoneRoute_dst);
   ASroute.link_list   = new std::vector<simgrid::surf::LinkImpl*>();
-  for (auto link: parsed_link_list)
+  for (auto const& link : parsed_link_list)
     ASroute.link_list->push_back(link);
   parsed_link_list.clear();
 
@@ -910,7 +911,6 @@ void STag_surfxml_trace___connect()
 {
   parse_after_config();
   TraceConnectCreationArgs trace_connect;
-  memset(&trace_connect,0,sizeof(trace_connect));
 
   trace_connect.element = A_surfxml_trace___connect_element;
   trace_connect.trace = A_surfxml_trace___connect_trace;
@@ -981,7 +981,7 @@ void STag_surfxml_config()
 
 void ETag_surfxml_config()
 {
-  for (auto elm : *current_property_set) {
+  for (auto const& elm : *current_property_set) {
     if (xbt_cfg_is_default_value(elm.first.c_str())) {
       std::string cfg = elm.first + ":" + elm.second;
       xbt_cfg_set_parse(cfg.c_str());
@@ -1027,9 +1027,11 @@ void ETag_surfxml_actor()
   s_sg_platf_process_cbarg_t actor;
   memset(&actor,0,sizeof(actor));
 
+  actor.properties     = current_property_set;
+  current_property_set = nullptr;
+
   actor.argc       = argc;
   actor.argv       = (const char **)argv;
-  actor.properties = current_property_set;
   actor.host       = A_surfxml_actor_host;
   actor.function   = A_surfxml_actor_function;
   actor.start_time = surf_parse_get_double(A_surfxml_actor_start___time);
@@ -1054,8 +1056,6 @@ void ETag_surfxml_actor()
     xbt_free(argv[i]);
   xbt_free(argv);
   argv = nullptr;
-
-  current_property_set = nullptr;
 }
 
 void STag_surfxml_argument(){