- char *comment = strchr(action_line, '#');
- if (comment != nullptr)
- *comment = '\0';
- xbt_str_trim(action_line, nullptr);
- if (action_line[0] == '\0')
- continue;
- /* we cannot split in place here because we parse&store several lines for
- * the colleagues... */
- evt = xbt_str_split_quoted(action_line);
-
- // if it's for me, I'm done
- evtname = xbt_dynar_get_as(evt, 0, char *);
- if (!strcasecmp(name, evtname)) {
- return (char**) xbt_dynar_to_array(evt);
- } else {
- // Else, I have to store it for the relevant colleague
- xbt_dynar_t otherqueue =
- (xbt_dynar_t) xbt_dict_get_or_null(xbt_action_queues, evtname);
- if (otherqueue == nullptr) { // Damn. Create the queue of that guy
- otherqueue = xbt_dynar_new(sizeof(xbt_dynar_t), xbt_dynar_free_voidp);
- xbt_dict_set(xbt_action_queues, evtname, otherqueue, nullptr);
+ boost::trim(action_line);
+ 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 simgrid::xbt::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<simgrid::xbt::ReplayAction*>* otherqueue =
+ (std::queue<simgrid::xbt::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<simgrid::xbt::ReplayAction*>();
+ xbt_dict_set(xbt_action_queues, evtname.c_str(), otherqueue, nullptr);
+ }
+ otherqueue->push(action);