X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b54403a768353ed64e0b4f4b5afcc89933f585f4..6260d187764dc644d699e1a53454f7efdcc682df:/src/mc/explo/udpor/History.cpp diff --git a/src/mc/explo/udpor/History.cpp b/src/mc/explo/udpor/History.cpp index e6a6405f9e..d9d43d3133 100644 --- a/src/mc/explo/udpor/History.cpp +++ b/src/mc/explo/udpor/History.cpp @@ -20,11 +20,11 @@ History::Iterator::Iterator(const EventSet& initial_events, optional_configurati // and all subsequent events that are added by the iterator } -History::Iterator& History::Iterator::operator++() +void History::Iterator::increment() { if (not frontier.empty()) { // "Pop" the event at the "front" - UnfoldingEvent* e = *frontier.begin(); + const UnfoldingEvent* e = *frontier.begin(); frontier.remove(e); // If there is a configuration and if the @@ -33,7 +33,7 @@ History::Iterator& History::Iterator::operator++() // be searched since the configuration contains // them (configuration invariant) if (configuration.has_value() && configuration->get().contains(e)) { - return *this; + return; } // Mark this event as seen @@ -47,7 +47,19 @@ History::Iterator& History::Iterator::operator++() candidates.subtract(current_history); frontier.form_union(candidates); } - return *this; +} + +const UnfoldingEvent* const& History::Iterator::dereference() const +{ + return *frontier.begin(); +} + +bool History::Iterator::equal(const Iterator& other) const +{ + // If what the iterator sees next is the same, we consider them + // to be the same iterator. This way, once the iterator has completed + // its search, it will be "equal" to an iterator searching nothing + return this->frontier == other.frontier; } EventSet History::get_all_events() const