Dependencies

- Added TDB::gc code to remove dangling dependencies.
This commit is contained in:
Paul Beckingham 2010-08-04 00:43:38 -04:00
parent cade134f40
commit b050d67ba9
3 changed files with 38 additions and 9 deletions

View file

@ -495,16 +495,8 @@ void Task::addDependency (int id)
}
////////////////////////////////////////////////////////////////////////////////
void Task::removeDependency (int id)
void Task::removeDependency (const std::string& uuid)
{
std::string uuid = context.tdb.uuid (id);
if (uuid == "")
{
std::stringstream s;
s << "Could not find a UUID for id " << id << ".";
throw s.str ();
}
std::vector <std::string> deps;
split (deps, get ("depends"), ',');
@ -519,6 +511,20 @@ void Task::removeDependency (int id)
}
}
////////////////////////////////////////////////////////////////////////////////
void Task::removeDependency (int id)
{
std::string uuid = context.tdb.uuid (id);
if (uuid != "")
removeDependency (uuid);
else
{
std::stringstream s;
s << "Could not find a UUID for id " << id << ".";
throw s.str ();
}
}
////////////////////////////////////////////////////////////////////////////////
void Task::getDependencies (std::vector <int>& all) const
{