Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
change e_surf_link_sharing_policy_t into a proper enum class
[simgrid.git] / src / surf / xml / surfxml_sax_cb.cpp
index 3388b9a..2b692e9 100644 (file)
@@ -7,13 +7,14 @@
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/sg_config.hpp"
 #include "src/surf/network_interface.hpp"
+#include "src/surf/surf_interface.hpp"
+#include "src/surf/xml/platf_private.hpp"
+#include "surf/surf.hpp"
 #include "xbt/file.hpp"
 
-#include "src/surf/xml/platf_private.hpp"
 #include <boost/algorithm/string.hpp>
 #include <boost/algorithm/string/classification.hpp>
 #include <boost/algorithm/string/split.hpp>
-#include <initializer_list>
 #include <string>
 #include <tuple>
 #include <unordered_map>
@@ -24,7 +25,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_parse, surf, "Logging specific to the SURF
 #include "simgrid_dtd.c"
 
 static const char* surf_parsed_filename; // Currently parsed file (for the error messages)
-std::vector<simgrid::surf::LinkImpl*> parsed_link_list; /* temporary store of current list link of a route */
+std::vector<simgrid::kernel::resource::LinkImpl*>
+    parsed_link_list; /* temporary store of current list link of a route */
 
 /*
  * Helping functions
@@ -495,17 +497,17 @@ void ETag_surfxml_cluster(){
 
   switch (AX_surfxml_cluster_sharing___policy) {
   case A_surfxml_cluster_sharing___policy_SHARED:
-    cluster.sharing_policy = SURF_LINK_SHARED;
+    cluster.sharing_policy = simgrid::s4u::Link::SharingPolicy::SHARED;
     break;
   case A_surfxml_cluster_sharing___policy_FULLDUPLEX:
     XBT_WARN("FULLDUPLEX is now deprecated. Please update your platform file to use SPLITDUPLEX instead.");
-    cluster.sharing_policy = SURF_LINK_SPLITDUPLEX;
+    cluster.sharing_policy = simgrid::s4u::Link::SharingPolicy::SPLITDUPLEX;
     break;
   case A_surfxml_cluster_sharing___policy_SPLITDUPLEX:
-    cluster.sharing_policy = SURF_LINK_SPLITDUPLEX;
+    cluster.sharing_policy = simgrid::s4u::Link::SharingPolicy::SPLITDUPLEX;
     break;
   case A_surfxml_cluster_sharing___policy_FATPIPE:
-    cluster.sharing_policy = SURF_LINK_FATPIPE;
+    cluster.sharing_policy = simgrid::s4u::Link::SharingPolicy::FATPIPE;
     break;
   default:
     surf_parse_error(std::string("Invalid cluster sharing policy for cluster ") + cluster.id);
@@ -513,10 +515,10 @@ void ETag_surfxml_cluster(){
   }
   switch (AX_surfxml_cluster_bb___sharing___policy) {
   case A_surfxml_cluster_bb___sharing___policy_FATPIPE:
-    cluster.bb_sharing_policy = SURF_LINK_FATPIPE;
+    cluster.bb_sharing_policy = simgrid::s4u::Link::SharingPolicy::FATPIPE;
     break;
   case A_surfxml_cluster_bb___sharing___policy_SHARED:
-    cluster.bb_sharing_policy = SURF_LINK_SHARED;
+    cluster.bb_sharing_policy = simgrid::s4u::Link::SharingPolicy::SHARED;
     break;
   default:
     surf_parse_error(std::string("Invalid bb sharing policy in cluster ") + cluster.id);
@@ -585,17 +587,17 @@ void ETag_surfxml_link(){
 
   switch (A_surfxml_link_sharing___policy) {
   case A_surfxml_link_sharing___policy_SHARED:
-    link.policy = SURF_LINK_SHARED;
+    link.policy = simgrid::s4u::Link::SharingPolicy::SHARED;
     break;
   case A_surfxml_link_sharing___policy_FATPIPE:
-     link.policy = SURF_LINK_FATPIPE;
-     break;
+    link.policy = simgrid::s4u::Link::SharingPolicy::FATPIPE;
+    break;
   case A_surfxml_link_sharing___policy_FULLDUPLEX:
     XBT_WARN("FULLDUPLEX is now deprecated. Please update your platform file to use SPLITDUPLEX instead.");
-    link.policy = SURF_LINK_SPLITDUPLEX;
+    link.policy = simgrid::s4u::Link::SharingPolicy::SPLITDUPLEX;
     break;
   case A_surfxml_link_sharing___policy_SPLITDUPLEX:
-    link.policy = SURF_LINK_SPLITDUPLEX;
+    link.policy = simgrid::s4u::Link::SharingPolicy::SPLITDUPLEX;
     break;
   default:
     surf_parse_error(std::string("Invalid sharing policy in link ") + link.id);
@@ -607,17 +609,17 @@ void ETag_surfxml_link(){
 
 void STag_surfxml_link___ctn()
 {
-  simgrid::surf::LinkImpl* link = nullptr;
+  simgrid::kernel::resource::LinkImpl* link = nullptr;
   switch (A_surfxml_link___ctn_direction) {
   case AU_surfxml_link___ctn_direction:
   case A_surfxml_link___ctn_direction_NONE:
-    link = simgrid::surf::LinkImpl::byName(A_surfxml_link___ctn_id);
+    link = simgrid::kernel::resource::LinkImpl::byName(A_surfxml_link___ctn_id);
     break;
   case A_surfxml_link___ctn_direction_UP:
-    link = simgrid::surf::LinkImpl::byName(std::string(A_surfxml_link___ctn_id) + "_UP");
+    link = simgrid::kernel::resource::LinkImpl::byName(std::string(A_surfxml_link___ctn_id) + "_UP");
     break;
   case A_surfxml_link___ctn_direction_DOWN:
-    link = simgrid::surf::LinkImpl::byName(std::string(A_surfxml_link___ctn_id) + "_DOWN");
+    link = simgrid::kernel::resource::LinkImpl::byName(std::string(A_surfxml_link___ctn_id) + "_DOWN");
     break;
   default:
     surf_parse_error(std::string("Invalid direction for link ") + A_surfxml_link___ctn_id);
@@ -646,10 +648,10 @@ void ETag_surfxml_backbone(){
   link.id = std::string(A_surfxml_backbone_id);
   link.bandwidth = surf_parse_get_bandwidth(A_surfxml_backbone_bandwidth, "bandwidth of backbone", link.id.c_str());
   link.latency = surf_parse_get_time(A_surfxml_backbone_latency, "latency of backbone", link.id.c_str());
-  link.policy = SURF_LINK_SHARED;
+  link.policy     = simgrid::s4u::Link::SharingPolicy::SHARED;
 
   sg_platf_new_link(&link);
-  routing_cluster_add_backbone(simgrid::surf::LinkImpl::byName(A_surfxml_backbone_id));
+  routing_cluster_add_backbone(simgrid::kernel::resource::LinkImpl::byName(A_surfxml_backbone_id));
 }
 
 void STag_surfxml_route(){