X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/939476f1fc7630eb237535b07ed0deef77ce1b24..6bc18b576fa4a890d8b9916d292ca67dfbf60dd3:/include/simgrid/s4u/Io.hpp diff --git a/include/simgrid/s4u/Io.hpp b/include/simgrid/s4u/Io.hpp index 6e3df222a4..72b5ea2296 100644 --- a/include/simgrid/s4u/Io.hpp +++ b/include/simgrid/s4u/Io.hpp @@ -10,12 +10,22 @@ #include #include +#include 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); @@ -29,10 +39,13 @@ public: 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 }