Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
further snake_case in routing
[simgrid.git] / src / s4u / s4u_host.cpp
index 38b14b2..5342c54 100644 (file)
@@ -103,7 +103,7 @@ void Host::turnOn() {
   if (isOff()) {
     simgrid::simix::kernelImmediate([this] {
       this->extension<simgrid::simix::Host>()->turnOn();
-      this->pimpl_cpu->turnOn();
+      this->pimpl_cpu->turn_on();
       onStateChange(*this);
     });
   }
@@ -120,7 +120,7 @@ void Host::turnOff() {
 }
 
 bool Host::isOn() {
-  return this->pimpl_cpu->isOn();
+  return this->pimpl_cpu->is_on();
 }
 
 int Host::getPstatesCount() const
@@ -163,12 +163,12 @@ void Host::routeTo(Host* dest, std::vector<Link*>& links, double* latency)
 /** @brief Just like Host::routeTo, but filling an array of link implementations */
 void Host::routeTo(Host* dest, std::vector<surf::LinkImpl*>& links, double* latency)
 {
-  simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(pimpl_netpoint, dest->pimpl_netpoint, links, latency);
+  simgrid::kernel::routing::NetZoneImpl::get_global_route(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()
@@ -264,7 +270,7 @@ void Host::execute(double flops)
 
 double Host::getLoad()
 {
-  return this->pimpl_cpu->getLoad();
+  return this->pimpl_cpu->get_load();
 }
 
 } // namespace simgrid