From: Bruno Donassolo Date: Wed, 21 Apr 2021 18:35:03 +0000 (+0200) Subject: NetZone::get_netpoint: gets the netzone's netpoint X-Git-Tag: v3.28~415 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1910eb3996b33f7e42fea6b093485600e04a567a NetZone::get_netpoint: gets the netzone's netpoint New method to get the netpoint used by netzones. Usefull when describing routes using the netzones (add_route method) --- diff --git a/include/simgrid/kernel/routing/NetZoneImpl.hpp b/include/simgrid/kernel/routing/NetZoneImpl.hpp index 7ad5dc4ae2..f164487f55 100644 --- a/include/simgrid/kernel/routing/NetZoneImpl.hpp +++ b/include/simgrid/kernel/routing/NetZoneImpl.hpp @@ -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 get_all_hosts() const; int get_host_count() const; diff --git a/include/simgrid/s4u/NetZone.hpp b/include/simgrid/s4u/NetZone.hpp index d030e4ff9e..eef40258e4 100644 --- a/include/simgrid/s4u/NetZone.hpp +++ b/include/simgrid/s4u/NetZone.hpp @@ -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 get_children() const; XBT_ATTRIB_DEPRECATED_v332("Please use set_parent() to manage NetZone's relationship") NetZone* add_child( diff --git a/src/s4u/s4u_Netzone.cpp b/src/s4u/s4u_Netzone.cpp index 61879cdfe0..90dedc88c7 100644 --- a/src/s4u/s4u_Netzone.cpp +++ b/src/s4u/s4u_Netzone.cpp @@ -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