From: Martin Quinson Date: Tue, 21 Nov 2017 15:15:58 +0000 (+0100) Subject: allow to retrieve the link list from the Engine X-Git-Tag: v3.18~275 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/79ba0e25e50b8ecaf5fd4df7ca4fd39e6e3ac232?hp=ed06a04349269c97969b549f83f73d718246cc13 allow to retrieve the link list from the Engine --- diff --git a/include/simgrid/s4u/Engine.hpp b/include/simgrid/s4u/Engine.hpp index e705bab613..805a309301 100644 --- a/include/simgrid/s4u/Engine.hpp +++ b/include/simgrid/s4u/Engine.hpp @@ -58,6 +58,8 @@ public: size_t getHostCount(); void getHostList(std::vector * whereTo); + size_t getLinkCount(); + void getLinkList(std::vector * list); /** @brief Run the simulation */ void run(); diff --git a/src/s4u/s4u_engine.cpp b/src/s4u/s4u_engine.cpp index c16b189cf7..886cc33a91 100644 --- a/src/s4u/s4u_engine.cpp +++ b/src/s4u/s4u_engine.cpp @@ -93,6 +93,16 @@ void Engine::getHostList(std::vector* list) for (auto const& kv : host_list) list->push_back(kv.second); } +/** @brief Returns the amount of links in the platform */ +size_t Engine::getLinkCount() +{ + return simgrid::surf::LinkImpl::linksCount(); +} +/** @brief Fills the passed list with all hosts found in the platform */ +void Engine::getLinkList(std::vector* list) +{ + simgrid::surf::LinkImpl::linksList(list); +} void Engine::run() { if (MC_is_active()) {