-/* Copyright (c) 2013-2022. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2013-2023. 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. */
{
XBT_INFO("*** GET/SET DATA for disk: %s ***", disk->get_cname());
- const std::string* data = disk->get_data<std::string>();
+ auto data = disk->get_unique_data<std::string>();
XBT_INFO("Get data: '%s'", data ? data->c_str() : "No User Data");
disk->set_data(new std::string("Some data"));
- data = disk->get_data<std::string>();
+ data = disk->get_unique_data<std::string>();
XBT_INFO(" Set and get data: '%s'", data->c_str());
- delete data;
}
static void dump_platform_disks()
{
- for (auto const& h : simgrid::s4u::Engine::get_instance()->get_all_hosts())
- for (auto const& d : h->get_disks()) {
+ for (auto const* h : simgrid::s4u::Engine::get_instance()->get_all_hosts())
+ for (auto* d : h->get_disks()) {
if (h == d->get_host())
XBT_INFO("%s is attached to %s", d->get_cname(), d->get_host()->get_cname());
d->set_property("other usage", "gpfs");
{
XBT_INFO("*** Disk info on %s ***", host->get_cname());
- for (auto const& disk : host->get_disks()) {
+ for (auto const* disk : host->get_disks()) {
const char* mount_name = sg_disk_get_mount_point(disk);
XBT_INFO(" Disk name: %s, mount name: %s", disk->get_cname(), mount_name);