Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename Activity::wait(double) to Activity::wait_for(double)
[simgrid.git] / src / s4u / s4u_Io.cpp
index e77c117..25cb012 100644 (file)
@@ -38,12 +38,27 @@ Activity* Io::wait()
   return this;
 }
 
-Activity* Io::wait(double timeout)
+Activity* Io::wait_for(double timeout)
 {
   THROW_UNIMPLEMENTED;
   return this;
 }
 
+bool Io::test()
+{
+  xbt_assert(state_ == State::INITED || state_ == State::STARTED || state_ == State::FINISHED);
+
+  if (state_ == State::FINISHED)
+    return true;
+
+  if (state_ == State::INITED)
+    this->start();
+
+  THROW_UNIMPLEMENTED;
+
+  return false;
+}
+
 /** @brief Returns the amount of flops that remain to be done */
 double Io::get_remaining()
 {