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