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
typedef pool::PoolTraits::const_nameiterator const_nameiterator;
public:
+ /** Default ctor: empty pool */
+ ResPool();
/** Dtor */
~ResPool();
*
*/
#include <iostream>
-//#include "zypp/base/Logger.h"
+#include "zypp/base/Logger.h"
#include "zypp/ui/ResPoolProxy.h"
/** 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. */
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 ); }
};
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
//
+ // 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
//
#include "zypp/base/PtrTypes.h"
+#include "zypp/ResPool.h"
+
///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
//
// CLASS NAME : ResPoolProxy
//
- /** */
+ /**
+
+ * \todo Make it a _Ref.
+ */
class ResPoolProxy
{
friend std::ostream & operator<<( std::ostream & str, const ResPoolProxy & obj );
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;
};
///////////////////////////////////////////////////////////////////