MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ReverseLookupDependency

Method ReverseLookupDependency

src/network/network_content.cpp:920–927  ·  view source on GitHub ↗

* Reverse lookup the dependencies of (direct) parents over a given child. * @param parents list to store all parents in (is not cleared) * @param child the child to search the parents' dependencies for */

Source from the content-addressed store, hash-verified

918 * @param child the child to search the parents' dependencies for
919 */
920void ClientNetworkContentSocketHandler::ReverseLookupDependency(ConstContentVector &parents, const ContentInfo &child) const
921{
922 auto range = this->reverse_dependency_map.equal_range(child.id);
923
924 for (auto iter = range.first; iter != range.second; ++iter) {
925 parents.push_back(GetContent(iter->second));
926 }
927}
928
929/**
930 * Reverse lookup the dependencies of all parents over a given child.

Callers 2

CheckDependencyStateMethod · 0.95

Calls 2

equal_rangeMethod · 0.80
push_backMethod · 0.80

Tested by

no test coverage detected