Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of framagit.org:simgrid/simgrid
[simgrid.git] / examples / cpp / io-disk-raw / s4u-io-disk-raw.cpp
index 5498513..8bd9564 100644 (file)
@@ -12,11 +12,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(disk_test, "Messages specific for this simulation")
 static void host()
 {
   /* -Add an extra disk in a programmatic way */
-  simgrid::s4u::Host::current()->create_disk()
-       ->set_name("Disk3")
-       ->set_read_bandwidth(9.6e7)
-       ->set_write_bandwidth(6.4e7)
-       ->seal();
+  simgrid::s4u::Host::current()->create_disk("Disk3", /*read bandwidth*/ 9.6e7, /*write bandwidth*/6.4e7)->seal();
 
   /* - Display information on the disks mounted by the current host */
   XBT_INFO("*** Storage info on %s ***", simgrid::s4u::Host::current()->get_cname());
@@ -39,8 +35,8 @@ static void host()
   XBT_INFO("Read %llu bytes on '%s'", read, disk->get_cname());
 
   /* - Write 800,000 bytes on Disk3 */
-  simgrid::s4u::Disk* disk3 = disk_list.back();
-  sg_size_t write_on_disk3  = disk3->write(800000);
+  const simgrid::s4u::Disk* disk3 = disk_list.back();
+  sg_size_t write_on_disk3        = disk3->write(800000);
   XBT_INFO("Wrote %llu bytes on '%s'", write_on_disk3, disk3->get_cname());
 
   /* - Attach some user data to disk1 */