-backup
authorMichael Andres <ma@suse.de>
Mon, 6 Feb 2006 15:20:25 +0000 (15:20 +0000)
committerMichael Andres <ma@suse.de>
Mon, 6 Feb 2006 15:20:25 +0000 (15:20 +0000)
zypp/ResPool.cc
zypp/ResPool.h
zypp/ui/ResPoolProxy.cc
zypp/ui/ResPoolProxy.h

index b4fc6a6..457a211 100644 (file)
@@ -21,6 +21,25 @@ using std::endl;
 namespace zypp
 { /////////////////////////////////////////////////////////////////
 
+  namespace
+  {
+    /** the empty pool used by ResPool::ResPool() */
+    pool::PoolTraits::Impl_constPtr noPool()
+    {
+      static pool::PoolTraits::Impl_constPtr _noPool( new pool::PoolImpl );
+      return _noPool;
+    }
+  }
+
+  ///////////////////////////////////////////////////////////////////
+  //
+  //   METHOD NAME : ResPool::ResPool
+  //   METHOD TYPE : Ctor
+  //
+  ResPool::ResPool()
+  : _pimpl( noPool() )
+  {}
+
   ///////////////////////////////////////////////////////////////////
   //
   //   METHOD NAME : ResPool::ResPool
index a17573e..4384283 100644 (file)
@@ -47,6 +47,8 @@ namespace zypp
     typedef pool::PoolTraits::const_nameiterator const_nameiterator;
 
   public:
+    /** Default ctor: empty pool */
+    ResPool();
     /** Dtor */
     ~ResPool();
 
index d37f92e..6793b44 100644 (file)
@@ -10,7 +10,7 @@
  *
 */
 #include <iostream>
-//#include "zypp/base/Logger.h"
+#include "zypp/base/Logger.h"
 
 #include "zypp/ui/ResPoolProxy.h"
 
@@ -30,6 +30,26 @@ namespace zypp
     /** ResPoolProxy implementation. */
     struct ResPoolProxy::Impl
     {
+    public:
+      Impl()
+      {}
+
+      Impl( ResPool_Ref pool_r )
+      : _pool( pool_r )
+      {
+#if 0
+        ui::PP collect;
+        for_each( query.begin(), query.end(),
+                  functorRef<void,ResPool::Item>( collect ) );
+        collect.dumpOn();
+#endif
+
+      }
+
+
+
+    private:
+      ResPool_Ref _pool;
 
     public:
       /** Offer default Impl. */
@@ -38,12 +58,6 @@ namespace zypp
         static shared_ptr<Impl> _nullimpl( new Impl );
         return _nullimpl;
       }
-
-    private:
-      friend Impl * rwcowClone<Impl>( const Impl * rhs );
-      /** clone for RWCOW_pointer */
-      Impl * clone() const
-      { return new Impl( *this ); }
     };
     ///////////////////////////////////////////////////////////////////
 
@@ -70,6 +84,15 @@ namespace zypp
 
     ///////////////////////////////////////////////////////////////////
     //
+    // METHOD NAME : ResPoolProxy::ResPoolProxy
+    // METHOD TYPE : Ctor
+    //
+    ResPoolProxy::ResPoolProxy( ResPool_Ref pool_r )
+    : _pimpl( new Impl( pool_r ) )
+    {}
+
+    ///////////////////////////////////////////////////////////////////
+    //
     // METHOD NAME : ResPoolProxy::~ResPoolProxy
     // METHOD TYPE : Dtor
     //
index 71186bb..14b5dcc 100644 (file)
@@ -16,6 +16,8 @@
 
 #include "zypp/base/PtrTypes.h"
 
+#include "zypp/ResPool.h"
+
 ///////////////////////////////////////////////////////////////////
 namespace zypp
 { /////////////////////////////////////////////////////////////////
@@ -27,7 +29,10 @@ namespace zypp
     //
     // CLASS NAME : ResPoolProxy
     //
-    /** */
+    /**
+
+     * \todo Make it a _Ref.
+    */
     class ResPoolProxy
     {
       friend std::ostream & operator<<( std::ostream & str, const ResPoolProxy & obj );
@@ -37,16 +42,21 @@ namespace zypp
       class Impl;
 
     public:
-      /** Default ctor */
+      /** Default ctor: no pool */
       ResPoolProxy();
+      /** Ctor */
+      ResPoolProxy( ResPool_Ref pool_r );
       /** Dtor */
       ~ResPoolProxy();
 
     public:
 
+
+
+
     private:
       /** Pointer to implementation */
-      RWCOW_pointer<Impl> _pimpl;
+      RW_pointer<Impl> _pimpl;
     };
     ///////////////////////////////////////////////////////////////////