#include "src/mc/explo/udpor/udpor_forward.hpp"
#include <cstddef>
+#include <initializer_list>
#include <unordered_set>
namespace simgrid::mc::udpor {
class EventSet {
private:
std::unordered_set<UnfoldingEvent*> events_;
- explicit EventSet(std::unordered_set<UnfoldingEvent*>&& raw_events) : events_(raw_events) {}
public:
EventSet() = default;
EventSet& operator=(const EventSet&) = default;
EventSet& operator=(EventSet&&) = default;
EventSet(EventSet&&) = default;
+ explicit EventSet(std::unordered_set<UnfoldingEvent*>&& raw_events) : events_(raw_events) {}
+ explicit EventSet(std::initializer_list<UnfoldingEvent*> event_list) : events_(std::move(event_list)) {}
inline auto begin() const { return this->events_.begin(); }
inline auto end() const { return this->events_.end(); }
- void remove(UnfoldingEvent* e);
- void subtract(const EventSet& other);
- void subtract(const Configuration& other);
- EventSet subtracting(UnfoldingEvent* e) const;
- EventSet subtracting(const EventSet& e) const;
- EventSet subtracting(const Configuration& e) const;
+ void remove(UnfoldingEvent*);
+ void subtract(const EventSet&);
+ void subtract(const Configuration&);
+ EventSet subtracting(UnfoldingEvent*) const;
+ EventSet subtracting(const EventSet&) const;
+ EventSet subtracting(const Configuration&) const;
- void insert(UnfoldingEvent* e);
+ void insert(UnfoldingEvent*);
void form_union(const EventSet&);
void form_union(const Configuration&);
- EventSet make_union(UnfoldingEvent* e) const;
+ EventSet make_union(UnfoldingEvent*) const;
EventSet make_union(const EventSet&) const;
- EventSet make_union(const Configuration& e) const;
+ EventSet make_union(const Configuration&) const;
size_t size() const;
bool empty() const;
- bool contains(UnfoldingEvent* e) const;
- bool is_subset_of(const EventSet& other) const;
+ bool contains(UnfoldingEvent*) const;
+ bool is_subset_of(const EventSet&) const;
+
+ bool operator==(const EventSet& other) const { return this->events_ == other.events_; }
+ bool operator!=(const EventSet& other) const { return this->events_ != other.events_; }
};
} // namespace simgrid::mc::udpor