1 /* Copyright (c) 2004-2020. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #ifndef FUTUREEVTSET_HPP
7 #define FUTUREEVTSET_HPP
9 #include "simgrid/forward.h"
16 /** @brief Future Event Set (collection of iterators over the traces)
17 * That's useful to quickly know which is the next occurring event in a set of traces. */
18 class XBT_PUBLIC FutureEvtSet {
21 FutureEvtSet(const FutureEvtSet&) = delete;
22 FutureEvtSet& operator=(const FutureEvtSet&) = delete;
23 virtual ~FutureEvtSet();
24 double next_date() const;
25 Event* pop_leq(double date, double* value, resource::Resource** resource);
26 void add_event(double date, Event* evt);
29 using Qelt = std::pair<double, Event*>;
30 std::priority_queue<Qelt, std::vector<Qelt>, std::greater<>> heap_;
33 // FIXME: kill that singleton
34 extern XBT_PRIVATE simgrid::kernel::profile::FutureEvtSet future_evt_set;
36 } // namespace profile
38 } // namespace simgrid