libzypp: zypp/pool/PoolImpl.h Source File

libzypp 17.36.6

PoolImpl.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#ifndef ZYPP_POOL_POOLIMPL_H
13#define ZYPP_POOL_POOLIMPL_H
14
15#include <iosfwd>
16#include <utility>
17
18#include <zypp/base/Easy.h>
19#include <zypp/base/LogTools.h>
20#include <zypp/base/SerialNumber.h>
21#include <zypp-core/Globals.h>
22
23#include <zypp/pool/PoolTraits.h>
24#include <zypp/ResPoolProxy.h>
25#include <zypp/PoolQueryResult.h>
26
27#include <zypp/sat/Pool.h>
28#include <zypp/Product.h>
29
30using std::endl;
31
33namespace zypp
34{
35
36 namespace resstatus
37 {
43 struct UserLockQueryManip
44 {
46 static void setLock( ResStatus & status_r, bool yesno_r )
47 {
48 status_r.setLock( yesno_r, ResStatus::USER );
49 status_r.setUserLockQueryMatch( yesno_r );
50 }
51
53 static void reapplyLock( ResStatus & status_r, bool yesno_r )
54 {
55 if ( yesno_r && ! status_r.isUserLockQueryMatch() )
56 {
57 status_r.setLock( yesno_r, ResStatus::USER );
58 status_r.setUserLockQueryMatch( yesno_r );
59 }
60 }
61
63 static int diffLock( const ResStatus & status_r )
64 {
65 bool userLock( status_r.isUserLocked() );
66 if ( userLock == status_r.isUserLockQueryMatch() )
67 return 0;
68 return userLock ? 1 : -1;
69 }
70
71 };
72 }
73
74 namespace
75 {
76 inline PoolQuery makeTrivialQuery( IdString ident_r )
77 {
78 sat::Solvable::SplitIdent ident( ident_r );
79
80 PoolQuery q;
81 q.addAttribute( sat::SolvAttr::name, ident.name().asString() );
82 q.addKind( ident.kind() );
83 q.setMatchExact();
84 q.setCaseSensitive(true);
85 return q;
86 }
87
88 inline bool hardLockQueriesRemove( pool::PoolTraits::HardLockQueries & activeLocks_r, IdString ident_r )
89 {
90 unsigned s( activeLocks_r.size() );
91 activeLocks_r.remove( makeTrivialQuery( ident_r ) );
92 return( activeLocks_r.size() != s );
93 }
94
95 inline bool hardLockQueriesAdd( pool::PoolTraits::HardLockQueries & activeLocks_r, IdString ident_r )
96 {
97 PoolQuery q( makeTrivialQuery( ident_r ) );
98 for_( it, activeLocks_r.begin(), activeLocks_r.end() )
99 {
100 if ( *it == q )
101 return false;
102 }
103 activeLocks_r.push_back( q );
104 return true;
105 }
106 }
107
109 namespace solver {
110 namespace detail {
111 void establish( sat::Queue & pseudoItems_r, sat::Queue & pseudoFlags_r ); // in solver/detail/SATResolver.cc
112 }
113 }
114
117 class ResPool::EstablishedStates::Impl
118 {
119 public:
120 Impl()
121 { solver::detail::establish( _pseudoItems, _pseudoFlags ); }
122
124 ResPool::EstablishedStates::ChangedPseudoInstalled changedPseudoInstalled() const
125 {
126 ChangedPseudoInstalled ret;
127
128 if ( ! _pseudoItems.empty() )
129 {
130 for ( sat::Queue::size_type i = 0; i < _pseudoItems.size(); ++i )
131 {
132 PoolItem pi { sat::Solvable(_pseudoItems[i]) };
133 ResStatus::ValidateValue vorig { validateValue( i ) };
134 if ( pi.status().validate() != vorig )
135 ret[pi] = vorig;
136 }
137 }
138 return ret;
139 }
140
141 private:
142 ResStatus::ValidateValue validateValue( sat::Queue::size_type i ) const
143 {
144 ResStatus::ValidateValue ret { ResStatus::UNDETERMINED };
145 switch ( _pseudoFlags[i] )
146 {
147 case 0: ret = ResStatus::BROKEN /*2*/; break;
148 case 1: ret = ResStatus::SATISFIED /*4*/; break;
149 case -1: ret = ResStatus::NONRELEVANT /*6*/; break;
150 }
151 return ret;
152 }
153
154 private:
155 sat::Queue _pseudoItems;
156 sat::Queue _pseudoFlags;
157 };
158
160 namespace pool
161 {
162
164 //
165 // CLASS NAME : PoolImpl
166 //
168 class PoolImpl
169 {
170 friend std::ostream & operator<<( std::ostream & str, const PoolImpl & obj );
171
172 public:
174 using ContainerT = PoolTraits::ItemContainerT;
175 using size_type = PoolTraits::size_type;
176 using const_iterator = PoolTraits::const_iterator;
177 using Id2ItemT = PoolTraits::Id2ItemT;
178
179 using repository_iterator = PoolTraits::repository_iterator;
180
181 using SolvableIdType = sat::detail::SolvableIdType;
182
183 using EstablishedStatesImpl = ResPool::EstablishedStates::Impl;
184
185 public:
187 PoolImpl();
189 ~PoolImpl();
190
191 public:
193 const sat::Pool satpool() const
194 { return sat::Pool::instance(); }
195
197 const SerialNumber & serial() const
198 { return satpool().serial(); }
199
201 //
203 public:
205 bool empty() const
206 { return satpool().solvablesEmpty(); }
207
209 size_type size() const
210 { return satpool().solvablesSize(); }
211
212 const_iterator begin() const
213 { return make_filter_begin( pool::ByPoolItem(), store() ); }
214
215 const_iterator end() const
216 { return make_filter_end( pool::ByPoolItem(), store() ); }
217
218 public:
224 PoolItem find( const sat::Solvable & slv_r ) const
225 {
226 const ContainerT & mystore( store() );
227 return( slv_r.id() < mystore.size() ? mystore[slv_r.id()] : PoolItem() );
228 }
229
231 //
233 public:
236 void SaveState( const ResKind & kind_r );
237
238 void RestoreState( const ResKind & kind_r );
240
242 //
244 public:
245 ResPoolProxy proxy( ResPool self ) const
246 {
247 checkSerial();
248 if ( !_poolProxy )
249 {
250 _poolProxy.reset( new ResPoolProxy( std::move(self), *this ) );
251 }
252 return *_poolProxy;
253 }
254
260 ResPool::EstablishedStates establishedStates() const
261 { store(); return ResPool::EstablishedStates( _establishedStates ); }
262
263 public:
265 size_type knownRepositoriesSize() const
266 { checkSerial(); return satpool().reposSize(); }
267
268 repository_iterator knownRepositoriesBegin() const
269 { checkSerial(); return satpool().reposBegin(); }
270
271 repository_iterator knownRepositoriesEnd() const
272 { checkSerial(); return satpool().reposEnd(); }
273
274 Repository reposFind( const std::string & alias_r ) const
275 { checkSerial(); return satpool().reposFind( alias_r ); }
276
278 //
280 public:
281 using HardLockQueries = PoolTraits::HardLockQueries;
282 using hardLockQueries_iterator = PoolTraits::hardLockQueries_iterator;
283
284 const HardLockQueries & hardLockQueries() const
285 { return _hardLockQueries; }
286
287 void reapplyHardLocks() const
288 {
289 // It is assumed that reapplyHardLocks is called after new
290 // items were added to the pool, but the _hardLockQueries
291 // did not change since. Action is to be performed only on
292 // those items that gained the bit in the UserLockQueryField.
293 MIL << "Re-apply " << _hardLockQueries.size() << " HardLockQueries" << endl;
294 PoolQueryResult locked;
295 for_( it, _hardLockQueries.begin(), _hardLockQueries.end() )
296 {
297 locked += *it;
298 }
299 MIL << "HardLockQueries match " << locked.size() << " Solvables." << endl;
300 for_( it, begin(), end() )
301 {
302 // NOTE bsc#1225267: While reapplyLock sets but never unsets a lock,
303 // we don't need to care about buddies like in setHardLockQueries.
304 resstatus::UserLockQueryManip::reapplyLock( it->status(), locked.contains( *it ) );
305 }
306 }
307
308 void setHardLockQueries( const HardLockQueries & newLocks_r )
309 {
310 MIL << "Apply " << newLocks_r.size() << " HardLockQueries" << endl;
311 _hardLockQueries = newLocks_r;
312 // now adjust the pool status
313 PoolQueryResult locked;
314 for_( it, _hardLockQueries.begin(), _hardLockQueries.end() )
315 {
316 locked += *it;
317 }
318 MIL << "HardLockQueries match " << locked.size() << " Solvables." << endl;
319 for_( it, begin(), end() )
320 {
321 // NOTE bsc#1225267: If the item has a buddy (a shared ResStatus), we lock if
322 // the item or the buddy is locked. Otherwise the item occurring later in the
323 // pool would dictate the status (unsetting a previously set lock).
324 bool yesno = locked.contains( *it ) || ( it->buddy() && locked.contains( PoolItem(it->buddy()) ) );
325 resstatus::UserLockQueryManip::setLock( it->status(), yesno );
326 }
327 }
328
329 bool getHardLockQueries( HardLockQueries & activeLocks_r )
330 {
331 activeLocks_r = _hardLockQueries; // current queries
332 // Now diff to the pool collecting names only.
333 // Thus added and removed locks are not necessarily
334 // disjoint. Added locks win.
335 typedef std::unordered_set<IdString> IdentSet;
336 IdentSet addedLocks;
337 IdentSet removedLocks;
338 for_( it, begin(), end() )
339 {
340 switch ( resstatus::UserLockQueryManip::diffLock( it->status() ) )
341 {
342 case 0: // unchanged
343 break;
344 case 1:
345 addedLocks.insert( it->satSolvable().ident() );
346 break;
347 case -1:
348 removedLocks.insert( it->satSolvable().ident() );
349 break;
350 }
351 }
352 // now the bad part - adjust the queries
353 bool setChanged = false;
354 for_( it, removedLocks.begin(), removedLocks.end() )
355 {
356 if ( addedLocks.find( *it ) != addedLocks.end() )
357 continue; // Added locks win
358 if ( hardLockQueriesRemove( activeLocks_r, *it ) && ! setChanged )
359 setChanged = true;
360 }
361 for_( it, addedLocks.begin(), addedLocks.end() )
362 {
363 if ( hardLockQueriesAdd( activeLocks_r, *it ) && ! setChanged )
364 setChanged = true;
365 }
366 return setChanged;
367 }
368
369 public:
370 const ContainerT & store() const
371 {
372 checkSerial();
373 if ( _storeDirty )
374 {
375 sat::Pool pool( satpool() );
376 bool addedItems = false;
377 bool reusedIDs = _watcherIDs.remember( pool.serialIDs() );
378 std::list<PoolItem> addedProducts;
379
380 _store.resize( pool.capacity() );
381
382 if ( pool.capacity() )
383 {
384 for ( sat::detail::SolvableIdType i = pool.capacity()-1; i != 0; --i )
385 {
386 sat::Solvable s( i );
387 PoolItem & pi( _store[i] );
388 if ( ! s && pi )
389 {
390 // the PoolItem got invalidated (e.g unloaded repo)
391 pi = PoolItem();
392 }
393 else if ( reusedIDs || (s && ! pi) )
394 {
395 // new PoolItem to add
396 pi = PoolItem::makePoolItem( s ); // the only way to create a new one!
397 // remember products for buddy processing (requires clean store)
398 if ( s.isKind( ResKind::product ) )
399 addedProducts.push_back( pi );
400 if ( !addedItems )
401 addedItems = true;
402 }
403 }
404 }
405 _storeDirty = false;
406
407 // Now, as the pool is adjusted, ....
408
409 // .... we check for product buddies.
410 if ( ! addedProducts.empty() )
411 {
412 for_( it, addedProducts.begin(), addedProducts.end() )
413 {
414 it->setBuddy( asKind<Product>(*it)->referencePackage() );
415 }
416 }
417
418 // .... we must reapply those query based hard locks.
419 if ( addedItems )
420 {
421 reapplyHardLocks();
422 }
423
424 // Compute the initial status of Patches etc.
425 if ( !_establishedStates )
426 _establishedStates.reset( new EstablishedStatesImpl );
427 }
428 return _store;
429 }
430
431 const Id2ItemT & id2item () const
432 {
433 checkSerial();
434 if ( _id2itemDirty )
435 {
436 store();
437 _id2item = Id2ItemT( size() );
438 for_( it, begin(), end() )
439 {
440 const sat::Solvable &s = (*it)->satSolvable();
441 sat::detail::IdType id = s.ident().id();
442 if ( s.isKind( ResKind::srcpackage ) )
443 id = -id;
444 _id2item.insert( std::make_pair( id, *it ) );
445 }
446 //INT << _id2item << endl;
447 _id2itemDirty = false;
448 }
449 return _id2item;
450 }
451
453 //
455 private:
456 void checkSerial() const
457 {
458 if ( _watcher.remember( serial() ) )
459 invalidate();
460 satpool().prepare(); // always ajust dependencies.
461 }
462
463 void invalidate() const
464 {
465 _storeDirty = true;
466 _id2itemDirty = true;
467 _id2item.clear();
468 _poolProxy.reset();
469 _establishedStates.reset();
470 }
471
472 private:
474 SerialNumberWatcher _watcher;
476 SerialNumberWatcher _watcherIDs;
477 mutable ContainerT _store;
478 mutable DefaultIntegral<bool,true> _storeDirty;
479 mutable Id2ItemT _id2item;
480 mutable DefaultIntegral<bool,true> _id2itemDirty;
481
482 private:
483 mutable shared_ptr<ResPoolProxy> _poolProxy;
484 mutable shared_ptr<EstablishedStatesImpl> _establishedStates;
485
486 private:
488 HardLockQueries _hardLockQueries;
489 };
490
491
493 } // namespace pool
496} // namespace zypp
498#endif // ZYPP_POOL_POOLIMPL_H
PoolQueryResult.h
PoolTraits.h
Pool.h
Product.h
ResPoolProxy.h
SerialNumber.h
shared_ptr
zypp::DefaultIntegral
Integral type with defined initial value when default constructed.
Definition defaultintegral.h:42
zypp::IdStringType::asString
std::string asString() const
Definition IdStringType.h:108
zypp::IdString
Access to the sat-pools string space.
Definition IdString.h:44
zypp::IdString::id
IdType id() const
Expert backdoor.
Definition IdString.h:133
zypp::PoolItem
Combining sat::Solvable and ResStatus.
Definition PoolItem.h:51
zypp::PoolItem::makePoolItem
static PoolItem makePoolItem(const sat::Solvable &solvable_r)
PoolItem generator for pool::PoolImpl.
Definition PoolItem.cc:200
zypp::PoolQueryResult
Helper class to collect (not only) PoolQuery results.
Definition PoolQueryResult.h:76
zypp::PoolQueryResult::size
size_type size() const
The number of sat::Solvables.
Definition PoolQueryResult.h:114
zypp::PoolQueryResult::contains
bool contains(sat::Solvable result_r) const
Test whether some item is in the result set.
Definition PoolQueryResult.h:124
zypp::PoolQuery
Meta-data query API.
Definition PoolQuery.h:91
zypp::Repository
Definition Repository.h:40
zypp::ResKind
Resolvable kinds.
Definition ResKind.h:33
zypp::ResKind::srcpackage
static const ResKind srcpackage
Definition ResKind.h:44
zypp::ResKind::product
static const ResKind product
Definition ResKind.h:43
zypp::ResPoolProxy
ResPool::instance().proxy();.
Definition ResPoolProxy.h:36
zypp::ResPool::EstablishedStates::Impl
Store initial establish status of pseudo installed items.
Definition PoolImpl.h:118
zypp::ResPool::EstablishedStates::Impl::validateValue
ResStatus::ValidateValue validateValue(sat::Queue::size_type i) const
Definition PoolImpl.h:142
zypp::ResPool::EstablishedStates::Impl::changedPseudoInstalled
ResPool::EstablishedStates::ChangedPseudoInstalled changedPseudoInstalled() const
Return all pseudo installed items whose current state differs from their initial one.
Definition PoolImpl.h:124
zypp::ResPool::EstablishedStates::Impl::_pseudoItems
sat::Queue _pseudoItems
Definition PoolImpl.h:155
zypp::ResPool::EstablishedStates::Impl::Impl
Impl()
Definition PoolImpl.h:120
zypp::ResPool::EstablishedStates::Impl::_pseudoFlags
sat::Queue _pseudoFlags
Definition PoolImpl.h:156
zypp::ResPool::EstablishedStates
A copy of the Pools initial ValidateValues of pseudo installed items.
Definition ResPool.h:315
zypp::ResPool::EstablishedStates::ChangedPseudoInstalled
std::map< PoolItem, ResStatus::ValidateValue > ChangedPseudoInstalled
Map holding pseudo installed items where current and established status differ.
Definition ResPool.h:319
zypp::ResPool
Global ResObject pool.
Definition ResPool.h:62
zypp::ResStatus
Status bitfield.
Definition ResStatus.h:55
zypp::ResStatus::setUserLockQueryMatch
void setUserLockQueryMatch(bool match_r)
Definition ResStatus.h:341
zypp::ResStatus::isUserLockQueryMatch
bool isUserLockQueryMatch() const
Definition ResStatus.h:345
zypp::ResStatus::ValidateValue
ValidateValue
Definition ResStatus.h:95
zypp::ResStatus::NONRELEVANT
@ NONRELEVANT
Definition ResStatus.h:99
zypp::ResStatus::SATISFIED
@ SATISFIED
Definition ResStatus.h:98
zypp::ResStatus::UNDETERMINED
@ UNDETERMINED
Definition ResStatus.h:96
zypp::ResStatus::BROKEN
@ BROKEN
Definition ResStatus.h:97
zypp::ResStatus::setLock
bool setLock(bool toLock_r, TransactByValue causer_r)
Apply a lock (prevent transaction).
Definition ResStatus.h:393
zypp::ResStatus::USER
@ USER
Definition ResStatus.h:112
zypp::ResStatus::isUserLocked
bool isUserLocked() const
Definition ResStatus.h:273
zypp::SerialNumberWatcher
Simple serial number watcher.
Definition SerialNumber.h:123
zypp::SerialNumber
Simple serial number provider.
Definition SerialNumber.h:45
zypp::pool::PoolImpl::begin
const_iterator begin() const
Definition PoolImpl.h:212
zypp::pool::PoolImpl::reapplyHardLocks
void reapplyHardLocks() const
Definition PoolImpl.h:287
zypp::pool::PoolImpl::HardLockQueries
PoolTraits::HardLockQueries HardLockQueries
Definition PoolImpl.h:281
zypp::pool::PoolImpl::empty
bool empty() const
Definition PoolImpl.h:205
zypp::pool::PoolImpl::find
PoolItem find(const sat::Solvable &slv_r) const
Return the corresponding PoolItem.
Definition PoolImpl.h:224
zypp::pool::PoolImpl::_hardLockQueries
HardLockQueries _hardLockQueries
Set of queries that define hardlocks.
Definition PoolImpl.h:488
zypp::pool::PoolImpl::ContainerT
PoolTraits::ItemContainerT ContainerT
Definition PoolImpl.h:174
zypp::pool::PoolImpl::PoolImpl
PoolImpl()
Default ctor.
Definition PoolImpl.cc:44
zypp::pool::PoolImpl::invalidate
void invalidate() const
Definition PoolImpl.h:463
zypp::pool::PoolImpl::establishedStates
ResPool::EstablishedStates establishedStates() const
True factory for ResPool::EstablishedStates.
Definition PoolImpl.h:260
zypp::pool::PoolImpl::reposFind
Repository reposFind(const std::string &alias_r) const
Definition PoolImpl.h:274
zypp::pool::PoolImpl::size_type
PoolTraits::size_type size_type
Definition PoolImpl.h:175
zypp::pool::PoolImpl::_poolProxy
shared_ptr< ResPoolProxy > _poolProxy
Definition PoolImpl.h:483
zypp::pool::PoolImpl::hardLockQueries
const HardLockQueries & hardLockQueries() const
Definition PoolImpl.h:284
zypp::pool::PoolImpl::knownRepositoriesBegin
repository_iterator knownRepositoriesBegin() const
Definition PoolImpl.h:268
zypp::pool::PoolImpl::_id2item
Id2ItemT _id2item
Definition PoolImpl.h:479
zypp::pool::PoolImpl::RestoreState
void RestoreState(const ResKind &kind_r)
zypp::pool::PoolImpl::serial
const SerialNumber & serial() const
Housekeeping data serial number.
Definition PoolImpl.h:197
zypp::pool::PoolImpl::operator<<
friend std::ostream & operator<<(std::ostream &str, const PoolImpl &obj)
zypp::pool::PoolImpl::_id2itemDirty
DefaultIntegral< bool, true > _id2itemDirty
Definition PoolImpl.h:480
zypp::pool::PoolImpl::_establishedStates
shared_ptr< EstablishedStatesImpl > _establishedStates
Definition PoolImpl.h:484
zypp::pool::PoolImpl::~PoolImpl
~PoolImpl()
Dtor.
Definition PoolImpl.cc:52
zypp::pool::PoolImpl::end
const_iterator end() const
Definition PoolImpl.h:215
zypp::pool::PoolImpl::proxy
ResPoolProxy proxy(ResPool self) const
Definition PoolImpl.h:245
zypp::pool::PoolImpl::_storeDirty
DefaultIntegral< bool, true > _storeDirty
Definition PoolImpl.h:478
zypp::pool::PoolImpl::SaveState
void SaveState(const ResKind &kind_r)
zypp::pool::PoolImpl::setHardLockQueries
void setHardLockQueries(const HardLockQueries &newLocks_r)
Definition PoolImpl.h:308
zypp::pool::PoolImpl::_watcherIDs
SerialNumberWatcher _watcherIDs
Watch sat pools Serial number of IDs - changes whenever resusePoolIDs==true - ResPool must also inval...
Definition PoolImpl.h:476
zypp::pool::PoolImpl::satpool
const sat::Pool satpool() const
convenience.
Definition PoolImpl.h:193
zypp::pool::PoolImpl::hardLockQueries_iterator
PoolTraits::hardLockQueries_iterator hardLockQueries_iterator
Definition PoolImpl.h:282
zypp::pool::PoolImpl::_watcher
SerialNumberWatcher _watcher
Watch sat pools serial number.
Definition PoolImpl.h:474
zypp::pool::PoolImpl::getHardLockQueries
bool getHardLockQueries(HardLockQueries &activeLocks_r)
Definition PoolImpl.h:329
zypp::pool::PoolImpl::knownRepositoriesSize
size_type knownRepositoriesSize() const
Forward list of Repositories that contribute ResObjects from sat::Pool.
Definition PoolImpl.h:265
zypp::pool::PoolImpl::size
size_type size() const
Definition PoolImpl.h:209
zypp::pool::PoolImpl::id2item
const Id2ItemT & id2item() const
Definition PoolImpl.h:431
zypp::pool::PoolImpl::store
const ContainerT & store() const
Definition PoolImpl.h:370
zypp::pool::PoolImpl::const_iterator
PoolTraits::const_iterator const_iterator
Definition PoolImpl.h:176
zypp::pool::PoolImpl::Id2ItemT
PoolTraits::Id2ItemT Id2ItemT
Definition PoolImpl.h:177
zypp::pool::PoolImpl::EstablishedStatesImpl
ResPool::EstablishedStates::Impl EstablishedStatesImpl
Definition PoolImpl.h:183
zypp::pool::PoolImpl::checkSerial
void checkSerial() const
Definition PoolImpl.h:456
zypp::pool::PoolImpl::knownRepositoriesEnd
repository_iterator knownRepositoriesEnd() const
Definition PoolImpl.h:271
zypp::pool::PoolImpl::repository_iterator
PoolTraits::repository_iterator repository_iterator
Definition PoolImpl.h:179
zypp::pool::PoolImpl::SolvableIdType
sat::detail::SolvableIdType SolvableIdType
Definition PoolImpl.h:181
zypp::pool::PoolImpl::_store
ContainerT _store
Definition PoolImpl.h:477
zypp::sat::Pool
Global sat-pool.
Definition Pool.h:47
zypp::sat::Pool::reposEnd
RepositoryIterator reposEnd() const
Iterator behind the last Repository.
Definition Pool.cc:87
zypp::sat::Pool::reposSize
size_type reposSize() const
Number of repos in Pool.
Definition Pool.cc:73
zypp::sat::Pool::solvablesEmpty
bool solvablesEmpty() const
Whether Pool contains solvables.
Definition Pool.cc:90
zypp::sat::Pool::reposBegin
RepositoryIterator reposBegin() const
Iterator to the first Repository.
Definition Pool.cc:76
zypp::sat::Pool::reposFind
Repository reposFind(const std::string &alias_r) const
Find a Repository named alias_r.
Definition Pool.cc:163
zypp::sat::Pool::solvablesSize
size_type solvablesSize() const
Number of solvables in Pool.
Definition Pool.cc:103
zypp::sat::Pool::serial
const SerialNumber & serial() const
Housekeeping data serial number.
Definition Pool.cc:55
zypp::sat::Pool::instance
static Pool instance()
Singleton ctor.
Definition Pool.h:55
zypp::sat::Pool::prepare
void prepare() const
Update housekeeping data if necessary (e.g.
Definition Pool.cc:61
zypp::sat::Queue
Libsolv Id queue wrapper.
Definition Queue.h:36
zypp::sat::Queue::size_type
unsigned int size_type
Definition Queue.h:38
zypp::sat::SolvAttr::name
static const SolvAttr name
Definition SolvAttr.h:52
zypp::sat::Solvable
A Solvable object within the sat Pool.
Definition Solvable.h:54
zypp::sat::Solvable::id
IdType id() const
Expert backdoor.
Definition Solvable.h:445
zypp::sat::Solvable::isKind
bool isKind(const ResKind &kind_r) const
Test whether a Solvable is of a certain ResKind.
Definition Solvable.cc:303
zypp::sat::Solvable::ident
IdString ident() const
The identifier.
Definition Solvable.cc:270
str
String related utilities and Regular expression matching.
zypp::pool
Definition ByIdent.h:24
zypp::resstatus
Definition PoolImpl.h:37
zypp::sat::detail::SolvableIdType
unsigned int SolvableIdType
Id type to connect Solvable and sat-solvable.
Definition PoolMember.h:125
zypp::sat::detail::IdType
int IdType
Generic Id type.
Definition PoolMember.h:104
zypp::solver::detail
Definition PoolImpl.h:110
zypp::solver::detail::establish
void establish(sat::Queue &pseudoItems_r, sat::Queue &pseudoFlags_r)
ResPool helper to compute the initial status of Patches etc.
Definition SATResolver.cc:188
zypp::solver
Definition PoolImpl.h:109
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition Application.cc:20
zypp::make_filter_begin
filter_iterator< TFilter, typename TContainer::const_iterator > make_filter_begin(TFilter f, const TContainer &c)
Convenience to create filter_iterator from container::begin().
Definition Iterator.h:101
zypp::make_filter_end
filter_iterator< TFilter, typename TContainer::const_iterator > make_filter_end(TFilter f, const TContainer &c)
Convenience to create filter_iterator from container::end().
Definition Iterator.h:117
zypp::asKind
ResTraits< TRes >::PtrType asKind(const sat::Solvable &solvable_r)
Directly create a certain kind of ResObject from sat::Solvable.
Definition ResObject.h:127
zypp::pool::ByPoolItem
Pool internal filter skiping invalid/unwanted PoolItems.
Definition PoolTraits.h:41
zypp::pool::PoolTraits::const_iterator
filter_iterator< ByPoolItem, ItemContainerT::const_iterator > const_iterator
Definition PoolTraits.h:73
zypp::pool::PoolTraits::repository_iterator
sat::Pool::RepositoryIterator repository_iterator
list of known Repositories
Definition PoolTraits.h:82
zypp::pool::PoolTraits::Id2ItemT
std::unordered_multimap< sat::detail::IdType, PoolItem > Id2ItemT
ident index
Definition PoolTraits.h:77
zypp::pool::PoolTraits::size_type
ItemContainerT::size_type size_type
Definition PoolTraits.h:74
zypp::pool::PoolTraits::hardLockQueries_iterator
HardLockQueries::const_iterator hardLockQueries_iterator
Definition PoolTraits.h:86
zypp::pool::PoolTraits::ItemContainerT
std::vector< PoolItem > ItemContainerT
pure items
Definition PoolTraits.h:71
zypp::pool::PoolTraits::HardLockQueries
std::list< PoolQuery > HardLockQueries
hard locks from etc/zypp/locks
Definition PoolTraits.h:85
zypp::resstatus::UserLockQueryManip
Manipulator for ResStatus::UserLockQueryField.
Definition PoolImpl.h:44
zypp::resstatus::UserLockQueryManip::setLock
static void setLock(ResStatus &status_r, bool yesno_r)
Set lock and UserLockQuery bit according to yesno_r.
Definition PoolImpl.h:46
zypp::resstatus::UserLockQueryManip::reapplyLock
static void reapplyLock(ResStatus &status_r, bool yesno_r)
Update lock and UserLockQuery bit IFF the item gained the bit.
Definition PoolImpl.h:53
zypp::resstatus::UserLockQueryManip::diffLock
static int diffLock(const ResStatus &status_r)
Test whether the lock status differs from the remembered UserLockQuery bit.
Definition PoolImpl.h:63
Globals.h
Provides API related macros.
for_
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Definition Easy.h:27
MIL
#define MIL
Definition Logger.h:100
Easy.h
LogTools.h