+class DiskImpl : public Resource_T<DiskImpl>, public xbt::PropertyHolder {
+ s4u::Disk piface_;
+ s4u::Host* host_ = nullptr;
+ lmm::Constraint* constraint_write_ = nullptr; /* Constraint for maximum write bandwidth*/
+ lmm::Constraint* constraint_read_ = nullptr; /* Constraint for maximum read bandwidth*/
+ std::unordered_map<s4u::Disk::Operation, s4u::Disk::SharingPolicy> sharing_policy_ = {
+ {s4u::Disk::Operation::READ, s4u::Disk::SharingPolicy::LINEAR},
+ {s4u::Disk::Operation::WRITE, s4u::Disk::SharingPolicy::LINEAR},
+ {s4u::Disk::Operation::READWRITE, s4u::Disk::SharingPolicy::LINEAR}};
+ std::unordered_map<s4u::Disk::Operation, s4u::NonLinearResourceCb> sharing_policy_cb_ = {};
+ std::function<s4u::Disk::IoFactorCb> factor_cb_ = {};
+
+ Metric read_bw_ = {0.0, 0, nullptr};
+ Metric write_bw_ = {0.0, 0, nullptr};
+ double readwrite_bw_ = -1; /* readwrite constraint bound, usually max(read, write) */
+ std::atomic_int_fast32_t refcount_{0};
+
+ void apply_sharing_policy_cfg();
+
+protected:
+ ~DiskImpl() override = default; // Disallow direct deletion. Call destroy() instead.