Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add topological sort of configuration events
[simgrid.git] / src / mc / explo / udpor / Configuration.hpp
index 27595e5..eb365d5 100644 (file)
@@ -9,6 +9,9 @@
 #include "src/mc/explo/udpor/EventSet.hpp"
 #include "src/mc/explo/udpor/udpor_forward.hpp"
 
+#include <initializer_list>
+#include <vector>
+
 namespace simgrid::mc::udpor {
 
 class Configuration {
@@ -18,8 +21,8 @@ public:
   Configuration& operator=(Configuration const&) = default;
   Configuration(Configuration&&)                 = default;
 
-  Configuration(EventSet events) : events_(events) {}
-  Configuration(EventSet&& events) : events_(events) {}
+  Configuration(EventSet events);
+  Configuration(std::initializer_list<UnfoldingEvent*> events);
 
   auto begin() const { return this->events_.begin(); }
   auto end() const { return this->events_.end(); }
@@ -36,6 +39,10 @@ public:
    * valid, i.e. that the newly added event's dependencies are contained
    * within the configuration.
    *
+   * @param e the event to add to the configuration. If the event is
+   * already a part of the configuration, calling this method has no
+   * effect.
+   *
    * @throws an invalid argument exception is raised should the event
    * be missing one of its dependencies
    *
@@ -51,7 +58,12 @@ public:
    * we shouldn't focus so much on this (let alone the additional benefit of the
    * assertions)
    */
-  void add_event(UnfoldingEvent*);
+  void add_event(UnfoldingEvent* e);
+
+  /**
+   *
+   */
+  std::vector<UnfoldingEvent*> get_topogolically_sorted_events_of_reverse_graph() const;
 
 private:
   /**