ResolvableFamily: Add ResolveDependency()

This commit is contained in:
Ingo Weinhold 2011-06-25 17:13:07 +02:00
parent 0d7d1795a1
commit 4081d37dec
2 changed files with 17 additions and 0 deletions

View File

@ -44,3 +44,18 @@ ResolvableFamily::RemoveResolvable(Resolvable* resolvable,
resolvable->SetFamily(NULL);
fResolvables.Remove(resolvable);
}
bool
ResolvableFamily::ResolveDependency(Dependency* dependency)
{
for (FamilyResolvableList::Iterator it = fResolvables.GetIterator();
Resolvable* resolvable = it.Next();) {
if (dependency->ResolvableVersionMatches(resolvable->Version())) {
resolvable->AddDependency(dependency);
return true;
}
}
return false;
}

View File

@ -21,6 +21,8 @@ public:
ResolvableDependencyList&
dependenciesToUpdate);
bool ResolveDependency(Dependency* dependency);
const char* Name() const;
bool IsLastResolvable(Resolvable* resolvable) const;