Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Constify pointer and reference parameters in src/s4u/.
[simgrid.git] / src / kernel / resource / DiskImpl.hpp
index 80ae7a6..bc1a65f 100644 (file)
@@ -8,8 +8,8 @@
 #include "simgrid/kernel/resource/Resource.hpp"
 #include "simgrid/s4u/Disk.hpp"
 #include "simgrid/s4u/Io.hpp"
-#include "src/surf/PropertyHolder.hpp"
 #include "src/surf/surf_interface.hpp"
+#include <xbt/PropertyHolder.hpp>
 
 #include <map>
 
@@ -47,9 +47,12 @@ public:
 /************
  * Resource *
  ************/
-class DiskImpl : public Resource, public surf::PropertyHolder {
+class DiskImpl : public Resource, public xbt::PropertyHolder {
   bool currently_destroying_ = false;
   s4u::Host* host_           = nullptr;
+  s4u::Disk piface_;
+  double read_bw_;
+  double write_bw_;
 
 public:
   DiskImpl(Model* model, const std::string& name, kernel::lmm::System* maxmin_system, double read_bw, double bwrite_bw);
@@ -59,8 +62,10 @@ public:
   ~DiskImpl() override;
 
   /** @brief Public interface */
-  s4u::Disk piface_;
   s4u::Disk* get_iface() { return &piface_; }
+  double get_read_bandwidth() { return read_bw_; }
+  double get_write_bandwidth() { return write_bw_; }
+
   /** @brief Check if the Storage is used (if an action currently uses its resources) */
   bool is_used() override;
 
@@ -69,7 +74,7 @@ public:
   void turn_on() override;
   void turn_off() override;
 
-  s4u::Host* get_host() { return host_; }
+  s4u::Host* get_host() const { return host_; }
   void set_host(s4u::Host* host) { host_ = host; }
 
   void destroy(); // Must be called instead of the destructor