| 49 | } |
| 50 | |
| 51 | void WorkPool::trash(vector<int> prefix) { |
| 52 | // cout<<" WPT called on "; |
| 53 | //if (prefix.empty()) cout<<"empty"; |
| 54 | //for (int i=0;i< prefix.size();i++) cout<<prefix[i]<<" "; |
| 55 | //cout<<endl; |
| 56 | // cout<<"debug "<<l.size()<<endl; |
| 57 | |
| 58 | list<QWork>::iterator i=l.begin(); |
| 59 | while (!(i == l.end())) { |
| 60 | // cout<<"| "; |
| 61 | // cout.flush(); |
| 62 | bool avance=true; |
| 63 | vector<int> root = (*i).root(); |
| 64 | if (isPrefix(prefix,root)) { |
| 65 | (*i).clean(); |
| 66 | i=l.erase(i); |
| 67 | avance = false; |
| 68 | // cout<<"erased"; |
| 69 | } |
| 70 | if (avance) i++; |
| 71 | } |
| 72 | //cout<<endl; |
| 73 | |
| 74 | //for (list<QWork>::iterator i=l.begin();i != l.end();i++) { |
| 75 | //vector<int> root = (*i).root(); |
| 76 | //if (isPrefix(prefix,root)) { |
| 77 | // cout<<" trashing "; |
| 78 | // if (root.empty()) cout<<"empty"; |
| 79 | // for (int j=0;j< root.size();j++) cout<<root[j]<<" "; |
| 80 | // cout<<endl; |
| 81 | //(*i).clean(); |
| 82 | //l.erase(i); |
| 83 | //i--; |
| 84 | //} |
| 85 | // } |
| 86 | } |
| 87 | |
| 88 | |
| 89 | void WorkManager::getNewWorks() { |
no test coverage detected