libzypp  15.28.6
ResPool.cc
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #include <iostream>
13 //#include "zypp/base/Logger.h"
14 
15 #include "zypp/base/SerialNumber.h"
16 
17 #include "zypp/ZYppFactory.h"
18 #include "zypp/ResPool.h"
19 #include "zypp/pool/PoolImpl.h"
20 #include "zypp/pool/PoolStats.h"
21 
22 using std::endl;
23 
25 namespace zypp
26 {
27 
29  //
30  // METHOD NAME : ResPool::instance
31  // METHOD TYPE : ResPool
32  //
34  {
36  return _val;
37  }
38 
40  //
41  // METHOD NAME : ResPool::ResPool
42  // METHOD TYPE : Ctor
43  //
45  : _pimpl( impl_r )
46  {}
47 
49  //
50  // Forward to impementation:
51  //
53 
55  { return _pimpl->proxy( *this ); }
56 
58  { return *getZYpp()->resolver(); }
59 
60  const SerialNumber & ResPool::serial() const
61  { return _pimpl->serial(); }
62 
63  bool ResPool::empty() const
64  { return _pimpl->empty(); }
65 
67  { return _pimpl->size(); }
68 
69 
70  PoolItem ResPool::find( const sat::Solvable & slv_r ) const
71  { return _pimpl->find( slv_r ); }
72 
73 
75  { return _pimpl->knownRepositoriesSize(); }
76 
78  { return _pimpl->knownRepositoriesBegin(); }
79 
81  { return _pimpl->knownRepositoriesEnd(); }
82 
83  Repository ResPool::reposFind( const std::string & alias_r ) const
84  { return _pimpl->reposFind( alias_r ); }
85 
87  { return _pimpl->hardLockQueries().empty(); }
88 
90  { return _pimpl->hardLockQueries().size(); }
91 
93  { return _pimpl->hardLockQueries().begin(); }
94 
96  { return _pimpl->hardLockQueries().end(); }
97 
98  void ResPool::setHardLockQueries( const HardLockQueries & newLocks_r )
99  { _pimpl->setHardLockQueries( newLocks_r ); }
100 
102  { _pimpl->getHardLockQueries( activeLocks_r ); }
103 
104 
106  { return _pimpl->store(); }
107 
109  { return _pimpl->id2item(); }
110 
112  //
113  // Forward to sat::Pool:
114  //
116  void ResPool::setRequestedLocales( const LocaleSet & locales_r )
117  { sat::Pool::instance().setRequestedLocales( locales_r ); }
118 
119  bool ResPool::addRequestedLocale( const Locale & locale_r )
120  { return sat::Pool::instance().addRequestedLocale( locale_r ); }
121 
122  bool ResPool::eraseRequestedLocale( const Locale & locale_r )
123  { return sat::Pool::instance().eraseRequestedLocale( locale_r ); }
124 
127 
128  bool ResPool::isRequestedLocale( const Locale & locale_r ) const
129  { return sat::Pool::instance().isRequestedLocale( locale_r ); }
130 
133 
134  bool ResPool::isAvailableLocale( const Locale & locale_r ) const
135  { return sat::Pool::instance().isAvailableLocale( locale_r ); }
136 
137  /******************************************************************
138  **
139  ** FUNCTION NAME : operator<<
140  ** FUNCTION TYPE : std::ostream &
141  */
142  std::ostream & operator<<( std::ostream & str, const ResPool & obj )
143  {
144  return dumpPoolStats( str << "ResPool " << sat::Pool::instance() << endl << " ",
145  obj.begin(), obj.end() );
146  }
147 
149 } // namespace zypp
A Solvable object within the sat Pool.
Definition: Solvable.h:53
const_iterator begin() const
Definition: ResPool.h:97
void setRequestedLocales(const LocaleSet &locales_r)
Set the requested locales.
Definition: Pool.cc:215
std::vector< PoolItem > ItemContainerT
pure items
Definition: PoolTraits.h:71
size_type size() const
Definition: PoolImpl.h:155
pool::PoolTraits::size_type size_type
Definition: ResPool.h:67
bool isRequestedLocale(const Locale &locale_r) const
Whether this Locale is in the set of requested locales.
Definition: ResPool.cc:128
const pool::PoolTraits::Id2ItemT & id2item() const
Definition: ResPool.cc:108
size_type knownRepositoriesSize() const
Forward list of Repositories that contribute ResObjects from sat::Pool.
Definition: PoolImpl.h:203
bool isRequestedLocale(const Locale &locale_r) const
Whether this Locale is in the set of requested locales.
Definition: Pool.cc:227
const ContainerT & store() const
Definition: PoolImpl.h:302
pool::PoolTraits::HardLockQueries HardLockQueries
Definition: ResPool.h:390
const_iterator end() const
Definition: ResPool.h:100
bool hardLockQueriesEmpty() const
Definition: ResPool.cc:86
ResPool::instance().proxy();.
Definition: ResPoolProxy.h:34
bool eraseRequestedLocale(const Locale &locale_r)
Erase one Locale from the set of requested locales.
Definition: ResPool.cc:122
Repository reposFind(const std::string &alias_r) const
Find a Repository named alias_r.
Definition: ResPool.cc:83
shared_ptr< PoolImpl > Impl_Ptr
Definition: PoolTraits.h:92
bool empty() const
Definition: PoolImpl.h:151
static Pool instance()
Singleton ctor.
Definition: Pool.h:53
repository_iterator knownRepositoriesEnd() const
Definition: ResPool.cc:80
ResPoolProxy proxy() const
preliminary
Definition: ResPool.cc:54
Dependency resolver interface.
Definition: Resolver.h:53
std::ostream & operator<<(std::ostream &str, const Exception &obj)
Definition: Exception.cc:120
void getHardLockQueries(HardLockQueries &activeLocks_r)
Suggest a new set of queries based on the current selection.
Definition: ResPool.cc:101
PoolItem find(const sat::Solvable &slv_r) const
Return the corresponding PoolItem.
Definition: PoolImpl.h:170
const LocaleSet & getRequestedLocales() const
Return the requested locales.
Definition: ResPool.cc:125
hardLockQueries_iterator hardLockQueriesBegin() const
Definition: ResPool.cc:92
bool addRequestedLocale(const Locale &locale_r)
Add one Locale to the set of requested locales.
Definition: Pool.cc:218
Simple serial number provider.
Definition: SerialNumber.h:44
'Language[_Country]' codes.
Definition: Locale.h:49
void setHardLockQueries(const HardLockQueries &newLocks_r)
Set a new set of queries.
Definition: ResPool.cc:98
repository_iterator knownRepositoriesBegin() const
Definition: ResPool.cc:77
Global ResObject pool.
Definition: ResPool.h:60
std::unordered_multimap< sat::detail::IdType, PoolItem > Id2ItemT
ident index
Definition: PoolTraits.h:79
size_type knownRepositoriesSize() const
Definition: ResPool.cc:74
hardLockQueries_iterator hardLockQueriesEnd() const
Definition: ResPool.cc:95
const LocaleSet & getRequestedLocales() const
Return the requested locales.
Definition: Pool.cc:224
Resolver & resolver() const
The Resolver.
Definition: ResPool.cc:57
bool addRequestedLocale(const Locale &locale_r)
Add one Locale to the set of requested locales.
Definition: ResPool.cc:119
pool::PoolTraits::hardLockQueries_iterator hardLockQueries_iterator
Definition: ResPool.h:391
repository_iterator knownRepositoriesBegin() const
Definition: PoolImpl.h:206
repository_iterator knownRepositoriesEnd() const
Definition: PoolImpl.h:209
bool isAvailableLocale(const Locale &locale_r) const
Whether this Locale is in the set of available locales.
Definition: Pool.cc:237
const SerialNumber & serial() const
The pools serial number.
Definition: ResPool.cc:60
const HardLockQueries & hardLockQueries() const
Definition: PoolImpl.h:222
Combining sat::Solvable and ResStatus.
Definition: PoolItem.h:50
const LocaleSet & getAvailableLocales() const
Get the set of available locales.
Definition: Pool.cc:234
const LocaleSet & getAvailableLocales() const
Get the set of available locales.
Definition: ResPool.cc:131
Repository reposFind(const std::string &alias_r) const
Definition: PoolImpl.h:212
const Id2ItemT & id2item() const
Definition: PoolImpl.h:358
void setHardLockQueries(const HardLockQueries &newLocks_r)
Definition: PoolImpl.h:244
size_type hardLockQueriesSize() const
Definition: ResPool.cc:89
PoolItem find(const sat::Solvable &slv_r) const
Return the corresponding PoolItem.
Definition: ResPool.cc:70
ResPoolProxy proxy(ResPool self) const
Definition: PoolImpl.h:191
RW_pointer< pool::PoolTraits::Impl > _pimpl
Access to implementation.
Definition: ResPool.h:421
ResPool(pool::PoolTraits::Impl_Ptr impl_r)
Ctor.
Definition: ResPool.cc:44
void setRequestedLocales(const LocaleSet &locales_r)
Set the requested locales.
Definition: ResPool.cc:116
const pool::PoolTraits::ItemContainerT & store() const
Definition: ResPool.cc:105
const SerialNumber & serial() const
Housekeeping data serial number.
Definition: PoolImpl.h:143
bool eraseRequestedLocale(const Locale &locale_r)
Erase one Locale from the set of requested locales.
Definition: Pool.cc:221
std::unordered_set< Locale > LocaleSet
Definition: Locale.h:27
size_type size() const
Definition: ResPool.cc:66
bool empty() const
Definition: ResPool.cc:63
bool isAvailableLocale(const Locale &locale_r) const
Whether this Locale is in the set of available locales.
Definition: ResPool.cc:134
bool getHardLockQueries(HardLockQueries &activeLocks_r)
Definition: PoolImpl.h:261
static ResPool instance()
Singleton ctor.
Definition: ResPool.cc:33