Looks recursively in the requirement graph of current for x. Descends no more than current_level levels and does not descend into requirements that are known to be complete.
| 151 | // Descends no more than current_level levels and does not |
| 152 | // descend into requirements that are known to be complete. |
| 153 | bool recursive_find(const dag_node_ptr ¤t, int current_level, |
| 154 | const dag_node_ptr &x) { |
| 155 | if(!current) |
| 156 | return false; |
| 157 | if(current == x) |
| 158 | return true; |
| 159 | if(current_level <= 0) |
| 160 | return false; |
| 161 | |
| 162 | for(const auto& req : current->get_requirements()) { |
| 163 | if(auto r = req.lock()) { |
| 164 | if(!r->is_known_complete()) { |
| 165 | if(recursive_find(r, current_level - 1, x)) |
| 166 | return true; |
| 167 | } |
| 168 | } |
| 169 | } |
| 170 | return false; |
| 171 | } |
| 172 | |
| 173 | |
| 174 |
no test coverage detected