X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8c416e92254512408c1d0ce729e8d3cf82ec9938..c3748da7e2fdd4498c4e2e8f4aaa7b4151c14e75:/examples/s4u/io-storage-raw/s4u-io-storage-raw.cpp diff --git a/examples/s4u/io-storage-raw/s4u-io-storage-raw.cpp b/examples/s4u/io-storage-raw/s4u-io-storage-raw.cpp index e73b588230..d076f87565 100644 --- a/examples/s4u/io-storage-raw/s4u-io-storage-raw.cpp +++ b/examples/s4u/io-storage-raw/s4u-io-storage-raw.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017-2018. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2017-2019. 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. */ @@ -16,14 +16,14 @@ static void host() /* - Retrieve all mount points of current host */ std::unordered_map const& storage_list = - simgrid::s4u::Host::current()->getMountedStorages(); + simgrid::s4u::Host::current()->get_mounted_storages(); /* - For each disk mounted on host, display disk name and mount point */ for (auto const& kv : storage_list) XBT_INFO("Storage name: %s, mount name: %s", kv.second->get_cname(), kv.first.c_str()); /* - Write 200,000 bytes on Disk4 */ - simgrid::s4u::Storage* storage = simgrid::s4u::Storage::byName("Disk4"); + simgrid::s4u::Storage* storage = simgrid::s4u::Storage::by_name("Disk4"); sg_size_t write = storage->write(200000); XBT_INFO("Wrote %llu bytes on 'Disk4'", write); @@ -34,12 +34,12 @@ static void host() /* - Attach some user data to disk1 */ XBT_INFO("*** Get/set data for storage element: Disk4 ***"); - std::string* data = static_cast(storage->getUserdata()); + std::string* data = static_cast(storage->get_data()); XBT_INFO("Get storage data: '%s'", data ? data->c_str() : "No user data"); - storage->setUserdata(new std::string("Some user data")); - data = static_cast(storage->getUserdata()); + storage->set_data(new std::string("Some user data")); + data = static_cast(storage->get_data()); XBT_INFO("Set and get data: '%s'", data->c_str()); delete data; } @@ -52,7 +52,7 @@ int main(int argc, char** argv) simgrid::s4u::Actor::create("", simgrid::s4u::Host::by_name("denise"), host); e.run(); - XBT_INFO("Simulated time: %g", simgrid::s4u::Engine::getClock()); + XBT_INFO("Simulated time: %g", simgrid::s4u::Engine::get_clock()); return 0; }