Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Prefer using "try_emplace" (sonar, c++17).
[simgrid.git] / src / surf / xml / surfxml_sax_cb.cpp
index e6608e8..7b0e782 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2006-2022. 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. */
@@ -225,7 +225,7 @@ void ETag_surfxml_platform(){
 
 void STag_surfxml_prop()
 {
-  property_sets.back().insert({A_surfxml_prop_id, A_surfxml_prop_value});
+  property_sets.back().try_emplace(A_surfxml_prop_id, A_surfxml_prop_value);
   XBT_DEBUG("add prop %s=%s into current property set %p", A_surfxml_prop_id, A_surfxml_prop_value,
             &(property_sets.back()));
 }
@@ -244,12 +244,12 @@ void STag_surfxml_host()
 
   if (A_surfxml_host_availability___file[0] != '\0') {
     XBT_WARN("The availability_file attribute in <host> is now deprecated. Please, use 'speed_file' instead.");
-    host.speed_trace = simgrid::kernel::profile::Profile::from_file(A_surfxml_host_availability___file);
+    host.speed_trace = simgrid::kernel::profile::ProfileBuilder::from_file(A_surfxml_host_availability___file);
   }
   if (A_surfxml_host_speed___file[0] != '\0')
-    host.speed_trace = simgrid::kernel::profile::Profile::from_file(A_surfxml_host_speed___file);
+    host.speed_trace = simgrid::kernel::profile::ProfileBuilder::from_file(A_surfxml_host_speed___file);
   host.state_trace = A_surfxml_host_state___file[0]
-                         ? simgrid::kernel::profile::Profile::from_file(A_surfxml_host_state___file)
+                         ? simgrid::kernel::profile::ProfileBuilder::from_file(A_surfxml_host_state___file)
                          : nullptr;
   host.coord       = A_surfxml_host_coordinates;
 
@@ -415,12 +415,12 @@ void STag_surfxml_peer(){
   peer.speed_trace = nullptr;
   if (A_surfxml_peer_availability___file[0] != '\0') {
     XBT_WARN("The availability_file attribute in <peer> is now deprecated. Please, use 'speed_file' instead.");
-    peer.speed_trace = simgrid::kernel::profile::Profile::from_file(A_surfxml_peer_availability___file);
+    peer.speed_trace = simgrid::kernel::profile::ProfileBuilder::from_file(A_surfxml_peer_availability___file);
   }
   if (A_surfxml_peer_speed___file[0] != '\0')
-    peer.speed_trace = simgrid::kernel::profile::Profile::from_file(A_surfxml_peer_speed___file);
+    peer.speed_trace = simgrid::kernel::profile::ProfileBuilder::from_file(A_surfxml_peer_speed___file);
   peer.state_trace = A_surfxml_peer_state___file[0]
-                         ? simgrid::kernel::profile::Profile::from_file(A_surfxml_peer_state___file)
+                         ? simgrid::kernel::profile::ProfileBuilder::from_file(A_surfxml_peer_state___file)
                          : nullptr;
 
   if (A_surfxml_peer_lat[0] != '\0')
@@ -444,15 +444,15 @@ void ETag_surfxml_link(){
   link.bandwidths          = xbt_parse_get_bandwidths(surf_parsed_filename, surf_parse_lineno, A_surfxml_link_bandwidth,
                                              "bandwidth of link " + link.id);
   link.bandwidth_trace     = A_surfxml_link_bandwidth___file[0]
-                             ? simgrid::kernel::profile::Profile::from_file(A_surfxml_link_bandwidth___file)
+                             ? simgrid::kernel::profile::ProfileBuilder::from_file(A_surfxml_link_bandwidth___file)
                              : nullptr;
   link.latency =
       xbt_parse_get_time(surf_parsed_filename, surf_parse_lineno, A_surfxml_link_latency, "latency of link " + link.id);
   link.latency_trace       = A_surfxml_link_latency___file[0]
-                           ? simgrid::kernel::profile::Profile::from_file(A_surfxml_link_latency___file)
+                           ? simgrid::kernel::profile::ProfileBuilder::from_file(A_surfxml_link_latency___file)
                            : nullptr;
   link.state_trace = A_surfxml_link_state___file[0]
-                         ? simgrid::kernel::profile::Profile::from_file(A_surfxml_link_state___file)
+                         ? simgrid::kernel::profile::ProfileBuilder::from_file(A_surfxml_link_state___file)
                          : nullptr;
 
   switch (A_surfxml_link_sharing___policy) {