Преглед изворни кода

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 пре 12 година
родитељ
комит
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;
    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
     *  \param rootFunc A predicate that returns \b true for packages
     *  that should be added to the root set.
     *  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
    /** \name State Manipulators
     */
     */