Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Allow to chain calls to activity::Comm functions
[simgrid.git] / include / simgrid / s4u / Io.hpp
index 360dd4f..4e7ae31 100644 (file)
 #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 {
 public:
   enum class OpType { READ, WRITE };
@@ -23,18 +29,23 @@ private:
 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* start() override;
-  Activity* wait() override;
-  Activity* wait(double timeout) override;
-  Activity* cancel() override;
+  Io* start() override;
+  Io* wait() override;
+  Io* wait_for(double timeout) override;
+  Io* cancel() override;
+  bool test() override;
 
   double get_remaining() override;
   sg_size_t get_performed_ioops();
 
+#ifndef DOXYGEN
+  XBT_ATTRIB_DEPRECATED_v324("Please use Io::wait_for()") void wait(double t) override { wait_for(t); }
+#endif
+
 private:
   sg_size_t size_       = 0;
   sg_storage_t storage_ = nullptr;