-/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2010-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. */
HostChord::EXTENSION_ID = simgrid::s4u::Host::extension_create<HostChord>();
- std::vector<simgrid::s4u::Host*> list;
- simgrid::s4u::Engine::getInstance()->getHostList(&list);
+ std::vector<simgrid::s4u::Host*> list = simgrid::s4u::Engine::getInstance()->get_all_hosts();
for (auto const& host : list)
host->extension_set(new HostChord(host));
}
int main(int argc, char* argv[])
{
- simgrid::s4u::Engine* e = new simgrid::s4u::Engine(&argc, argv);
+ simgrid::s4u::Engine e(&argc, argv);
xbt_assert(argc > 2, "Usage: %s [-nb_bits=n] [-timeout=t] platform_file deployment_file\n"
"\tExample: %s ../msg_platform.xml chord.xml\n",
argv[0], argv[0]);
options++;
}
- e->loadPlatform(options[0]);
+ e.load_platform(options[0]);
- chord_init();
+ chord_init(); // FIXME: inline me
- e->registerFunction<Node>("node");
- e->loadDeployment(options[1]);
+ e.register_actor<Node>("node");
+ e.load_deployment(options[1]);
- e->run();
+ e.run();
- XBT_INFO("Simulated time: %g", e->getClock());
+ XBT_INFO("Simulated time: %g", e.getClock());
chord_exit();
- delete e;
return 0;
}