X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a96adb51dabc0c759af11e60c770355f22a54ef3..c0bda26f8216132898999052ea1fdbbe01fd2aa0:/src/surf/trace_mgr.hpp diff --git a/src/surf/trace_mgr.hpp b/src/surf/trace_mgr.hpp index 625db0422b..955ff2a041 100644 --- a/src/surf/trace_mgr.hpp +++ b/src/surf/trace_mgr.hpp @@ -7,20 +7,20 @@ #define SURF_TMGR_H #include "simgrid/forward.h" -#include "xbt/heap.h" #include "xbt/sysdep.h" +#include #include extern "C" { /* Iterator within a trace */ -typedef struct tmgr_trace_event { +struct s_tmgr_trace_event_t { tmgr_trace_t trace; unsigned int idx; sg_resource_t resource; - int free_me; -} s_tmgr_trace_event_t; -typedef struct tmgr_trace_event* tmgr_trace_event_t; + bool free_me; +}; +typedef s_tmgr_trace_event_t* tmgr_trace_event_t; /** * \brief Free a trace event structure @@ -91,8 +91,8 @@ public: tmgr_trace_event_t add_trace(tmgr_trace_t trace, simgrid::surf::Resource * resource); private: - // TODO: use a boost type for the heap (or a ladder queue) - xbt_heap_t heap_ = xbt_heap_new(8, xbt_free_f); /* Content: only trace_events (yep, 8 is an arbitrary value) */ + typedef std::pair Qelt; + std::priority_queue, std::greater> heap_; }; }} // namespace simgrid::trace_mgr