From 6c9bebec244bdfbc98c8b9e3548b2bb7b9c7424e Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 3 Sep 2011 12:59:57 -0400 Subject: [PATCH] TDB2 - (Partially) Converted dependency handling code to TDB2. --- src/dependency.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/dependency.cpp b/src/dependency.cpp index d482fcfa3..b67497465 100644 --- a/src/dependency.cpp +++ b/src/dependency.cpp @@ -48,7 +48,8 @@ bool dependencyIsBlocked (const Task& task) if (task.has ("depends")) { std::string depends = task.get ("depends"); - const std::vector & all = context.tdb.getAllPending (); +// const std::vector & all = context.tdb.getAllPending (); + std::vector all; // TODO Fix. std::vector ::const_iterator it; for (it = all.begin (); it != all.end (); ++it) if ((it->getStatus () == Task::pending || @@ -65,7 +66,8 @@ void dependencyGetBlocked (const Task& task, std::vector & blocked) { std::string uuid = task.get ("uuid"); - const std::vector & all = context.tdb.getAllPending (); +// const std::vector & all = context.tdb.getAllPending (); + std::vector all; // TODO Fix. std::vector ::const_iterator it; for (it = all.begin (); it != all.end (); ++it) if ((it->getStatus () == Task::pending || @@ -83,7 +85,8 @@ bool dependencyIsBlocking (const Task& task) { std::string uuid = task.get ("uuid"); - const std::vector & all = context.tdb.getAllPending (); +// const std::vector & all = context.tdb.getAllPending (); + std::vector all; // TODO Fix. std::vector ::const_iterator it; for (it = all.begin (); it != all.end (); ++it) if ((it->getStatus () == Task::pending || @@ -101,7 +104,8 @@ void dependencyGetBlocking (const Task& task, std::vector & blocking) std::string depends = task.get ("depends"); if (depends != "") { - const std::vector & all = context.tdb.getAllPending (); +// const std::vector & all = context.tdb.getAllPending (); + std::vector all; // TODO Fix. std::vector ::const_iterator it; for (it = all.begin (); it != all.end (); ++it) if ((it->getStatus () == Task::pending || @@ -149,7 +153,7 @@ static bool followUpstream ( seen.push_back (link); // Use 'original' over '*b' if they both refer to the same task, otherwise - // '*b' is from TDB's committed list, and lacks recent modifications. + // '*b' is from TDB2's committed list, and lacks recent modifications. if (followUpstream ( (b->get ("uuid") == original.get ("uuid") ? original : *b), original, @@ -239,12 +243,12 @@ void dependencyChainOnComplete (Task& task) left->addDependency (right->id); } - // Now update TDB, now that the updates have all occurred. + // Now update TDB2, now that the updates have all occurred. for (left = blocked.begin (); left != blocked.end (); ++left) - context.tdb.update (*left); + context.tdb2.modify (*left); for (right = blocking.begin (); right != blocking.end (); ++right) - context.tdb.update (*right); + context.tdb2.modify (*right); } } }