Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
snake case another plugin
[simgrid.git] / src / surf / xml / platf_private.hpp
index 895291d..8ae587d 100644 (file)
 #define SG_PLATF_H
 
 #include "simgrid/host.h"
+#include "simgrid/s4u/Link.hpp"
 #include "src/surf/xml/platf.hpp"
+#include "src/surf/xml/simgrid_dtd.h"
+
 #include <map>
 #include <string>
 #include <vector>
@@ -37,7 +40,7 @@ struct HostCreationArgs {
   tmgr_trace_t speed_trace = nullptr;
   tmgr_trace_t state_trace = nullptr;
   const char* coord        = nullptr;
-  std::map<std::string, std::string>* properties = nullptr;
+  std::unordered_map<std::string, std::string>* properties = nullptr;
 };
 
 class HostLinkCreationArgs {
@@ -55,8 +58,8 @@ public:
   double latency                      = 0;
   tmgr_trace_t latency_trace          = nullptr;
   tmgr_trace_t state_trace            = nullptr;
-  e_surf_link_sharing_policy_t policy = SURF_LINK_FATPIPE;
-  std::map<std::string, std::string>* properties = nullptr;
+  simgrid::s4u::Link::SharingPolicy policy       = simgrid::s4u::Link::SharingPolicy::FATPIPE;
+  std::unordered_map<std::string, std::string>* properties = nullptr;
 };
 
 class PeerCreationArgs {
@@ -72,12 +75,12 @@ public:
 
 class RouteCreationArgs {
 public:
-  bool symmetrical     = false;
-  sg_netpoint_t src    = nullptr;
-  sg_netpoint_t dst    = nullptr;
-  sg_netpoint_t gw_src = nullptr;
-  sg_netpoint_t gw_dst = nullptr;
-  std::vector<simgrid::surf::LinkImpl*> link_list;
+  bool symmetrical = false;
+  NetPoint* src    = nullptr;
+  NetPoint* dst    = nullptr;
+  NetPoint* gw_src = nullptr;
+  NetPoint* gw_dst = nullptr;
+  std::vector<simgrid::kernel::resource::LinkImpl*> link_list;
 };
 
 enum class ClusterTopology { DRAGONFLY = 3, FAT_TREE = 2, FLAT = 1, TORUS = 0 };
@@ -99,10 +102,10 @@ public:
   double limiter_link = 0;
   ClusterTopology topology;
   std::string topo_parameters;
-  std::map<std::string, std::string>* properties;
+  std::unordered_map<std::string, std::string>* properties;
   std::string router_id;
-  e_surf_link_sharing_policy_t sharing_policy;
-  e_surf_link_sharing_policy_t bb_sharing_policy;
+  simgrid::s4u::Link::SharingPolicy sharing_policy;
+  simgrid::s4u::Link::SharingPolicy bb_sharing_policy;
 };
 
 class CabinetCreationArgs {
@@ -121,7 +124,7 @@ public:
   std::string id;
   std::string type_id;
   std::string content;
-  std::map<std::string, std::string>* properties;
+  std::unordered_map<std::string, std::string>* properties;
   std::string attach;
 };
 
@@ -130,8 +133,8 @@ public:
   std::string id;
   std::string model;
   std::string content;
-  std::map<std::string, std::string>* properties;
-  std::map<std::string, std::string>* model_properties;
+  std::unordered_map<std::string, std::string>* properties;
+  std::unordered_map<std::string, std::string>* model_properties;
   sg_size_t size;
 };
 
@@ -163,7 +166,7 @@ enum class ActorOnFailure { DIE, RESTART }; // FIXME: move to a better namespace
 class ActorCreationArgs {
 public:
   std::vector<std::string> args;
-  std::map<std::string, std::string>* properties = nullptr;
+  std::unordered_map<std::string, std::string>* properties = nullptr;
   const char* host                       = nullptr;
   const char* function                   = nullptr;
   double start_time                      = 0.0;
@@ -178,21 +181,10 @@ public:
 };
 }}}
 
-extern "C" {
-#include "src/surf/xml/simgrid_dtd.h"
-
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
 /********** Routing **********/
-void routing_cluster_add_backbone(simgrid::surf::LinkImpl* bb);
+void routing_cluster_add_backbone(simgrid::kernel::resource::LinkImpl* bb);
 /*** END of the parsing cruft ***/
 
-XBT_PUBLIC void sg_platf_begin(); // Start a new platform
-XBT_PUBLIC void sg_platf_end();   // Finish the creation of the platform
-
 XBT_PUBLIC simgrid::s4u::NetZone* sg_platf_new_Zone_begin(simgrid::kernel::routing::ZoneCreationArgs* zone); // Begin description of new Zone
 XBT_PUBLIC void sg_platf_new_Zone_seal();                                          // That Zone is fully described
 
@@ -230,7 +222,6 @@ XBT_PUBLIC void surf_parse_set_out(FILE* out_str);
 XBT_PUBLIC int surf_parse_get_debug();
 XBT_PUBLIC void surf_parse_set_debug(int bdebug);
 XBT_PUBLIC int surf_parse_lex_destroy();
-}
 
 namespace simgrid {
 namespace surf {