]> AND Public Git Repository - simgrid.git/blobdiff - src/mc/udpor_global.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
filenames changed
[simgrid.git] / src / mc / udpor_global.cpp
index b06b02a277583d37b9c3447b3ddf969816382abc..d4bb5193b07fa4378b47614d535a1385f2dec9f0 100644 (file)
@@ -11,5 +11,27 @@ 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)
+    if (*evt == *e)
+      return true;
+  return false;
+}
+
 } // namespace mc
 } // namespace simgrid