Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add get_name for batteries. update dag_from_json to support wfformat 1.4
[simgrid.git] / src / mc / explo / udpor / EventSet.hpp
index ddd875d7ad5ff74727287260f2c6dcb585f929ee..32be66f70a48e3e2f3421fae365784cac77674c4 100644 (file)
@@ -27,19 +27,13 @@ public:
   EventSet& operator=(const EventSet&) = default;
   EventSet& operator=(EventSet&&)      = default;
   EventSet(EventSet&&)                 = default;
-  explicit EventSet(Configuration&& config);
-  explicit EventSet(std::vector<const UnfoldingEvent*>&& raw_events) : events_(raw_events.begin(), raw_events.end())
+  explicit EventSet(const Configuration& config);
+  explicit EventSet(const std::vector<const UnfoldingEvent*>& raw_events)
+      : events_(raw_events.begin(), raw_events.end())
   {
-    xbt_assert(std::none_of(events_.begin(), events_.end(), [](const auto* e) { return e == nullptr; }), "Oh no");
-  }
-  explicit EventSet(std::unordered_set<const UnfoldingEvent*>&& raw_events) : events_(raw_events)
-  {
-    xbt_assert(std::none_of(events_.begin(), events_.end(), [](const auto* e) { return e == nullptr; }), "Oh no");
-  }
-  explicit EventSet(std::initializer_list<const UnfoldingEvent*> event_list) : events_(std::move(event_list))
-  {
-    xbt_assert(std::none_of(events_.begin(), events_.end(), [](const auto* e) { return e == nullptr; }), "Oh no");
   }
+  explicit EventSet(std::unordered_set<const UnfoldingEvent*>&& raw_events) : events_(std::move(raw_events)) {}
+  explicit EventSet(std::initializer_list<const UnfoldingEvent*> event_list) : events_(std::move(event_list)) {}
 
   auto begin() const { return this->events_.begin(); }
   auto end() const { return this->events_.end(); }
@@ -59,12 +53,15 @@ public:
   EventSet make_union(const UnfoldingEvent*) const;
   EventSet make_union(const EventSet&) const;
   EventSet make_union(const Configuration&) const;
+  EventSet make_intersection(const EventSet&) const;
   EventSet get_local_config() const;
 
   size_t size() const;
   bool empty() const;
+
   bool contains(const UnfoldingEvent*) const;
   bool contains(const History&) const;
+  bool contains_equivalent_to(const UnfoldingEvent*) const;
   bool intersects(const EventSet&) const;
   bool intersects(const History&) const;
   bool is_subset_of(const EventSet&) const;