Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
[simgrid.git] / src / surf / xml / surfxml_parseplatf.cpp
index fb6e7b5..0e4d96d 100644 (file)
@@ -35,10 +35,11 @@ XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_link
 XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_link_lat;
 
 SG_BEGIN_DECL()
-void sg_platf_trace_connect(sg_platf_trace_connect_cbarg_t trace_connect)
+void sg_platf_trace_connect(TraceConnectCreationArgs* trace_connect)
 {
   xbt_assert(traces_set_list.find(trace_connect->trace) != traces_set_list.end(),
-             "Cannot connect trace %s to %s: trace unknown", trace_connect->trace, trace_connect->element);
+             "Cannot connect trace %s to %s: trace unknown", trace_connect->trace.c_str(),
+             trace_connect->element.c_str());
 
   switch (trace_connect->kind) {
   case SURF_TRACE_CONNECT_KIND_HOST_AVAIL:
@@ -117,7 +118,7 @@ void parse_platform_file(const char *file)
     parse_status = surf_parse();
 
     /* connect all traces relative to hosts */
-    for (auto elm : trace_connect_list_host_avail) {
+    for (auto const& elm : trace_connect_list_host_avail) {
       xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str());
       tmgr_trace_t trace = traces_set_list.at(elm.first);
 
@@ -128,7 +129,7 @@ void parse_platform_file(const char *file)
       cpu->setStateTrace(trace);
     }
 
-    for (auto elm : trace_connect_list_host_speed) {
+    for (auto const& elm : trace_connect_list_host_speed) {
       xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str());
       tmgr_trace_t trace = traces_set_list.at(elm.first);
 
@@ -139,7 +140,7 @@ void parse_platform_file(const char *file)
       cpu->setSpeedTrace(trace);
     }
 
-    for (auto elm : trace_connect_list_link_avail) {
+    for (auto const& elm : trace_connect_list_link_avail) {
       xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str());
       tmgr_trace_t trace = traces_set_list.at(elm.first);
 
@@ -148,7 +149,7 @@ void parse_platform_file(const char *file)
       link->setStateTrace(trace);
     }
 
-    for (auto elm : trace_connect_list_link_bw) {
+    for (auto const& elm : trace_connect_list_link_bw) {
       xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str());
       tmgr_trace_t trace = traces_set_list.at(elm.first);
       sg_link_t link = simgrid::s4u::Link::byName(elm.second.c_str());
@@ -156,7 +157,7 @@ void parse_platform_file(const char *file)
       link->setBandwidthTrace(trace);
     }
 
-    for (auto elm : trace_connect_list_link_lat) {
+    for (auto const& elm : trace_connect_list_link_lat) {
       xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str());
       tmgr_trace_t trace = traces_set_list.at(elm.first);
       sg_link_t link = simgrid::s4u::Link::byName(elm.second.c_str());