summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2014-10-03 00:20:57 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2014-10-03 00:20:57 +0200
commit107d054ba954d05965f793f560468c6c453cc2a5 (patch)
tree0f6e88ec32cb5cd65c906baa0c021e800efb190e
parent30b45652d6b8c710e7a5e7e95cfa431a5df4462c (diff)
implement MarkAndSweep in cc instead of header
Having it in the header exposes some implementation details, namely private methods and will cause problems for us if we ever want to change the actions. Git-Dch: Ignore
-rw-r--r--apt-pkg/depcache.cc14
-rw-r--r--apt-pkg/depcache.h15
2 files changed, 16 insertions, 13 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 16282df21..1332f3ee2 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -1961,3 +1961,17 @@ bool pkgDepCache::Sweep() /*{{{*/
return true;
}
/*}}}*/
+// DepCache::MarkAndSweep /*{{{*/
+bool pkgDepCache::MarkAndSweep(InRootSetFunc &rootFunc)
+{
+ return MarkRequired(rootFunc) && Sweep();
+}
+bool pkgDepCache::MarkAndSweep()
+{
+ std::auto_ptr<InRootSetFunc> f(GetRootSetFunc());
+ if(f.get() != NULL)
+ return MarkAndSweep(*f.get());
+ else
+ return false;
+}
+ /*}}}*/
diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h
index f9a13dec5..5554e1a69 100644
--- a/apt-pkg/depcache.h
+++ b/apt-pkg/depcache.h
@@ -396,19 +396,8 @@ class pkgDepCache : protected pkgCache::Namespace
* \param rootFunc A predicate that returns \b true for packages
* that should be added to the root set.
*/
- bool MarkAndSweep(InRootSetFunc &rootFunc)
- {
- return MarkRequired(rootFunc) && Sweep();
- }
-
- bool MarkAndSweep()
- {
- std::auto_ptr<InRootSetFunc> f(GetRootSetFunc());
- if(f.get() != NULL)
- return MarkAndSweep(*f.get());
- else
- return false;
- }
+ bool MarkAndSweep(InRootSetFunc &rootFunc);
+ bool MarkAndSweep();
/** \name State Manipulators
*/