Checks if this subgraph is dependent on the given subgraph, either directly or indirectly.
| 155 | |
| 156 | /// Checks if this subgraph is dependent on the given subgraph, either directly or indirectly. |
| 157 | bool HasAntecedent(PartialSubgraph* antecedent) |
| 158 | { |
| 159 | if (m_Parent == nullptr) |
| 160 | { |
| 161 | antecedent = antecedent->GetRepresentative(); |
| 162 | // Thanks to keeping this set updated in MergeWith and AddDirectAntecedent, we can do an efficient lookup. |
| 163 | return m_Antecedents.count(antecedent) > 0; |
| 164 | } |
| 165 | else |
| 166 | { |
| 167 | // Defer request to the representative |
| 168 | return GetRepresentative()->HasAntecedent(antecedent); |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | private: |
| 173 | /// Pointer to the parent node in the tree. If this is null then we are the representative for our merged subgraph. |
no test coverage detected