Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Scheduling slightly changed.
[simgrid.git] / teshsuite / s4u / storage_client_server / storage_client_server.cpp
index 30eec583847e9916e5c0c3e13e37029a7a2a03a1..86821976260d0de254476e5f05f27e28a89a43e3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2013-2022. 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. */
@@ -74,10 +74,10 @@ static void get_set_disk_data(simgrid::s4u::Disk* disk)
 {
   XBT_INFO("*** GET/SET DATA for disk: %s ***", disk->get_cname());
 
-  const std::string* data = static_cast<std::string*>(disk->get_data());
+  const std::string* data = disk->get_data<std::string>();
   XBT_INFO("Get data: '%s'", data ? data->c_str() : "No User Data");
   disk->set_data(new std::string("Some data"));
-  data = static_cast<std::string*>(disk->get_data());
+  data = disk->get_data<std::string>();
   XBT_INFO("  Set and get data: '%s'", data->c_str());
   delete data;
 }
@@ -149,8 +149,8 @@ int main(int argc, char* argv[])
   xbt_assert(argc == 2, "Usage: %s platform_file\n", argv[0]);
   e.load_platform(argv[1]);
 
-  simgrid::s4u::Actor::create("server", simgrid::s4u::Host::by_name("alice"), server);
-  simgrid::s4u::Actor::create("client", simgrid::s4u::Host::by_name("bob"), client);
+  simgrid::s4u::Actor::create("server", e.host_by_name("alice"), server);
+  simgrid::s4u::Actor::create("client", e.host_by_name("bob"), client);
 
   e.run();