eraseInstalled()
authorKlaus Kaempf <kkaempf@suse.de>
Thu, 23 Feb 2006 20:35:12 +0000 (20:35 +0000)
committerKlaus Kaempf <kkaempf@suse.de>
Thu, 23 Feb 2006 20:35:12 +0000 (20:35 +0000)
zypp/pool/PoolImpl.cc
zypp/pool/PoolImpl.h

index cafee86b1687f418eedcd48e27dfc11388b48809..2297f15eda8f914e2604b099001d1579dfca6efd 100644 (file)
@@ -184,6 +184,29 @@ namespace zypp
     PoolImpl::~PoolImpl()
     {}
 
+    /******************************************************************
+    **
+    ** FUNCTION NAME : eraseInstalled
+    ** FUNCTION TYPE : void
+    */
+    void PoolImpl::eraseInstalled( )
+    {
+       MIL << "eraseInstalled()" << endl;
+       for (ContainerT::iterator it = _store.begin(); it != _store.end();) {
+           PoolItem item = *it;
+           if (item.status().isInstalled()) {
+               ContainerT::iterator next = it; ++next;
+               _store.erase( item );
+               _namehash.erase( item );
+               _caphash.erase( item );
+               it = next;
+           }
+           else {
+               ++it;
+           }
+       }
+    }
+
     /******************************************************************
     **
     ** FUNCTION NAME : operator<<
@@ -194,6 +217,12 @@ namespace zypp
       return str << "PoolImpl " << obj.size();
     }
 
+
+    /******************************************************************
+    **
+    ** FUNCTION NAME : PoolImplInserter::operator()
+    ** FUNCTION TYPE : void
+    */
     /** Bottleneck inserting ResObjects in to the pool.
      * Filters arch incomatible available(!) objects.
     */
@@ -212,6 +241,11 @@ namespace zypp
         }
     }
 
+    /******************************************************************
+    **
+    ** FUNCTION NAME : PoolImplDeleter::operator()
+    ** FUNCTION TYPE : void
+    */
     void PoolImplDeleter::operator()( ResObject::constPtr ptr_r )
     {
       PoolImpl::Item item( ptr_r );
index 3cad60112eaa5888182cc8a8037584d40d3fabad..2ff8b9daf73825183d51ff0e8065c543b8f6cff2 100644 (file)
@@ -239,6 +239,9 @@ namespace zypp
        return;
       }
 
+      /** erase all resolvables coming from the target  */
+      void eraseInstalled();
+
     public:
       /** \name Save and restore state. */
       //@{