Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
NetZone::get_netpoint: gets the netzone's netpoint
authorBruno Donassolo <bruno.donassolo@inria.fr>
Wed, 21 Apr 2021 18:35:03 +0000 (20:35 +0200)
committerBruno Donassolo <bruno.donassolo@inria.fr>
Fri, 23 Apr 2021 08:39:06 +0000 (10:39 +0200)
New method to get the netpoint used by netzones.
Usefull when describing routes using the netzones (add_route method)

include/simgrid/kernel/routing/NetZoneImpl.hpp
include/simgrid/s4u/NetZone.hpp
src/s4u/s4u_Netzone.cpp

index 7ad5dc4..f164487 100644 (file)
@@ -125,6 +125,9 @@ public:
   /** @brief Retrieves the name of that netzone as a C string */
   const char* get_cname() const { return name_.c_str(); };
 
+  /** @brief Gets the netpoint associated to this netzone */
+  kernel::routing::NetPoint* get_netpoint() const { return netpoint_; }
+
   std::vector<s4u::Host*> get_all_hosts() const;
   int get_host_count() const;
 
index d030e4f..eef4025 100644 (file)
@@ -54,6 +54,8 @@ public:
   /** Retrieve the property value (or nullptr if not set) */
   const char* get_property(const std::string& key) const;
   void set_property(const std::string& key, const std::string& value);
+  /** @brief Get the netpoint associated to this netzone */
+  kernel::routing::NetPoint* get_netpoint();
 
   std::vector<NetZone*> get_children() const;
   XBT_ATTRIB_DEPRECATED_v332("Please use set_parent() to manage NetZone's relationship") NetZone* add_child(
index 61879cd..90dedc8 100644 (file)
@@ -200,6 +200,10 @@ kernel::routing::NetPoint* NetZone::create_router(const std::string& name)
   return kernel::actor::simcall([this, &name] { return pimpl_->create_router(name); });
 }
 
+kernel::routing::NetPoint* NetZone::get_netpoint()
+{
+  return pimpl_->get_netpoint();
+}
 } // namespace s4u
 } // namespace simgrid