Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Comply with clang-format rules
[simgrid.git] / src / kernel / resource / profile / FutureEvtSet.hpp
1 /* Copyright (c) 2004-2019. The SimGrid Team. All rights reserved.          */
2
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. */
5
6 #include <queue>
7 #ifndef FUTUREEVTSET_HPP
8 #define FUTUREEVTSET_HPP
9
10 namespace simgrid {
11 namespace kernel {
12 namespace profile {
13
14 /** @brief Future Event Set (collection of iterators over the traces)
15  * That's useful to quickly know which is the next occurring event in a set of traces. */
16 class XBT_PUBLIC FutureEvtSet {
17 public:
18   FutureEvtSet();
19   FutureEvtSet(const FutureEvtSet&) = delete;
20   FutureEvtSet& operator=(const FutureEvtSet&) = delete;
21   virtual ~FutureEvtSet();
22   double next_date() const;
23   Event* pop_leq(double date, double* value, resource::Resource** resource);
24   void add_event(double date, Event* evt);
25
26 private:
27   typedef std::pair<double, Event*> Qelt;
28   std::priority_queue<Qelt, std::vector<Qelt>, std::greater<Qelt>> heap_;
29 };
30
31 } // namespace profile
32 } // namespace kernel
33 } // namespace simgrid
34
35 #endif