Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Factory functions for all Netzones
authorBruno Donassolo <bruno.donassolo@inria.fr>
Thu, 1 Apr 2021 12:16:52 +0000 (14:16 +0200)
committerBruno Donassolo <bruno.donassolo@inria.fr>
Thu, 1 Apr 2021 15:28:59 +0000 (17:28 +0200)
include/simgrid/s4u/NetZone.hpp
src/kernel/routing/ClusterZone.cpp
src/kernel/routing/DijkstraZone.cpp
src/kernel/routing/DragonflyZone.cpp
src/kernel/routing/EmptyZone.cpp
src/kernel/routing/FatTreeZone.cpp
src/kernel/routing/FloydZone.cpp
src/kernel/routing/FullZone.cpp
src/kernel/routing/TorusZone.cpp
src/kernel/routing/VivaldiZone.cpp
src/kernel/routing/WifiZone.cpp

index 6ad381c..b3d814c 100644 (file)
@@ -78,6 +78,18 @@ public:
   static xbt::signal<void(NetZone const&)> on_seal;
 };
 
+// External constructors so that the types (and the types of their content) remain hidden
+XBT_PUBLIC NetZone* createFullZone(const std::string& name);
+XBT_PUBLIC NetZone* createClusterZone(const std::string& name);
+XBT_PUBLIC NetZone* createDijkstraZone(const std::string& name, bool cache);
+XBT_PUBLIC NetZone* createDragonflyZone(const std::string& name);
+XBT_PUBLIC NetZone* createEmptyZone(const std::string& name);
+XBT_PUBLIC NetZone* createFatTreeZone(const std::string& name);
+XBT_PUBLIC NetZone* createFloydZone(const std::string& name);
+XBT_PUBLIC NetZone* createTorusZone(const std::string& name);
+XBT_PUBLIC NetZone* createVivaldiZone(const std::string& name);
+XBT_PUBLIC NetZone* createWifiZone(const std::string& name);
+
 } // namespace s4u
 } // namespace simgrid
 
index 23b711d..0df128e 100644 (file)
@@ -161,4 +161,12 @@ void ClusterZone::create_links_for_node(ClusterCreationArgs* cluster, int id, in
 }
 } // namespace routing
 } // namespace kernel
+
+namespace s4u {
+NetZone* createClusterZone(const std::string& name)
+{
+  return (new kernel::routing::ClusterZone(name))->get_iface();
+}
+} // namespace s4u
+
 } // namespace simgrid
index 0a4c855..1c6d30f 100644 (file)
@@ -258,4 +258,12 @@ void DijkstraZone::new_edge(int src_id, int dst_id, RouteCreationArgs* route)
 }
 } // namespace routing
 } // namespace kernel
+
+namespace s4u {
+NetZone* createDijkstraZone(const std::string& name, bool cache)
+{
+  return (new kernel::routing::DijkstraZone(name, cache))->get_iface();
+}
+} // namespace s4u
+
 } // namespace simgrid
index c8d532f..6fbc551 100644 (file)
@@ -346,4 +346,12 @@ void DragonflyZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationA
 }
 } // namespace routing
 } // namespace kernel
+
+namespace s4u {
+NetZone* createDragonflyZone(const std::string& name)
+{
+  return (new kernel::routing::DragonflyZone(name))->get_iface();
+}
+} // namespace s4u
+
 } // namespace simgrid
index ea70371..229caf0 100644 (file)
@@ -22,4 +22,12 @@ void EmptyZone::get_graph(const s_xbt_graph_t* /*graph*/, std::map<std::string,
 }
 } // namespace routing
 } // namespace kernel
+
+namespace s4u {
+NetZone* createEmptyZone(const std::string& name)
+{
+  return (new kernel::routing::EmptyZone(name))->get_iface();
+}
+} // namespace s4u
+
 } // namespace simgrid
index 0c4ee2f..02d73c7 100644 (file)
@@ -474,4 +474,12 @@ FatTreeLink::FatTreeLink(const ClusterCreationArgs* cluster, FatTreeNode* downNo
 }
 } // namespace routing
 } // namespace kernel
+
+namespace s4u {
+NetZone* createFatTreeZone(const std::string& name)
+{
+  return (new kernel::routing::FatTreeZone(name))->get_iface();
+}
+} // namespace s4u
+
 } // namespace simgrid
index 45b0d65..4fffad4 100644 (file)
@@ -169,4 +169,12 @@ void FloydZone::do_seal()
 }
 } // namespace routing
 } // namespace kernel
+
+namespace s4u {
+NetZone* createFloydZone(const std::string& name)
+{
+  return (new kernel::routing::FloydZone(name))->get_iface();
+}
+} // namespace s4u
+
 } // namespace simgrid
index 2978471..72d301f 100644 (file)
@@ -107,4 +107,12 @@ void FullZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoin
 }
 } // namespace routing
 } // namespace kernel
+
+namespace s4u {
+NetZone* createFullZone(const std::string& name)
+{
+  return (new kernel::routing::FullZone(name))->get_iface();
+}
+} // namespace s4u
+
 } // namespace simgrid
index 2a2d218..5471e5a 100644 (file)
@@ -183,4 +183,12 @@ void TorusZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs*
 }
 } // namespace routing
 } // namespace kernel
+
+namespace s4u {
+NetZone* createTorusZone(const std::string& name)
+{
+  return (new kernel::routing::TorusZone(name))->get_iface();
+}
+} // namespace s4u
+
 } // namespace simgrid
index 76e9883..8035418 100644 (file)
@@ -119,4 +119,12 @@ void VivaldiZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArg
 }
 } // namespace routing
 } // namespace kernel
+
+namespace s4u {
+NetZone* createVivaldiZone(const std::string& name)
+{
+  return (new kernel::routing::VivaldiZone(name))->get_iface();
+}
+} // namespace s4u
+
 } // namespace simgrid
index a6f8bc7..7071075 100644 (file)
@@ -66,4 +66,12 @@ s4u::Link* WifiZone::create_link(const std::string& name, const std::vector<doub
 }
 } // namespace routing
 } // namespace kernel
+
+namespace s4u {
+NetZone* createWifiZone(const std::string& name)
+{
+  return (new kernel::routing::WifiZone(name))->get_iface();
+}
+} // namespace s4u
+
 } // namespace simgrid