]> AND Public Git Repository - simgrid.git/blobdiff - src/kernel/resource/DiskImpl.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'Adrien.Gougeon/simgrid-master'
[simgrid.git] / src / kernel / resource / DiskImpl.cpp
index 5f2a72c9cbf86f31f2179082e098070189e146b0..6e4ffcf9ae922b9df68b91a7f0066827bcd9fb85 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2019. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2019-2020. 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. */
@@ -38,10 +38,12 @@ DiskModel::~DiskModel()
 DiskImpl::DiskImpl(kernel::resource::Model* model, const std::string& name, kernel::lmm::System* maxminSystem,
                    double read_bw, double write_bw)
     : Resource(model, name, maxminSystem->constraint_new(this, std::max(read_bw, write_bw)))
-// FIXME    , piface_(name, this)
+    , piface_(name, this)
+    , read_bw_(read_bw)
+    , write_bw_(write_bw)
 {
   DiskImpl::turn_on();
-  XBT_DEBUG("Create resource with read_bw '%f' write_bw '%f'", read_bw, write_bw);
+  XBT_DEBUG("Create resource with read_bw '%f' write_bw '%f'", read_bw_, write_bw_);
   constraint_read_  = maxminSystem->constraint_new(this, read_bw);
   constraint_write_ = maxminSystem->constraint_new(this, write_bw);
 }
@@ -59,12 +61,12 @@ void DiskImpl::destroy()
 {
   if (not currently_destroying_) {
     currently_destroying_ = true;
-    // FIXME s4u::Storage::on_destruction(this->piface_);
+    s4u::Disk::on_destruction(this->piface_);
     delete this;
   }
 }
 
-bool DiskImpl::is_used()
+bool DiskImpl::is_used() const
 {
   THROW_UNIMPLEMENTED;
 }
@@ -78,19 +80,18 @@ void DiskImpl::turn_on()
 {
   if (not is_on()) {
     Resource::turn_on();
-    // FIXME s4u::Storage::on_state_change(this->piface_);
+    s4u::Disk::on_state_change(this->piface_);
   }
 }
 void DiskImpl::turn_off()
 {
   if (is_on()) {
     Resource::turn_off();
-    // FIXME s4u::Storage::on_state_change(this->piface_);
+    s4u::Disk::on_state_change(this->piface_);
   }
 }
 
-xbt::signal<void(DiskAction const&, kernel::resource::Action::State, kernel::resource::Action::State)>
-    DiskAction::on_state_change;
+xbt::signal<void(DiskAction const&, Action::State, Action::State)> DiskAction::on_state_change;
 
 /**********
  * Action *