00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00012 #include <iostream> 00013 //#include "zypp/base/Logger.h" 00014 00015 #include "zypp/ResPool.h" 00016 #include "zypp/pool/PoolImpl.h" 00017 00018 using std::endl; 00019 00021 namespace zypp 00022 { 00023 00024 namespace 00025 { 00027 pool::PoolTraits::Impl_constPtr noPool() 00028 { 00029 static pool::PoolTraits::Impl_constPtr _noPool( new pool::PoolImpl ); 00030 return _noPool; 00031 } 00032 } 00033 00035 // 00036 // METHOD NAME : ResPool::ResPool 00037 // METHOD TYPE : Ctor 00038 // 00039 ResPool::ResPool() 00040 : _pimpl( noPool() ) 00041 {} 00042 00044 // 00045 // METHOD NAME : ResPool::ResPool 00046 // METHOD TYPE : Ctor 00047 // 00048 ResPool::ResPool( pool::PoolTraits::Impl_constPtr impl_r ) 00049 : _pimpl( impl_r ) 00050 {} 00051 00053 // 00054 // METHOD NAME : ResPool::~ResPool 00055 // METHOD TYPE : Dtor 00056 // 00057 ResPool::~ResPool() 00058 {} 00059 00061 // 00062 // Forward to impementation: 00063 // 00065 00066 bool ResPool::empty() const 00067 { return _pimpl->empty(); } 00068 00069 ResPool::size_type ResPool::size() const 00070 { return _pimpl->size(); } 00071 00072 ResPool::const_iterator ResPool::begin() const 00073 { return _pimpl->begin(); } 00074 00075 ResPool::const_iterator ResPool::end() const 00076 { return _pimpl->end(); } 00077 00078 ResPool::byName_iterator ResPool::byNameBegin( const std::string & name_r ) const 00079 { return _pimpl->_namehash.begin( name_r ); } 00080 00081 ResPool::byName_iterator ResPool::byNameEnd( const std::string & name_r ) const 00082 { return _pimpl->_namehash.end( name_r ); } 00083 00084 ResPool::byCapabilityIndex_iterator ResPool::byCapabilityIndexBegin( const std::string & index_r, Dep depType_r ) const 00085 { return _pimpl->_caphash.begin( index_r, depType_r ); } 00086 00087 ResPool::byCapabilityIndex_iterator ResPool::byCapabilityIndexEnd( const std::string & index_r, Dep depType_r ) const 00088 { return _pimpl->_caphash.end( index_r, depType_r ); } 00089 00090 /****************************************************************** 00091 ** 00092 ** FUNCTION NAME : operator<< 00093 ** FUNCTION TYPE : std::ostream & 00094 */ 00095 std::ostream & operator<<( std::ostream & str, const ResPool & obj ) 00096 { 00097 return str << *obj._pimpl; 00098 } 00099 00101 } // namespace zypp