Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
mc_api renamed to Api
[simgrid.git] / src / mc / udpor_global.cpp
index 9c84d6e8f20523b236614a0c112fb7ea1a332ca5..d4bb5193b07fa4378b47614d535a1385f2dec9f0 100644 (file)
@@ -11,6 +11,20 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_udpor_global, mc, "udpor_global");
 namespace simgrid {
 namespace mc {
 
+EventSet EvtSetTools::makeUnion(EventSet s1, EventSet s2)
+{
+  EventSet res = s1;
+  for (auto evt : s2)
+    EvtSetTools::pushBack(res, evt);
+  return res;
+}
+
+void EvtSetTools::pushBack(EventSet& events, UnfoldingEvent* e)
+{
+  if (!EvtSetTools::contains(events, e))
+    events.push_back(e);
+}
+
 bool EvtSetTools::contains(const EventSet events, const UnfoldingEvent* e)
 {
   for (auto evt : events)