* Checks whether the last check result of this Checkable affects its child dependencies. * * A Checkable affects its child dependencies if it runs into a non-OK state and results in any of its child * Checkables to become unreachable. Though, that unavailable dependency may not necessarily cause the child * Checkable to be in unreachable state as it might have some other dependencies that are
| 201 | * @return bool - Returns true if the Checkable affects its child dependencies, otherwise false. |
| 202 | */ |
| 203 | bool Checkable::AffectsChildren() const |
| 204 | { |
| 205 | if (!GetLastCheckResult() || !IsReachable()) { |
| 206 | // If there is no check result, or the Checkable is not reachable, we can't safely determine whether |
| 207 | // the Checkable affects its child dependencies. |
| 208 | return false; |
| 209 | } |
| 210 | |
| 211 | for (auto& dep : GetReverseDependencies()) { |
| 212 | if (!dep->IsAvailable(DependencyState)) { |
| 213 | // If one of the child dependency is not available, then it's definitely due to the |
| 214 | // current Checkable state, so we don't need to verify the remaining ones. |
| 215 | return true; |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | return false; |
| 220 | } |
| 221 | |
| 222 | std::set<Checkable::Ptr> Checkable::GetParents() const |
| 223 | { |
no test coverage detected