#include <simgrid/s4u/Activity.hpp>
#include <atomic>
+#include <string>
namespace simgrid {
namespace s4u {
+/** I/O Activity, representing the asynchronous disk access.
+ *
+ * They are generated from simgrid::s4u::Storage::read() and simgrid::s4u::Storage::write().
+ */
+
class XBT_PUBLIC Io : public Activity {
- Io() : Activity() {}
+public:
+ enum class OpType { READ, WRITE };
+
+private:
+ explicit Io(sg_size_t size, OpType type) : Activity(), size_(size), type_(type) {}
public:
friend XBT_PUBLIC void intrusive_ptr_release(simgrid::s4u::Io* i);
friend XBT_PUBLIC void intrusive_ptr_add_ref(simgrid::s4u::Io* i);
- friend Storage; // Factory of IOs
+ friend simgrid::s4u::Storage; // Factory of IOs
~Io() = default;
Activity* cancel() override;
double get_remaining() override;
+ sg_size_t get_performed_ioops();
private:
sg_size_t size_ = 0;
sg_storage_t storage_ = nullptr;
+ std::string name_ = "";
+ OpType type_ = OpType::READ;
std::atomic_int_fast32_t refcount_{0};
}; // class
}