Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
New example: activityset-waitallfor
[simgrid.git] / include / simgrid / s4u / ActivitySet.hpp
index 4add822..172bb36 100644 (file)
@@ -25,6 +25,7 @@ class XBT_PUBLIC ActivitySet : public xbt::Extendable<ActivitySet> {
 
 public:
   ActivitySet()  = default;
+  ActivitySet(const std::vector<ActivityPtr> init) : activities_(init) {}
   ~ActivitySet() = default;
 
   /** Add an activity to the set */
@@ -39,11 +40,12 @@ public:
 
   /** Wait for the completion of all activities in the set, but not longer than the provided timeout
    *
-   * On timeout, an exception is raised, and the completed activities remain in the set. Use test_any() to retrieve
-   * them.
+   * On timeout, an exception is raised.
+   *
+   * In any case, the completed activities remain in the set. Use test_any() to retrieve them.
    */
   void wait_all_for(double timeout);
-  /** Wait for the completion of all activities in the set */
+  /** Wait for the completion of all activities in the set. The set is NOT emptied afterward. */
   void wait_all() { wait_all_for(-1); }
   /** Returns the first terminated activity if any, or ActivityPtr(nullptr) if no activity is terminated */
   ActivityPtr test_any();