| 969 | } |
| 970 | |
| 971 | void |
| 972 | Reducer::config_active_blks(string cmd) |
| 973 | { |
| 974 | size_t i; |
| 975 | vector<string> tmp_strs; |
| 976 | if (cmd == "poll") { |
| 977 | dump_block_entry = true; |
| 978 | } else if (cmd == "blind poll") { |
| 979 | dump_all_block_info = true; |
| 980 | } |
| 981 | else { |
| 982 | tmp_strs.clear(); |
| 983 | bool take_diff_branch = false; |
| 984 | if (cmd.find("||") != string::npos) { |
| 985 | StringUtils::split_string(cmd, tmp_strs, "|"); |
| 986 | assert(tmp_strs.size() == 2); |
| 987 | cmd = tmp_strs[0]; |
| 988 | int blkid = StringUtils::str2int(tmp_strs[1]); |
| 989 | take_diff_branch = configure_diff_active_blks(cmd, blkid); |
| 990 | } |
| 991 | if (!take_diff_branch) { |
| 992 | StringUtils::split_string(cmd, tmp_strs, ",()"); |
| 993 | for (i=0; i<tmp_strs.size(); i+=2) { |
| 994 | const Block* blk = find_block_by_id(StringUtils::str2int(tmp_strs[i])); |
| 995 | assert(i+1 < tmp_strs.size()); |
| 996 | int cnt = StringUtils::str2int(tmp_strs[i+1]); |
| 997 | assert(blk); |
| 998 | map_active_blks[blk] = cnt; |
| 999 | // for rollback blocks, find the parant blocks and put them on active block list as well |
| 1000 | if (cnt == 0) { |
| 1001 | for (const Block* b = blk->parent; b != NULL; b = b->parent) { |
| 1002 | if (map_active_blks.find(b) != map_active_blks.end()) { |
| 1003 | break; |
| 1004 | } |
| 1005 | map_active_blks[b] = 0; |
| 1006 | } |
| 1007 | } |
| 1008 | } |
| 1009 | } |
| 1010 | } |
| 1011 | } |
| 1012 | |
| 1013 | void |
| 1014 | Reducer::config_call_chain_shortcut(string cmd) |
nothing calls this directly
no test coverage detected