00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00012 #include <iostream> 00013 //#include "zypp/base/Logger.h" 00014 00015 #include "zypp/base/SerialNumber.h" 00016 00017 #include "zypp/ResPool.h" 00018 #include "zypp/pool/PoolImpl.h" 00019 #include "zypp/pool/PoolStats.h" 00020 00021 using std::endl; 00022 00024 namespace zypp 00025 { 00026 00028 // 00029 // METHOD NAME : ResPool::instance 00030 // METHOD TYPE : ResPool 00031 // 00032 ResPool ResPool::instance() 00033 { 00034 static ResPool _val( pool::PoolTraits::Impl_Ptr( new pool::PoolImpl ) ); 00035 return _val; 00036 } 00037 00039 // 00040 // METHOD NAME : ResPool::ResPool 00041 // METHOD TYPE : Ctor 00042 // 00043 ResPool::ResPool( pool::PoolTraits::Impl_Ptr impl_r ) 00044 : _pimpl( impl_r ) 00045 {} 00046 00048 // 00049 // Forward to impementation: 00050 // 00052 00053 ResPoolProxy ResPool::proxy() const 00054 { return _pimpl->proxy( *this ); } 00055 00056 const SerialNumber & ResPool::serial() const 00057 { return _pimpl->serial(); } 00058 00059 bool ResPool::empty() const 00060 { return _pimpl->empty(); } 00061 00062 ResPool::size_type ResPool::size() const 00063 { return _pimpl->size(); } 00064 00065 00066 PoolItem ResPool::find( const sat::Solvable & slv_r ) const 00067 { return _pimpl->find( slv_r ); } 00068 00069 00070 ResPool::size_type ResPool::knownRepositoriesSize() const 00071 { return _pimpl->knownRepositoriesSize(); } 00072 00073 ResPool::repository_iterator ResPool::knownRepositoriesBegin() const 00074 { return _pimpl->knownRepositoriesBegin(); } 00075 00076 ResPool::repository_iterator ResPool::knownRepositoriesEnd() const 00077 { return _pimpl->knownRepositoriesEnd(); } 00078 00079 Repository ResPool::reposFind( const std::string & alias_r ) const 00080 { return _pimpl->reposFind( alias_r ); } 00081 00082 bool ResPool::autoSoftLocksEmpty() const 00083 { return _pimpl->autoSoftLocks().empty(); } 00084 00085 ResPool::size_type ResPool::autoSoftLocksSize() const 00086 { return _pimpl->autoSoftLocks().size(); } 00087 00088 ResPool::autoSoftLocks_iterator ResPool::autoSoftLocksBegin() const 00089 { return _pimpl->autoSoftLocks().begin(); } 00090 00091 ResPool::autoSoftLocks_iterator ResPool::autoSoftLocksEnd() const 00092 { return _pimpl->autoSoftLocks().end(); } 00093 00094 void ResPool::setAutoSoftLocks( const AutoSoftLocks & newLocks_r ) 00095 { _pimpl->setAutoSoftLocks( newLocks_r ); } 00096 00097 void ResPool::getActiveSoftLocks( AutoSoftLocks & activeLocks_r ) 00098 { _pimpl->getActiveSoftLocks( activeLocks_r ); } 00099 00100 00101 bool ResPool::hardLockQueriesEmpty() const 00102 { return _pimpl->hardLockQueries().empty(); } 00103 00104 ResPool::size_type ResPool::hardLockQueriesSize() const 00105 { return _pimpl->hardLockQueries().size(); } 00106 00107 ResPool::hardLockQueries_iterator ResPool::hardLockQueriesBegin() const 00108 { return _pimpl->hardLockQueries().begin(); } 00109 00110 ResPool::hardLockQueries_iterator ResPool::hardLockQueriesEnd() const 00111 { return _pimpl->hardLockQueries().end(); } 00112 00113 void ResPool::setHardLockQueries( const HardLockQueries & newLocks_r ) 00114 { _pimpl->setHardLockQueries( newLocks_r ); } 00115 00116 void ResPool::getHardLockQueries( HardLockQueries & activeLocks_r ) 00117 { _pimpl->getHardLockQueries( activeLocks_r ); } 00118 00119 00120 const pool::PoolTraits::ItemContainerT & ResPool::store() const 00121 { return _pimpl->store(); } 00122 00123 const pool::PoolTraits::Id2ItemT & ResPool::id2item() const 00124 { return _pimpl->id2item(); } 00125 00127 // 00128 // Forward to sat::Pool: 00129 // 00131 void ResPool::setRequestedLocales( const LocaleSet & locales_r ) 00132 { sat::Pool::instance().setRequestedLocales( locales_r ); } 00133 00134 bool ResPool::addRequestedLocale( const Locale & locale_r ) 00135 { return sat::Pool::instance().addRequestedLocale( locale_r ); } 00136 00137 bool ResPool::eraseRequestedLocale( const Locale & locale_r ) 00138 { return sat::Pool::instance().eraseRequestedLocale( locale_r ); } 00139 00140 const LocaleSet & ResPool::getRequestedLocales() const 00141 { return sat::Pool::instance().getRequestedLocales(); } 00142 00143 bool ResPool::isRequestedLocale( const Locale & locale_r ) const 00144 { return sat::Pool::instance().isRequestedLocale( locale_r ); } 00145 00146 const LocaleSet & ResPool::getAvailableLocales() const 00147 { return sat::Pool::instance().getAvailableLocales(); } 00148 00149 bool ResPool::isAvailableLocale( const Locale & locale_r ) const 00150 { return sat::Pool::instance().isAvailableLocale( locale_r ); } 00151 00152 /****************************************************************** 00153 ** 00154 ** FUNCTION NAME : operator<< 00155 ** FUNCTION TYPE : std::ostream & 00156 */ 00157 std::ostream & operator<<( std::ostream & str, const ResPool & obj ) 00158 { 00159 return dumpPoolStats( str << "ResPool " << sat::Pool::instance() << endl << " ", 00160 obj.begin(), obj.end() ); 00161 } 00162 00164 } // namespace zypp