#include "xbt/str.h"
#include <boost/algorithm/string/join.hpp>
#include <cinttypes>
-#include <memory>
#include <string>
XBT_LOG_NEW_DEFAULT_CATEGORY(replay_comm, "Messages specific for this msg example");
xbt_replay_action_register("recv", Replayer::recv);
if (argv[3]) {
- simgrid::xbt::action_fs = std::make_unique<std::ifstream>(argv[3], std::ifstream::in);
+ simgrid::xbt::action_fs = new std::ifstream(argv[3], std::ifstream::in);
}
e.run();
+ if (argv[3]) {
+ delete simgrid::xbt::action_fs;
+ simgrid::xbt::action_fs = nullptr;
+ }
+
XBT_INFO("Simulation time %g", e.get_clock());
return 0;
xbt_replay_action_register("close", Replayer::close);
if (argv[3]) {
- simgrid::xbt::action_fs = std::make_unique<std::ifstream>(argv[3], std::ifstream::in);
+ simgrid::xbt::action_fs = new std::ifstream(argv[3], std::ifstream::in);
}
e.run();
+ if (argv[3]) {
+ delete simgrid::xbt::action_fs;
+ simgrid::xbt::action_fs = nullptr;
+ }
+
XBT_INFO("Simulation time %g", e.get_clock());
return 0;
#include <fstream>
#include <functional>
-#include <memory>
#include <queue>
#include <unordered_map>
/* To split the file if a unique one is given (specific variable for the other case live in runner()) */
using ReplayAction = std::vector<std::string>;
-XBT_PUBLIC_DATA std::unique_ptr<std::ifstream> action_fs;
+XBT_PUBLIC_DATA std::ifstream* action_fs;
XBT_PUBLIC int replay_runner(const char* actor_name, const char* trace_filename);
}
}
namespace simgrid {
namespace xbt {
-std::unique_ptr<std::ifstream> action_fs = nullptr;
+std::ifstream* action_fs = nullptr;
std::unordered_map<std::string, action_fun> action_funs;
static std::unordered_map<std::string, std::queue<ReplayAction*>*> action_queues;