Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make simgrid::xbt::action_fs a std::unique_ptr.
[simgrid.git] / include / xbt / replay.hpp
1 /* xbt/replay_reader.h -- Tools to parse a replay file                */
2
3 /* Copyright (c) 2010-2020. The SimGrid Team. All rights reserved.          */
4
5 /* This program is free software; you can redistribute it and/or modify it
6  * under the terms of the license (GNU LGPL) which comes with this package. */
7
8 #ifndef XBT_REPLAY_HPP
9 #define XBT_REPLAY_HPP
10
11 #include <xbt/misc.h> /* SG_BEGIN_DECL */
12
13 #include <fstream>
14 #include <functional>
15 #include <memory>
16 #include <queue>
17 #include <unordered_map>
18
19 namespace simgrid {
20 namespace xbt {
21 /* To split the file if a unique one is given (specific variable for the other case live in runner()) */
22 using ReplayAction = std::vector<std::string>;
23
24 XBT_PUBLIC_DATA std::unique_ptr<std::ifstream> action_fs;
25 XBT_PUBLIC int replay_runner(const char* actor_name, const char* trace_filename);
26 }
27 }
28
29 using action_fun = std::function<void(simgrid::xbt::ReplayAction&)>;
30 XBT_PUBLIC void xbt_replay_action_register(const char* action_name, const action_fun& function);
31 XBT_PUBLIC action_fun xbt_replay_action_get(const char* action_name);
32
33 #endif