Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
New function: s4u::Activity::test()
[simgrid.git] / include / simgrid / s4u / Activity.hpp
index 615f7bb..3a374a4 100644 (file)
@@ -7,6 +7,7 @@
 #define SIMGRID_S4U_ACTIVITY_HPP
 
 #include <simgrid/forward.h>
+#include <xbt/signal.hpp>
 
 namespace simgrid {
 namespace s4u {
@@ -27,13 +28,13 @@ namespace s4u {
  * - Synchronization activities may possibly be connected to no action.
  */
 class XBT_PUBLIC Activity {
-  friend Comm;
+  friend simgrid::s4u::Comm;
   friend XBT_PUBLIC void intrusive_ptr_release(Comm * c);
   friend XBT_PUBLIC void intrusive_ptr_add_ref(Comm * c);
-  friend Exec;
+  friend simgrid::s4u::Exec;
   friend XBT_PUBLIC void intrusive_ptr_release(Exec * e);
   friend XBT_PUBLIC void intrusive_ptr_add_ref(Exec * e);
-  friend Io;
+  friend simgrid::s4u::Io;
   friend XBT_PUBLIC void intrusive_ptr_release(Io* i);
   friend XBT_PUBLIC void intrusive_ptr_add_ref(Io* i);
 
@@ -42,8 +43,10 @@ protected:
   virtual ~Activity() = default;
 
 public:
+#ifndef DOXYGEN
   Activity(Activity const&) = delete;
   Activity& operator=(Activity const&) = delete;
+#endif
 
   enum class State { INITED = 0, STARTED, CANCELED, ERRORED, FINISHED };
 
@@ -63,6 +66,8 @@ public:
   virtual Activity* cancel() = 0;
   /** Retrieve the current state of the activity */
   Activity::State get_state() { return state_; }
+  /** Returns whether this activity is completed */
+  virtual bool test() = 0;
 
   /** Get the remaining amount of work that this Activity entails. When it's 0, it's done. */
   virtual double get_remaining();
@@ -81,6 +86,7 @@ public:
   /** Retrieve the user data of the Activity */
   void* get_user_data() { return user_data_; }
 
+#ifndef DOXYGEN
   /** @deprecated See Activity::get_state()*/
   XBT_ATTRIB_DEPRECATED_v323("Please use Activity::get_state()") Activity::State getState() { return state_; }
   /** @deprecated See Activity::get_remaining() */
@@ -97,6 +103,7 @@ public:
   }
   /** @deprecated See Activity::get_user_data() */
   XBT_ATTRIB_DEPRECATED_v323("Please use Activity::get_user_data()") void* getUserData() { return user_data_; }
+#endif
 
 private:
   simgrid::kernel::activity::ActivityImplPtr pimpl_ = nullptr;