libzypp  13.10.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->autoSoftLocks().empty(); }
88 
90  { return _pimpl->autoSoftLocks().size(); }
91 
93  { return _pimpl->autoSoftLocks().begin(); }
94 
96  { return _pimpl->autoSoftLocks().end(); }
97 
98  void ResPool::setAutoSoftLocks( const AutoSoftLocks & newLocks_r )
99  { _pimpl->setAutoSoftLocks( newLocks_r ); }
100 
102  { _pimpl->getActiveSoftLocks( activeLocks_r ); }
103 
104 
106  { return _pimpl->hardLockQueries().empty(); }
107 
109  { return _pimpl->hardLockQueries().size(); }
110 
112  { return _pimpl->hardLockQueries().begin(); }
113 
115  { return _pimpl->hardLockQueries().end(); }
116 
117  void ResPool::setHardLockQueries( const HardLockQueries & newLocks_r )
118  { _pimpl->setHardLockQueries( newLocks_r ); }
119 
121  { _pimpl->getHardLockQueries( activeLocks_r ); }
122 
123 
125  { return _pimpl->store(); }
126 
128  { return _pimpl->id2item(); }
129 
131  //
132  // Forward to sat::Pool:
133  //
135  void ResPool::setRequestedLocales( const LocaleSet & locales_r )
136  { sat::Pool::instance().setRequestedLocales( locales_r ); }
137 
138  bool ResPool::addRequestedLocale( const Locale & locale_r )
139  { return sat::Pool::instance().addRequestedLocale( locale_r ); }
140 
141  bool ResPool::eraseRequestedLocale( const Locale & locale_r )
142  { return sat::Pool::instance().eraseRequestedLocale( locale_r ); }
143 
146 
147  bool ResPool::isRequestedLocale( const Locale & locale_r ) const
148  { return sat::Pool::instance().isRequestedLocale( locale_r ); }
149 
152 
153  bool ResPool::isAvailableLocale( const Locale & locale_r ) const
154  { return sat::Pool::instance().isAvailableLocale( locale_r ); }
155 
156  /******************************************************************
157  **
158  ** FUNCTION NAME : operator<<
159  ** FUNCTION TYPE : std::ostream &
160  */
161  std::ostream & operator<<( std::ostream & str, const ResPool & obj )
162  {
163  return dumpPoolStats( str << "ResPool " << sat::Pool::instance() << endl << " ",
164  obj.begin(), obj.end() );
165  }
166 
168 } // namespace zypp
autoSoftLocks_iterator autoSoftLocksEnd() const
Definition: ResPool.cc:95
void getActiveSoftLocks(AutoSoftLocks &activeLocks_r)
Suggest a new soft-lock list based on the current selection.
Definition: ResPool.cc:101
A Solvable object within the sat Pool.
Definition: Solvable.h:55
const_iterator begin() const
Definition: ResPool.h:85
void setRequestedLocales(const LocaleSet &locales_r)
Set the requested locales.
Definition: Pool.cc:196
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:55
bool isRequestedLocale(const Locale &locale_r) const
Whether this Locale is in the set of requested locales.
Definition: ResPool.cc:147
const pool::PoolTraits::Id2ItemT & id2item() const
Definition: ResPool.cc:127
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:208
void setAutoSoftLocks(const AutoSoftLocks &newLocks_r)
Set a new soft-lock list.
Definition: ResPool.cc:98
const ContainerT & store() const
Definition: PoolImpl.h:367
pool::PoolTraits::HardLockQueries HardLockQueries
Definition: ResPool.h:366
const_iterator end() const
Definition: ResPool.h:88
bool hardLockQueriesEmpty() const
Definition: ResPool.cc:105
ResPool::instance().proxy();.
Definition: ResPoolProxy.h:34
void setAutoSoftLocks(const AutoSoftLocks &newLocks_r)
Definition: PoolImpl.h:311
bool eraseRequestedLocale(const Locale &locale_r)
Erase one Locale from the set of requested locales.
Definition: ResPool.cc:141
Repository reposFind(const std::string &alias_r) const
Find a Repository named alias_r.
Definition: ResPool.cc:83
const AutoSoftLocks & autoSoftLocks() const
Definition: PoolImpl.h:305
shared_ptr< PoolImpl > Impl_Ptr
Definition: PoolTraits.h:96
bool empty() const
Definition: PoolImpl.h:151
static Pool instance()
Singleton ctor.
Definition: Pool.h:51
pool::PoolTraits::autoSoftLocks_iterator autoSoftLocks_iterator
Definition: ResPool.h:337
repository_iterator knownRepositoriesEnd() const
Definition: ResPool.cc:80
ResPoolProxy proxy() const
preliminary
Definition: ResPool.cc:54
Dependency resolver interface.
Definition: Resolver.h:47
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:120
autoSoftLocks_iterator autoSoftLocksBegin() const
Definition: ResPool.cc:92
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:144
std::tr1::unordered_set< Locale > LocaleSet
Definition: Locale.h:28
hardLockQueries_iterator hardLockQueriesBegin() const
Definition: ResPool.cc:111
bool addRequestedLocale(const Locale &locale_r)
Add one Locale to the set of requested locales.
Definition: Pool.cc:199
size_type autoSoftLocksSize() const
Definition: ResPool.cc:89
Simple serial number provider.
Definition: SerialNumber.h:44
void getActiveSoftLocks(AutoSoftLocks &activeLocks_r)
Definition: PoolImpl.h:328
void setHardLockQueries(const HardLockQueries &newLocks_r)
Set a new set of queries.
Definition: ResPool.cc:117
pool::PoolTraits::AutoSoftLocks AutoSoftLocks
Definition: ResPool.h:336
repository_iterator knownRepositoriesBegin() const
Definition: ResPool.cc:77
Global ResObject pool.
Definition: ResPool.h:48
size_type knownRepositoriesSize() const
Definition: ResPool.cc:74
hardLockQueries_iterator hardLockQueriesEnd() const
Definition: ResPool.cc:114
const LocaleSet & getRequestedLocales() const
Return the requested locales.
Definition: Pool.cc:205
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:138
pool::PoolTraits::hardLockQueries_iterator hardLockQueries_iterator
Definition: ResPool.h:367
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:214
const SerialNumber & serial() const
The pools serial number.
Definition: ResPool.cc:60
const HardLockQueries & hardLockQueries() const
Definition: PoolImpl.h:222
Reference to a PoolItem connecting ResObject and ResStatus.
Definition: PoolItem.h:50
const LocaleSet & getAvailableLocales() const
Get the set of available locales.
Definition: Pool.cc:211
const LocaleSet & getAvailableLocales() const
Get the set of available locales.
Definition: ResPool.cc:150
Repository reposFind(const std::string &alias_r) const
Definition: PoolImpl.h:212
const Id2ItemT & id2item() const
Definition: PoolImpl.h:428
void setHardLockQueries(const HardLockQueries &newLocks_r)
Definition: PoolImpl.h:244
size_type hardLockQueriesSize() const
Definition: ResPool.cc:108
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
bool autoSoftLocksEmpty() const
Definition: ResPool.cc:86
RW_pointer< pool::PoolTraits::Impl > _pimpl
Access to implementation.
Definition: ResPool.h:394
std::tr1::unordered_multimap< sat::detail::IdType, PoolItem > Id2ItemT
ident index
Definition: PoolTraits.h:79
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:135
const pool::PoolTraits::ItemContainerT & store() const
Definition: ResPool.cc:124
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:202
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:153
bool getHardLockQueries(HardLockQueries &activeLocks_r)
Definition: PoolImpl.h:261
static ResPool instance()
Singleton ctor.
Definition: ResPool.cc:33