Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Constify get_properties() and and remove simcalls.
[simgrid.git] / src / s4u / s4u_Host.cpp
index b2731c4..2af9129 100644 (file)
@@ -132,22 +132,6 @@ int Host::get_actor_count()
   return pimpl_->get_actor_count();
 }
 
-/** @deprecated */
-void Host::getProcesses(std::vector<ActorPtr>* list)
-{
-  auto actors = get_all_actors();
-  for (auto& actor : actors)
-    list->push_back(actor);
-}
-
-/** @deprecated */
-void Host::actorList(std::vector<ActorPtr>* whereto)
-{
-  auto actors = get_all_actors();
-  for (auto& actor : actors)
-    whereto->push_back(actor);
-}
-
 /**
  * @brief Find a route toward another host
  *
@@ -181,9 +165,9 @@ void Host::route_to(Host* dest, std::vector<kernel::resource::LinkImpl*>& links,
 }
 
 /** Get the properties assigned to a host */
-std::unordered_map<std::string, std::string>* Host::get_properties()
+const std::unordered_map<std::string, std::string>* Host::get_properties() const
 {
-  return simix::simcall([this] { return this->pimpl_->get_properties(); });
+  return this->pimpl_->get_properties();
 }
 
 /** Retrieve the property value (or nullptr if not set) */
@@ -283,13 +267,6 @@ std::vector<const char*> Host::get_attached_storages() const
   return simix::simcall([this] { return this->pimpl_->get_attached_storages(); });
 }
 
-void Host::getAttachedStorages(std::vector<const char*>* storages)
-{
-  std::vector<const char*> local_storages = simix::simcall([this] { return this->pimpl_->get_attached_storages(); });
-  for (auto elm : local_storages)
-    storages->push_back(elm);
-}
-
 std::unordered_map<std::string, Storage*> const& Host::get_mounted_storages()
 {
   if (mounts_ == nullptr) {
@@ -528,7 +505,7 @@ int sg_host_is_off(sg_host_t host)
 xbt_dict_t sg_host_get_properties(sg_host_t host)
 {
   xbt_dict_t as_dict = xbt_dict_new_homogeneous(xbt_free_f);
-  std::unordered_map<std::string, std::string>* props = host->get_properties();
+  const std::unordered_map<std::string, std::string>* props = host->get_properties();
   if (props == nullptr)
     return nullptr;
   for (auto const& elm : *props) {
@@ -607,7 +584,7 @@ void sg_host_dump(sg_host_t host)
   XBT_INFO("Displaying host %s", host->get_cname());
   XBT_INFO("  - speed: %.0f", host->get_speed());
   XBT_INFO("  - available speed: %.2f", sg_host_get_available_speed(host));
-  std::unordered_map<std::string, std::string>* props = host->get_properties();
+  const std::unordered_map<std::string, std::string>* props = host->get_properties();
 
   if (not props->empty()) {
     XBT_INFO("  - properties:");