00001
00002
00003
00004
00005
00006
00007
00008
00012 #include <iostream>
00013
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
00037
00038
00039 ResPool::ResPool()
00040 : _pimpl( noPool() )
00041 {}
00042
00044
00045
00046
00047
00048 ResPool::ResPool( pool::PoolTraits::Impl_constPtr impl_r )
00049 : _pimpl( impl_r )
00050 {}
00051
00053
00054
00055
00056
00057 ResPool::~ResPool()
00058 {}
00059
00061
00062
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 make_filter_iterator( ByName( name_r ), _pimpl->_namehash.begin( name_r ), _pimpl->_namehash.end( name_r ) ); }
00080
00081 ResPool::byName_iterator ResPool::byNameEnd( const std::string & name_r ) const
00082 { return make_filter_iterator( ByName( name_r ), _pimpl->_namehash.end( name_r ), _pimpl->_namehash.end( name_r ) ); }
00083
00084 ResPool::byCapabilityIndex_iterator ResPool::byCapabilityIndexBegin( const std::string & index_r, Dep depType_r ) const
00085 { return make_filter_iterator( ByCapabilityIndex(), _pimpl->_caphash.begin( index_r, depType_r ), _pimpl->_caphash.end( index_r, depType_r ) ); }
00086
00087 ResPool::byCapabilityIndex_iterator ResPool::byCapabilityIndexEnd( const std::string & index_r, Dep depType_r ) const
00088 { return make_filter_iterator( ByCapabilityIndex(), _pimpl->_caphash.end( index_r, depType_r ), _pimpl->_caphash.end( index_r, depType_r ) ); }
00089
00090
00091
00092
00093
00094
00095 std::ostream & operator<<( std::ostream & str, const ResPool & obj )
00096 {
00097 return str << *obj._pimpl;
00098 }
00099
00101 }