X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/084ad52d4bc9b1c53f08795703e7fe2d0ada7764..8c416e92254512408c1d0ce729e8d3cf82ec9938:/examples/s4u/platform-properties/s4u-platform-properties.cpp diff --git a/examples/s4u/platform-properties/s4u-platform-properties.cpp b/examples/s4u/platform-properties/s4u-platform-properties.cpp index 307a941853..a5c6c53a6c 100644 --- a/examples/s4u/platform-properties/s4u-platform-properties.cpp +++ b/examples/s4u/platform-properties/s4u-platform-properties.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2017-2018. 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. */ @@ -78,7 +78,7 @@ static int bob(int argc, char* argv[]) XBT_INFO(" Zone property: author -> %s", root->getProperty("author")); /* Get the property list of current bob process */ - std::map* props = simgrid::s4u::Actor::self()->getProperties(); + std::map* props = simgrid::s4u::Actor::self()->get_properties(); const char* noexist = "UnknownProcessProp"; XBT_ATTRIB_UNUSED const char* value; @@ -88,30 +88,29 @@ static int bob(int argc, char* argv[]) XBT_INFO("== Try to get an actor property that does not exist"); - value = simgrid::s4u::Actor::self()->getProperty(noexist); - xbt_assert(not value, "The property is defined (it shouldnt)"); + value = simgrid::s4u::Actor::self()->get_property(noexist); + xbt_assert(not value, "The property is defined (it should not)"); return 0; } int main(int argc, char* argv[]) { simgrid::s4u::Engine e(&argc, argv); - e.loadPlatform(argv[1]); + e.load_platform(argv[1]); - e.registerFunction("alice", alice); - e.registerFunction("bob", bob); - e.registerFunction("carole", carole); - e.registerFunction("david", david); + e.register_function("alice", alice); + e.register_function("bob", bob); + e.register_function("carole", carole); + e.register_function("david", david); size_t totalHosts = sg_host_count(); XBT_INFO("There are %zu hosts in the environment", totalHosts); - simgrid::s4u::Host** hosts = sg_host_list(); - for (unsigned int i = 0; i < totalHosts; i++) - XBT_INFO("Host '%s' runs at %.0f flops/s", hosts[i]->getCname(), hosts[i]->getSpeed()); - xbt_free(hosts); + std::vector 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]->getSpeed()); - e.loadDeployment(argv[2]); + e.load_deployment(argv[2]); e.run(); return 0;