1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/ResPool.cc
13 //#include "zypp/base/Logger.h"
15 #include "zypp/ResPool.h"
16 #include "zypp/pool/PoolImpl.h"
20 ///////////////////////////////////////////////////////////////////
22 { /////////////////////////////////////////////////////////////////
26 /** the empty pool used by ResPool::ResPool() */
27 pool::PoolTraits::Impl_constPtr noPool()
29 static pool::PoolTraits::Impl_constPtr _noPool( new pool::PoolImpl );
34 ///////////////////////////////////////////////////////////////////
36 // METHOD NAME : ResPool::ResPool
43 ///////////////////////////////////////////////////////////////////
45 // METHOD NAME : ResPool::ResPool
48 ResPool::ResPool( pool::PoolTraits::Impl_constPtr impl_r )
52 ///////////////////////////////////////////////////////////////////
54 // METHOD NAME : ResPool::~ResPool
60 ///////////////////////////////////////////////////////////////////
62 // Forward to impementation:
64 ///////////////////////////////////////////////////////////////////
66 bool ResPool::empty() const
67 { return _pimpl->empty(); }
69 ResPool::size_type ResPool::size() const
70 { return _pimpl->size(); }
72 ResPool::const_iterator ResPool::begin() const
73 { return _pimpl->begin(); }
75 ResPool::const_iterator ResPool::end() const
76 { return _pimpl->end(); }
78 ResPool::byName_iterator ResPool::byNameBegin( const std::string & name_r ) const
79 { return make_filter_iterator( ByName( name_r ), _pimpl->_namehash.begin( name_r ), _pimpl->_namehash.end( name_r ) ); }
81 ResPool::byName_iterator ResPool::byNameEnd( const std::string & name_r ) const
82 { return make_filter_iterator( ByName( name_r ), _pimpl->_namehash.end( name_r ), _pimpl->_namehash.end( name_r ) ); }
84 ResPool::byCapabilityIndex_iterator ResPool::byCapabilityIndexBegin( const std::string & index_r, Dep depType_r ) const
85 { return make_filter_iterator( ByCapabilityIndex(), _pimpl->_caphash.begin( index_r, depType_r ), _pimpl->_caphash.end( index_r, depType_r ) ); }
87 ResPool::byCapabilityIndex_iterator ResPool::byCapabilityIndexEnd( const std::string & index_r, Dep depType_r ) const
88 { return make_filter_iterator( ByCapabilityIndex(), _pimpl->_caphash.end( index_r, depType_r ), _pimpl->_caphash.end( index_r, depType_r ) ); }
90 void ResPool::eraseInstalled()
91 { // doesnotwork (const_pointer_cast<pool::PoolTraits::Impl_constPtr>(_pimpl))->eraseInstalled();
94 /******************************************************************
96 ** FUNCTION NAME : operator<<
97 ** FUNCTION TYPE : std::ostream &
99 std::ostream & operator<<( std::ostream & str, const ResPool & obj )
101 return str << *obj._pimpl;
104 /////////////////////////////////////////////////////////////////
106 ///////////////////////////////////////////////////////////////////