1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/ResPool.cc
13 //#include "zypp/base/Logger.h"
15 #include "zypp/base/SerialNumber.h"
17 #include "zypp/ZYppFactory.h"
18 #include "zypp/ResPool.h"
19 #include "zypp/pool/PoolImpl.h"
20 #include "zypp/pool/PoolStats.h"
24 ///////////////////////////////////////////////////////////////////
26 { /////////////////////////////////////////////////////////////////
28 ///////////////////////////////////////////////////////////////////
30 // METHOD NAME : ResPool::instance
31 // METHOD TYPE : ResPool
33 ResPool ResPool::instance()
35 static ResPool _val( pool::PoolTraits::Impl_Ptr( new pool::PoolImpl ) );
39 ///////////////////////////////////////////////////////////////////
41 // METHOD NAME : ResPool::ResPool
44 ResPool::ResPool( pool::PoolTraits::Impl_Ptr impl_r )
48 ///////////////////////////////////////////////////////////////////
50 // Forward to impementation:
52 ///////////////////////////////////////////////////////////////////
54 ResPoolProxy ResPool::proxy() const
55 { return _pimpl->proxy( *this ); }
57 Resolver & ResPool::resolver() const
58 { return *getZYpp()->resolver(); }
60 const SerialNumber & ResPool::serial() const
61 { return _pimpl->serial(); }
63 bool ResPool::empty() const
64 { return _pimpl->empty(); }
66 ResPool::size_type ResPool::size() const
67 { return _pimpl->size(); }
70 PoolItem ResPool::find( const sat::Solvable & slv_r ) const
71 { return _pimpl->find( slv_r ); }
74 ResPool::size_type ResPool::knownRepositoriesSize() const
75 { return _pimpl->knownRepositoriesSize(); }
77 ResPool::repository_iterator ResPool::knownRepositoriesBegin() const
78 { return _pimpl->knownRepositoriesBegin(); }
80 ResPool::repository_iterator ResPool::knownRepositoriesEnd() const
81 { return _pimpl->knownRepositoriesEnd(); }
83 Repository ResPool::reposFind( const std::string & alias_r ) const
84 { return _pimpl->reposFind( alias_r ); }
86 bool ResPool::hardLockQueriesEmpty() const
87 { return _pimpl->hardLockQueries().empty(); }
89 ResPool::size_type ResPool::hardLockQueriesSize() const
90 { return _pimpl->hardLockQueries().size(); }
92 ResPool::hardLockQueries_iterator ResPool::hardLockQueriesBegin() const
93 { return _pimpl->hardLockQueries().begin(); }
95 ResPool::hardLockQueries_iterator ResPool::hardLockQueriesEnd() const
96 { return _pimpl->hardLockQueries().end(); }
98 void ResPool::setHardLockQueries( const HardLockQueries & newLocks_r )
99 { _pimpl->setHardLockQueries( newLocks_r ); }
101 void ResPool::getHardLockQueries( HardLockQueries & activeLocks_r )
102 { _pimpl->getHardLockQueries( activeLocks_r ); }
105 const pool::PoolTraits::ItemContainerT & ResPool::store() const
106 { return _pimpl->store(); }
108 const pool::PoolTraits::Id2ItemT & ResPool::id2item() const
109 { return _pimpl->id2item(); }
111 ///////////////////////////////////////////////////////////////////
113 // Forward to sat::Pool:
115 ///////////////////////////////////////////////////////////////////
116 void ResPool::setRequestedLocales( const LocaleSet & locales_r )
117 { sat::Pool::instance().setRequestedLocales( locales_r ); }
119 bool ResPool::addRequestedLocale( const Locale & locale_r )
120 { return sat::Pool::instance().addRequestedLocale( locale_r ); }
122 bool ResPool::eraseRequestedLocale( const Locale & locale_r )
123 { return sat::Pool::instance().eraseRequestedLocale( locale_r ); }
125 const LocaleSet & ResPool::getRequestedLocales() const
126 { return sat::Pool::instance().getRequestedLocales(); }
128 bool ResPool::isRequestedLocale( const Locale & locale_r ) const
129 { return sat::Pool::instance().isRequestedLocale( locale_r ); }
131 const LocaleSet & ResPool::getAvailableLocales() const
132 { return sat::Pool::instance().getAvailableLocales(); }
134 bool ResPool::isAvailableLocale( const Locale & locale_r ) const
135 { return sat::Pool::instance().isAvailableLocale( locale_r ); }
137 /******************************************************************
139 ** FUNCTION NAME : operator<<
140 ** FUNCTION TYPE : std::ostream &
142 std::ostream & operator<<( std::ostream & str, const ResPool & obj )
144 return dumpPoolStats( str << "ResPool " << sat::Pool::instance() << endl << " ",
145 obj.begin(), obj.end() );
148 /////////////////////////////////////////////////////////////////
150 ///////////////////////////////////////////////////////////////////