// Test attaching some user data to the file
file->set_data(new std::string("777"));
- const auto* file_data = file->get_data<std::string>();
+ auto file_data = file->get_unique_data<std::string>();
XBT_INFO("User data attached to the file: %s", file_data->c_str());
- delete file_data;
// Close the file
file->close();
{
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()