Просмотр исходного кода

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
David Kalnischkies лет назад: 11
Родитель
Сommit
107d054ba9
2 измененных файлов с 16 добавлено и 13 удалено
  1. 14 0
      apt-pkg/depcache.cc
  2. 2 13
      apt-pkg/depcache.h

+ 14 - 0
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;
+}
+									/*}}}*/

+ 2 - 13
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
     */