]> AND Public Git Repository - simgrid.git/blobdiff - examples/s4u/platform-properties/s4u-platform-properties.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
doc: fix formating and functions signatures
[simgrid.git] / examples / s4u / platform-properties / s4u-platform-properties.cpp
index 12e793d02032ce1b86c3e7e0168a9c3c41d4a37b..d3d173ad2a6a8eb37c0e808a5cc04f2a979da6af 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017-2019. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2017-2020. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -84,13 +84,13 @@ static void david(std::vector<std::string> /*args*/)
 static void bob(std::vector<std::string> /*args*/)
 {
   /* this host also tests the properties of the AS*/
-  simgrid::s4u::NetZone* root = simgrid::s4u::Engine::get_instance()->get_netzone_root();
+  const simgrid::s4u::NetZone* root = simgrid::s4u::Engine::get_instance()->get_netzone_root();
   XBT_INFO("== Print the properties of the root zone");
   XBT_INFO("   Zone property: filename -> %s", root->get_property("filename"));
   XBT_INFO("   Zone property: date -> %s", root->get_property("date"));
   XBT_INFO("   Zone property: author -> %s", root->get_property("author"));
 
-  /* Get the property list of current bob process */
+  /* Get the property list of current bob actor */
   const std::unordered_map<std::string, std::string>* props = simgrid::s4u::Actor::self()->get_properties();
   const char* noexist = "UnknownProcessProp";
   XBT_ATTRIB_UNUSED const char* value;
@@ -119,8 +119,8 @@ int main(int argc, char* argv[])
 
   XBT_INFO("There are %zu hosts in the environment", totalHosts);
   std::vector<simgrid::s4u::Host*> hosts = e.get_all_hosts();
-  for (unsigned int i = 0; i < hosts.size(); i++)
-    XBT_INFO("Host '%s' runs at %.0f flops/s", hosts[i]->get_cname(), hosts[i]->get_speed());
+  for (simgrid::s4u::Host const* host : hosts)
+    XBT_INFO("Host '%s' runs at %.0f flops/s", host->get_cname(), host->get_speed());
 
   e.load_deployment(argv[2]);
   e.run();