Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
convert getCname to get_cname
[simgrid.git] / src / s4u / s4u_host.cpp
index 2e25a3d..5cb5695 100644 (file)
@@ -9,11 +9,11 @@
 
 #include <map>
 
+#include "simgrid/kernel/routing/NetPoint.hpp"
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/Host.hpp"
 #include "simgrid/s4u/Storage.hpp"
 #include "simgrid/simix.hpp"
-#include "src/kernel/routing/NetPoint.hpp"
 #include "src/msg/msg_private.hpp"
 #include "src/simix/ActorImpl.hpp"
 #include "src/simix/smx_private.hpp"
@@ -165,10 +165,10 @@ void Host::routeTo(Host* dest, std::vector<surf::LinkImpl*>& links, double* late
 {
   simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(pimpl_netpoint, dest->pimpl_netpoint, links, latency);
   if (XBT_LOG_ISENABLED(surf_route, xbt_log_priority_debug)) {
-    XBT_CDEBUG(surf_route, "Route from '%s' to '%s' (latency: %f):", getCname(), dest->getCname(),
+    XBT_CDEBUG(surf_route, "Route from '%s' to '%s' (latency: %f):", get_cname(), dest->get_cname(),
                (latency == nullptr ? -1 : *latency));
     for (auto const& link : links)
-      XBT_CDEBUG(surf_route, "Link %s", link->getCname());
+      XBT_CDEBUG(surf_route, "Link %s", link->get_cname());
   }
 }
 
@@ -235,11 +235,17 @@ int Host::getPstate()
  * \brief Returns the list of storages attached to an host.
  * \return a vector containing all storages attached to the host
  */
+std::vector<const char*> Host::get_attached_storages()
+{
+  return simgrid::simix::kernelImmediate([this] { return this->pimpl_->get_attached_storages(); });
+}
+
 void Host::getAttachedStorages(std::vector<const char*>* storages)
 {
-  simgrid::simix::kernelImmediate([this, storages] {
-     this->pimpl_->getAttachedStorageList(storages);
-  });
+  std::vector<const char*> local_storages =
+      simgrid::simix::kernelImmediate([this] { return this->pimpl_->get_attached_storages(); });
+  for (auto elm : local_storages)
+    storages->push_back(elm);
 }
 
 std::unordered_map<std::string, Storage*> const& Host::getMountedStorages()