libzypp  17.35.14
ResPool.cc
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #include <iostream>
13 #include <utility>
14 //#include <zypp/base/Logger.h>
15 
16 #include <zypp/base/SerialNumber.h>
17 
18 #include <zypp/ZYppFactory.h>
19 #include <zypp/ResPool.h>
20 #include <zypp/pool/PoolImpl.h>
21 #include <zypp/pool/PoolStats.h>
22 
23 using std::endl;
24 
26 namespace zypp
27 {
28 
30  // class ResPool
32 
34  //
35  // METHOD NAME : ResPool::instance
36  // METHOD TYPE : ResPool
37  //
39  {
41  return _val;
42  }
43 
45  //
46  // METHOD NAME : ResPool::ResPool
47  // METHOD TYPE : Ctor
48  //
50  : _pimpl( std::move(impl_r) )
51  {}
52 
54  //
55  // Forward to impementation:
56  //
58 
60  { return _pimpl->proxy( *this ); }
61 
63  { return *getZYpp()->resolver(); }
64 
65  const SerialNumber & ResPool::serial() const
66  { return _pimpl->serial(); }
67 
68  bool ResPool::empty() const
69  { return _pimpl->empty(); }
70 
72  { return _pimpl->size(); }
73 
74  PoolItem ResPool::find( const sat::Solvable & slv_r ) const
75  { return _pimpl->find( slv_r ); }
76 
78  { return _pimpl->establishedStates(); }
79 
81  { return _pimpl->knownRepositoriesSize(); }
82 
84  { return _pimpl->knownRepositoriesBegin(); }
85 
87  { return _pimpl->knownRepositoriesEnd(); }
88 
89  Repository ResPool::reposFind( const std::string & alias_r ) const
90  { return _pimpl->reposFind( alias_r ); }
91 
93  { return _pimpl->hardLockQueries().empty(); }
94 
96  { return _pimpl->hardLockQueries().size(); }
97 
99  { return _pimpl->hardLockQueries().begin(); }
100 
102  { return _pimpl->hardLockQueries().end(); }
103 
104  void ResPool::setHardLockQueries( const HardLockQueries & newLocks_r )
105  { _pimpl->setHardLockQueries( newLocks_r ); }
106 
108  { _pimpl->getHardLockQueries( activeLocks_r ); }
109 
110 
112  { return _pimpl->store(); }
113 
115  { return _pimpl->id2item(); }
116 
118  //
119  // Forward to sat::Pool:
120  //
122  void ResPool::setRequestedLocales( const LocaleSet & locales_r )
123  { sat::Pool::instance().setRequestedLocales( locales_r ); }
124 
125  bool ResPool::addRequestedLocale( const Locale & locale_r )
126  { return sat::Pool::instance().addRequestedLocale( locale_r ); }
127 
128  bool ResPool::eraseRequestedLocale( const Locale & locale_r )
129  { return sat::Pool::instance().eraseRequestedLocale( locale_r ); }
130 
133 
134  bool ResPool::isRequestedLocale( const Locale & locale_r ) const
135  { return sat::Pool::instance().isRequestedLocale( locale_r ); }
136 
139 
140  bool ResPool::isAvailableLocale( const Locale & locale_r ) const
141  { return sat::Pool::instance().isAvailableLocale( locale_r ); }
142 
143  /******************************************************************
144  **
145  ** FUNCTION NAME : operator<<
146  ** FUNCTION TYPE : std::ostream &
147  */
148  std::ostream & operator<<( std::ostream & str, const ResPool & obj )
149  {
150  return dumpPoolStats( str << "ResPool " << sat::Pool::instance() << endl << " ",
151  obj.begin(), obj.end() );
152  }
153 
155 } // namespace zypp
A Solvable object within the sat Pool.
Definition: Solvable.h:53
A copy of the Pools initial ValidateValues of pseudo installed items.
Definition: ResPool.h:314
ResPoolProxy proxy() const
preliminary
Definition: ResPool.cc:59
void setRequestedLocales(const LocaleSet &locales_r)
Set the requested locales.
Definition: Pool.cc:236
bool empty() const
Definition: ResPool.cc:68
Repository reposFind(const std::string &alias_r) const
Find a Repository named alias_r.
Definition: ResPool.cc:89
const LocaleSet & getRequestedLocales() const
Return the requested locales.
Definition: ResPool.cc:131
const_iterator end() const
Definition: ResPool.h:101
pool::PoolTraits::hardLockQueries_iterator hardLockQueries_iterator
Definition: ResPool.h:440
PoolItem find(const sat::Solvable &slv_r) const
Return the corresponding PoolItem.
Definition: ResPool.cc:74
repository_iterator knownRepositoriesBegin() const
Definition: ResPool.cc:83
bool isAvailableLocale(const Locale &locale_r) const
Whether this Locale is in the set of available locales.
Definition: Pool.cc:258
std::unordered_set< Locale > LocaleSet
Definition: Locale.h:29
String related utilities and Regular expression matching.
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
Definition: SerialNumber.cc:52
Definition: Arch.h:363
std::vector< PoolItem > ItemContainerT
pure items
Definition: PoolTraits.h:71
repository_iterator knownRepositoriesEnd() const
Definition: ResPool.cc:86
const SerialNumber & serial() const
The pools serial number.
Definition: ResPool.cc:65
bool hardLockQueriesEmpty() const
Definition: ResPool.cc:92
ResPool::instance().proxy();.
Definition: ResPoolProxy.h:35
const_iterator begin() const
Definition: ResPool.h:98
bool eraseRequestedLocale(const Locale &locale_r)
Erase one Locale from the set of requested locales.
Definition: ResPool.cc:128
EstablishedStates establishedStates() const
Factory for EstablishedStates.
Definition: ResPool.cc:77
const LocaleSet & getAvailableLocales() const
Get the set of available locales.
Definition: Pool.cc:255
const pool::PoolTraits::Id2ItemT & id2item() const
Definition: ResPool.cc:114
static Pool instance()
Singleton ctor.
Definition: Pool.h:55
Dependency resolver interface.
Definition: Resolver.h:44
void getHardLockQueries(HardLockQueries &activeLocks_r)
Suggest a new set of queries based on the current selection.
Definition: ResPool.cc:107
hardLockQueries_iterator hardLockQueriesBegin() const
Definition: ResPool.cc:98
std::unordered_multimap< sat::detail::IdType, PoolItem > Id2ItemT
ident index
Definition: PoolTraits.h:77
Resolver & resolver() const
The Resolver.
Definition: ResPool.cc:62
const LocaleSet & getRequestedLocales() const
Return the requested locales.
Definition: Pool.cc:245
bool addRequestedLocale(const Locale &locale_r)
Add one Locale to the set of requested locales.
Definition: Pool.cc:239
Simple serial number provider.
Definition: SerialNumber.h:44
&#39;Language[_Country]&#39; codes.
Definition: Locale.h:50
void setHardLockQueries(const HardLockQueries &newLocks_r)
Set a new set of queries.
Definition: ResPool.cc:104
bool isRequestedLocale(const Locale &locale_r) const
Whether this Locale is in the set of requested locales.
Definition: ResPool.cc:134
Global ResObject pool.
Definition: ResPool.h:61
bool addRequestedLocale(const Locale &locale_r)
Add one Locale to the set of requested locales.
Definition: ResPool.cc:125
size_type size() const
Definition: ResPool.cc:71
pool::PoolTraits::size_type size_type
Definition: ResPool.h:68
size_type knownRepositoriesSize() const
Definition: ResPool.cc:80
bool isAvailableLocale(const Locale &locale_r) const
Whether this Locale is in the set of available locales.
Definition: ResPool.cc:140
Combining sat::Solvable and ResStatus.
Definition: PoolItem.h:50
hardLockQueries_iterator hardLockQueriesEnd() const
Definition: ResPool.cc:101
const LocaleSet & getAvailableLocales() const
Get the set of available locales.
Definition: ResPool.cc:137
size_type hardLockQueriesSize() const
Definition: ResPool.cc:95
RW_pointer< pool::PoolTraits::Impl > _pimpl
Access to implementation.
Definition: ResPool.h:470
Easy-to use interface to the ZYPP dependency resolver.
Definition: Application.cc:19
shared_ptr< PoolImpl > Impl_Ptr
Definition: PoolTraits.h:89
bool isRequestedLocale(const Locale &locale_r) const
Whether this Locale is in the set of requested locales.
Definition: Pool.cc:248
pool::PoolTraits::HardLockQueries HardLockQueries
Definition: ResPool.h:439
ResPool(pool::PoolTraits::Impl_Ptr impl_r)
Ctor.
Definition: ResPool.cc:49
void setRequestedLocales(const LocaleSet &locales_r)
Set the requested locales.
Definition: ResPool.cc:122
bool eraseRequestedLocale(const Locale &locale_r)
Erase one Locale from the set of requested locales.
Definition: Pool.cc:242
const pool::PoolTraits::ItemContainerT & store() const
Definition: ResPool.cc:111
static ResPool instance()
Singleton ctor.
Definition: ResPool.cc:38