- if (action_line.length() > 0 && action_line.find("#") == std::string::npos) {
- /* we cannot split in place here because we parse&store several lines for the colleagues... */
- action = new ReplayAction();
- boost::split(*action, action_line, boost::is_any_of(" \t"), boost::token_compress_on);
-
- // if it's for me, I'm done
- std::string evtname = action->front();
- if (evtname.compare(name) == 0) {
- return action;
- } else {
- // Else, I have to store it for the relevant colleague
- std::queue<ReplayAction*>* otherqueue =
- (std::queue<ReplayAction*>*)xbt_dict_get_or_null(xbt_action_queues, evtname.c_str());
- if (otherqueue == nullptr) { // Damn. Create the queue of that guy
- otherqueue = new std::queue<ReplayAction*>();
- xbt_dict_set(xbt_action_queues, evtname.c_str(), otherqueue, nullptr);
- }
- otherqueue->push(action);
+ if (action_fs->eof())
+ break;
+ /* we cannot split in place here because we parse&store several lines for the colleagues... */
+ action = new ReplayAction();
+ boost::split(*action, action_line, boost::is_any_of(" \t"), boost::token_compress_on);
+
+ // if it's for me, I'm done
+ std::string evtname = action->front();
+ if (evtname.compare(name) == 0) {
+ return action;
+ } else {
+ // Else, I have to store it for the relevant colleague
+ std::queue<ReplayAction*>* otherqueue = nullptr;
+ auto act = action_queues.find(evtname);
+ if (act != action_queues.end()) {
+ otherqueue = act->second;
+ } else { // Damn. Create the queue of that guy
+ otherqueue = new std::queue<ReplayAction*>();
+ action_queues.insert({evtname, otherqueue});