libzypp: zypp/pool/PoolImpl.h Source File

libzypp 17.25.10

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
17 #include <zypp/base/Easy.h>
18 #include <zypp/base/LogTools.h>
19 #include <zypp/base/SerialNumber.h>
20 #include <zypp/APIConfig.h>
21
22 #include <zypp/pool/PoolTraits.h>
23 #include <zypp/ResPoolProxy.h>
24 #include <zypp/PoolQueryResult.h>
25
26 #include <zypp/sat/Pool.h>
27 #include <zypp/Product.h>
28
29 using std::endl;
30
32 namespace zypp
33 {
34
35 namespace resstatus
36 {
42 struct UserLockQueryManip
43 {
45 static void setLock( ResStatus & status_r, bool yesno_r )
46 {
47 status_r.setLock( yesno_r, ResStatus::USER );
48 status_r.setUserLockQueryMatch( yesno_r );
49 }
50
52 static void reapplyLock( ResStatus & status_r, bool yesno_r )
53 {
54 if ( yesno_r && ! status_r.isUserLockQueryMatch() )
55 {
56 status_r.setLock( yesno_r, ResStatus::USER );
57 status_r.setUserLockQueryMatch( yesno_r );
58 }
59 }
60
62 static int diffLock( const ResStatus & status_r )
63 {
64 bool userLock( status_r.isUserLocked() );
65 if ( userLock == status_r.isUserLockQueryMatch() )
66 return 0;
67 return userLock ? 1 : -1;
68 }
69
70 };
71 }
72
73 namespace
74 {
75 inline PoolQuery makeTrivialQuery( IdString ident_r )
76 {
77 sat::Solvable::SplitIdent ident( ident_r );
78
79 PoolQuery q;
80 q.addAttribute( sat::SolvAttr::name, ident.name().asString() );
81 q.addKind( ident.kind() );
82 q.setMatchExact();
83 q.setCaseSensitive(true);
84 return q;
85 }
86
87 inline bool hardLockQueriesRemove( pool::PoolTraits::HardLockQueries & activeLocks_r, IdString ident_r )
88 {
89 unsigned s( activeLocks_r.size() );
90 activeLocks_r.remove( makeTrivialQuery( ident_r ) );
91 return( activeLocks_r.size() != s );
92 }
93
94 inline bool hardLockQueriesAdd( pool::PoolTraits::HardLockQueries & activeLocks_r, IdString ident_r )
95 {
96 PoolQuery q( makeTrivialQuery( ident_r ) );
97 for_( it, activeLocks_r.begin(), activeLocks_r.end() )
98 {
99 if ( *it == q )
100 return false;
101 }
102 activeLocks_r.push_back( q );
103 return true;
104 }
105 }
106
108 namespace solver {
109 namespace detail {
110 void establish( sat::Queue & pseudoItems_r, sat::Queue & pseudoFlags_r ); // in solver/detail/SATResolver.cc
111 }
112 }
116 class ResPool::EstablishedStates::Impl
117 {
118 public:
119 Impl()
120 { solver::detail::establish( _pseudoItems, _pseudoFlags ); }
121
123 ResPool::EstablishedStates::ChangedPseudoInstalled changedPseudoInstalled() const
124 {
125 ChangedPseudoInstalled ret;
126
127 if ( ! _pseudoItems.empty() )
128 {
129 for ( sat::Queue::size_type i = 0; i < _pseudoItems.size(); ++i )
130 {
131 PoolItem pi { sat::Solvable(_pseudoItems[i]) };
132 ResStatus::ValidateValue vorig { validateValue( i ) };
133 if ( pi.status().validate() != vorig )
134 ret[pi] = vorig;
135 }
136 }
137 return ret;
138 }
139
140 private:
141 ResStatus::ValidateValue validateValue( sat::Queue::size_type i ) const
142 {
143 ResStatus::ValidateValue ret { ResStatus::UNDETERMINED };
144 switch ( _pseudoFlags[i] )
145 {
146 case 0: ret = ResStatus::BROKEN /*2*/; break;
147 case 1: ret = ResStatus::SATISFIED /*4*/; break;
148 case -1: ret = ResStatus::NONRELEVANT /*6*/; break;
149 }
150 return ret;
151 }
152
153 private:
154 sat::Queue _pseudoItems;
155 sat::Queue _pseudoFlags;
156 };
157
159 namespace pool
160 {
161
163 //
164 // CLASS NAME : PoolImpl
165 //
167 class PoolImpl
168 {
169 friend std::ostream & operator<<( std::ostream & str, const PoolImpl & obj );
170
171 public:
173 typedef PoolTraits::ItemContainerT ContainerT;
174 typedef PoolTraits::size_type size_type;
175 typedef PoolTraits::const_iterator const_iterator;
176 typedef PoolTraits::Id2ItemT Id2ItemT;
177
178 typedef PoolTraits::repository_iterator repository_iterator;
179
180 typedef sat::detail::SolvableIdType SolvableIdType;
181
182 typedef ResPool::EstablishedStates::Impl EstablishedStatesImpl;
183
184 public:
186 PoolImpl();
188 ~PoolImpl();
189
190 public:
192 const sat::Pool satpool() const
193 { return sat::Pool::instance(); }
194
196 const SerialNumber & serial() const
197 { return satpool().serial(); }
198
200 //
202 public:
204 bool empty() const
205 { return satpool().solvablesEmpty(); }
206
208 size_type size() const
209 { return satpool().solvablesSize(); }
210
211 const_iterator begin() const
212 { return make_filter_begin( pool::ByPoolItem(), store() ); }
213
214 const_iterator end() const
215 { return make_filter_end( pool::ByPoolItem(), store() ); }
216
217 public:
223 PoolItem find( const sat::Solvable & slv_r ) const
224 {
225 const ContainerT & mystore( store() );
226 return( slv_r.id() < mystore.size() ? mystore[slv_r.id()] : PoolItem() );
227 }
228
230 //
232 public:
235 void SaveState( const ResKind & kind_r );
236
237 void RestoreState( const ResKind & kind_r );
239
241 //
243 public:
244 ResPoolProxy proxy( ResPool self ) const
245 {
246 checkSerial();
247 if ( !_poolProxy )
248 {
249 _poolProxy.reset( new ResPoolProxy( self, *this ) );
250 }
251 return *_poolProxy;
252 }
253
259 ResPool::EstablishedStates establishedStates() const
260 { store(); return ResPool::EstablishedStates( _establishedStates ); }
261
262 public:
264 size_type knownRepositoriesSize() const
265 { checkSerial(); return satpool().reposSize(); }
266
267 repository_iterator knownRepositoriesBegin() const
268 { checkSerial(); return satpool().reposBegin(); }
269
270 repository_iterator knownRepositoriesEnd() const
271 { checkSerial(); return satpool().reposEnd(); }
272
273 Repository reposFind( const std::string & alias_r ) const
274 { checkSerial(); return satpool().reposFind( alias_r ); }
275
277 //
279 public:
280 typedef PoolTraits::HardLockQueries HardLockQueries;
281 typedef PoolTraits::hardLockQueries_iterator hardLockQueries_iterator;
282
283 const HardLockQueries & hardLockQueries() const
284 { return _hardLockQueries; }
285
286 void reapplyHardLocks() const
287 {
288 // It is assumed that reapplyHardLocks is called after new
289 // items were added to the pool, but the _hardLockQueries
290 // did not change since. Action is to be performed only on
291 // those items that gained the bit in the UserLockQueryField.
292 MIL << "Re-apply " << _hardLockQueries.size() << " HardLockQueries" << endl;
293 PoolQueryResult locked;
294 for_( it, _hardLockQueries.begin(), _hardLockQueries.end() )
295 {
296 locked += *it;
297 }
298 MIL << "HardLockQueries match " << locked.size() << " Solvables." << endl;
299 for_( it, begin(), end() )
300 {
301 resstatus::UserLockQueryManip::reapplyLock( it->status(), locked.contains( *it ) );
302 }
303 }
304
305 void setHardLockQueries( const HardLockQueries & newLocks_r )
306 {
307 MIL << "Apply " << newLocks_r.size() << " HardLockQueries" << endl;
308 _hardLockQueries = newLocks_r;
309 // now adjust the pool status
310 PoolQueryResult locked;
311 for_( it, _hardLockQueries.begin(), _hardLockQueries.end() )
312 {
313 locked += *it;
314 }
315 MIL << "HardLockQueries match " << locked.size() << " Solvables." << endl;
316 for_( it, begin(), end() )
317 {
318 resstatus::UserLockQueryManip::setLock( it->status(), locked.contains( *it ) );
319 }
320 }
321
322 bool getHardLockQueries( HardLockQueries & activeLocks_r )
323 {
324 activeLocks_r = _hardLockQueries; // current queries
325 // Now diff to the pool collecting names only.
326 // Thus added and removed locks are not necessarily
327 // disjoint. Added locks win.
328 typedef std::unordered_set<IdString> IdentSet;
329 IdentSet addedLocks;
330 IdentSet removedLocks;
331 for_( it, begin(), end() )
332 {
333 switch ( resstatus::UserLockQueryManip::diffLock( it->status() ) )
334 {
335 case 0: // unchanged
336 break;
337 case 1:
338 addedLocks.insert( it->satSolvable().ident() );
339 break;
340 case -1:
341 removedLocks.insert( it->satSolvable().ident() );
342 break;
343 }
344 }
345 // now the bad part - adjust the queries
346 bool setChanged = false;
347 for_( it, removedLocks.begin(), removedLocks.end() )
348 {
349 if ( addedLocks.find( *it ) != addedLocks.end() )
350 continue; // Added locks win
351 if ( hardLockQueriesRemove( activeLocks_r, *it ) && ! setChanged )
352 setChanged = true;
353 }
354 for_( it, addedLocks.begin(), addedLocks.end() )
355 {
356 if ( hardLockQueriesAdd( activeLocks_r, *it ) && ! setChanged )
357 setChanged = true;
358 }
359 return setChanged;
360 }
361
362 public:
363 const ContainerT & store() const
364 {
365 checkSerial();
366 if ( _storeDirty )
367 {
368 sat::Pool pool( satpool() );
369 bool addedItems = false;
370 bool reusedIDs = _watcherIDs.remember( pool.serialIDs() );
371 std::list<PoolItem> addedProducts;
372
373 _store.resize( pool.capacity() );
374
375 if ( pool.capacity() )
376 {
377 for ( sat::detail::SolvableIdType i = pool.capacity()-1; i != 0; --i )
378 {
379 sat::Solvable s( i );
380 PoolItem & pi( _store[i] );
381 if ( ! s && pi )
382 {
383 // the PoolItem got invalidated (e.g unloaded repo)
384 pi = PoolItem();
385 }
386 else if ( reusedIDs || (s && ! pi) )
387 {
388 // new PoolItem to add
389 pi = PoolItem::makePoolItem( s ); // the only way to create a new one!
390 // remember products for buddy processing (requires clean store)
391 if ( s.isKind( ResKind::product ) )
392 addedProducts.push_back( pi );
393 if ( !addedItems )
394 addedItems = true;
395 }
396 }
397 }
398 _storeDirty = false;
399
400 // Now, as the pool is adjusted, ....
401
402 // .... we check for product buddies.
403 if ( ! addedProducts.empty() )
404 {
405 for_( it, addedProducts.begin(), addedProducts.end() )
406 {
407 it->setBuddy( asKind<Product>(*it)->referencePackage() );
408 }
409 }
410
411 // .... we must reapply those query based hard locks.
412 if ( addedItems )
413 {
414 reapplyHardLocks();
415 }
416
417 // Compute the initial status of Patches etc.
418 if ( !_establishedStates )
419 _establishedStates.reset( new EstablishedStatesImpl );
420 }
421 return _store;
422 }
423
424 const Id2ItemT & id2item () const
425 {
426 checkSerial();
427 if ( _id2itemDirty )
428 {
429 store();
430 _id2item = Id2ItemT( size() );
431 for_( it, begin(), end() )
432 {
433 const sat::Solvable &s = (*it)->satSolvable();
434 sat::detail::IdType id = s.ident().id();
435 if ( s.isKind( ResKind::srcpackage ) )
436 id = -id;
437 _id2item.insert( std::make_pair( id, *it ) );
438 }
439 //INT << _id2item << endl;
440 _id2itemDirty = false;
441 }
442 return _id2item;
443 }
444
446 //
448 private:
449 void checkSerial() const
450 {
451 if ( _watcher.remember( serial() ) )
452 invalidate();
453 satpool().prepare(); // always ajust dependencies.
454 }
455
456 void invalidate() const
457 {
458 _storeDirty = true;
459 _id2itemDirty = true;
460 _id2item.clear();
461 _poolProxy.reset();
462 _establishedStates.reset();
463 }
464
465 private:
467 SerialNumberWatcher _watcher;
469 SerialNumberWatcher _watcherIDs;
470 mutable ContainerT _store;
471 mutable DefaultIntegral<bool,true> _storeDirty;
472 mutable Id2ItemT _id2item;
473 mutable DefaultIntegral<bool,true> _id2itemDirty;
474
475 private:
476 mutable shared_ptr<ResPoolProxy> _poolProxy;
477 mutable shared_ptr<EstablishedStatesImpl> _establishedStates;
478
479 private:
481 HardLockQueries _hardLockQueries;
482 };
484
486 } // namespace pool
489 } // namespace zypp
491 #endif // ZYPP_POOL_POOLIMPL_H
Easy.h
for_
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Definition: Easy.h:28
LogTools.h
MIL
#define MIL
Definition: Logger.h:91
PoolQueryResult.h
PoolTraits.h
Pool.h
Product.h
ResPoolProxy.h
SerialNumber.h
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:106
zypp::IdString::id
IdType id() const
Expert backdoor.
Definition: IdString.h:122
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:192
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::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:35
zypp::ResPool::EstablishedStates::Impl
Store initial establish status of pseudo installed items.
Definition: PoolImpl.h:117
zypp::ResPool::EstablishedStates::Impl::validateValue
ResStatus::ValidateValue validateValue(sat::Queue::size_type i) const
Definition: PoolImpl.h:141
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:123
zypp::ResPool::EstablishedStates::Impl::_pseudoItems
sat::Queue _pseudoItems
Definition: PoolImpl.h:154
zypp::ResPool::EstablishedStates::Impl::Impl
Impl()
Definition: PoolImpl.h:119
zypp::ResPool::EstablishedStates::Impl::_pseudoFlags
sat::Queue _pseudoFlags
Definition: PoolImpl.h:155
zypp::ResPool::EstablishedStates
A copy of the Pools initial ValidateValues of pseudo installed items.
Definition: ResPool.h:314
zypp::ResPool::EstablishedStates::ChangedPseudoInstalled
std::map< PoolItem, ResStatus::ValidateValue > ChangedPseudoInstalled
Map holding pseudo installed items where current and established status differ.
Definition: ResPool.h:318
zypp::ResPool
Global ResObject pool.
Definition: ResPool.h:61
zypp::ResStatus
Status bitfield.
Definition: ResStatus.h:54
zypp::ResStatus::setUserLockQueryMatch
void setUserLockQueryMatch(bool match_r)
Definition: ResStatus.h:339
zypp::ResStatus::isUserLockQueryMatch
bool isUserLockQueryMatch() const
Definition: ResStatus.h:336
zypp::ResStatus::ValidateValue
ValidateValue
Definition: ResStatus.h:94
zypp::ResStatus::NONRELEVANT
@ NONRELEVANT
Definition: ResStatus.h:98
zypp::ResStatus::SATISFIED
@ SATISFIED
Definition: ResStatus.h:97
zypp::ResStatus::UNDETERMINED
@ UNDETERMINED
Definition: ResStatus.h:95
zypp::ResStatus::BROKEN
@ BROKEN
Definition: ResStatus.h:96
zypp::ResStatus::setLock
bool setLock(bool toLock_r, TransactByValue causer_r)
Apply a lock (prevent transaction).
Definition: ResStatus.h:388
zypp::ResStatus::USER
@ USER
Definition: ResStatus.h:111
zypp::ResStatus::isUserLocked
bool isUserLocked() const
Definition: ResStatus.h:267
zypp::SerialNumberWatcher
Simple serial number watcher.
Definition: SerialNumber.h:123
zypp::SerialNumberWatcher::remember
bool remember(unsigned serial_r) const
Return isDirty, storing serial_r as new value.
Definition: SerialNumber.h:160
zypp::SerialNumber
Simple serial number provider.
Definition: SerialNumber.h:45
zypp::detail::RepositoryIterator
Definition: Repository.h:460
zypp::pool::PoolImpl
Definition: PoolImpl.h:168
zypp::pool::PoolImpl::Id2ItemT
PoolTraits::Id2ItemT Id2ItemT
Definition: PoolImpl.h:176
zypp::pool::PoolImpl::size_type
PoolTraits::size_type size_type
Definition: PoolImpl.h:174
zypp::pool::PoolImpl::const_iterator
PoolTraits::const_iterator const_iterator
Definition: PoolImpl.h:175
zypp::pool::PoolImpl::begin
const_iterator begin() const
Definition: PoolImpl.h:211
zypp::pool::PoolImpl::reapplyHardLocks
void reapplyHardLocks() const
Definition: PoolImpl.h:286
zypp::pool::PoolImpl::empty
bool empty() const
Definition: PoolImpl.h:204
zypp::pool::PoolImpl::find
PoolItem find(const sat::Solvable &slv_r) const
Return the corresponding PoolItem.
Definition: PoolImpl.h:223
zypp::pool::PoolImpl::_hardLockQueries
HardLockQueries _hardLockQueries
Set of queries that define hardlocks.
Definition: PoolImpl.h:481
zypp::pool::PoolImpl::PoolImpl
PoolImpl()
Default ctor.
Definition: PoolImpl.cc:44
zypp::pool::PoolImpl::invalidate
void invalidate() const
Definition: PoolImpl.h:456
zypp::pool::PoolImpl::establishedStates
ResPool::EstablishedStates establishedStates() const
True factory for ResPool::EstablishedStates.
Definition: PoolImpl.h:259
zypp::pool::PoolImpl::operator<<
friend std::ostream & operator<<(std::ostream &str, const PoolImpl &obj)
zypp::pool::PoolImpl::id2item
const Id2ItemT & id2item() const
Definition: PoolImpl.h:424
zypp::pool::PoolImpl::reposFind
Repository reposFind(const std::string &alias_r) const
Definition: PoolImpl.h:273
zypp::pool::PoolImpl::_poolProxy
shared_ptr< ResPoolProxy > _poolProxy
Definition: PoolImpl.h:476
zypp::pool::PoolImpl::knownRepositoriesBegin
repository_iterator knownRepositoriesBegin() const
Definition: PoolImpl.h:267
zypp::pool::PoolImpl::hardLockQueries_iterator
PoolTraits::hardLockQueries_iterator hardLockQueries_iterator
Definition: PoolImpl.h:281
zypp::pool::PoolImpl::_id2item
Id2ItemT _id2item
Definition: PoolImpl.h:472
zypp::pool::PoolImpl::RestoreState
void RestoreState(const ResKind &kind_r)
zypp::pool::PoolImpl::_id2itemDirty
DefaultIntegral< bool, true > _id2itemDirty
Definition: PoolImpl.h:473
zypp::pool::PoolImpl::_establishedStates
shared_ptr< EstablishedStatesImpl > _establishedStates
Definition: PoolImpl.h:477
zypp::pool::PoolImpl::~PoolImpl
~PoolImpl()
Dtor.
Definition: PoolImpl.cc:52
zypp::pool::PoolImpl::end
const_iterator end() const
Definition: PoolImpl.h:214
zypp::pool::PoolImpl::EstablishedStatesImpl
ResPool::EstablishedStates::Impl EstablishedStatesImpl
Definition: PoolImpl.h:182
zypp::pool::PoolImpl::proxy
ResPoolProxy proxy(ResPool self) const
Definition: PoolImpl.h:244
zypp::pool::PoolImpl::repository_iterator
PoolTraits::repository_iterator repository_iterator
Definition: PoolImpl.h:178
zypp::pool::PoolImpl::SolvableIdType
sat::detail::SolvableIdType SolvableIdType
Definition: PoolImpl.h:180
zypp::pool::PoolImpl::serial
const SerialNumber & serial() const
Housekeeping data serial number.
Definition: PoolImpl.h:196
zypp::pool::PoolImpl::_storeDirty
DefaultIntegral< bool, true > _storeDirty
Definition: PoolImpl.h:471
zypp::pool::PoolImpl::SaveState
void SaveState(const ResKind &kind_r)
zypp::pool::PoolImpl::HardLockQueries
PoolTraits::HardLockQueries HardLockQueries
Definition: PoolImpl.h:280
zypp::pool::PoolImpl::ContainerT
PoolTraits::ItemContainerT ContainerT
Definition: PoolImpl.h:173
zypp::pool::PoolImpl::setHardLockQueries
void setHardLockQueries(const HardLockQueries &newLocks_r)
Definition: PoolImpl.h:305
zypp::pool::PoolImpl::_watcherIDs
SerialNumberWatcher _watcherIDs
Watch sat pools Serial number of IDs - changes whenever resusePoolIDs==true - ResPool must also inval...
Definition: PoolImpl.h:469
zypp::pool::PoolImpl::satpool
const sat::Pool satpool() const
convenience.
Definition: PoolImpl.h:192
zypp::pool::PoolImpl::_watcher
SerialNumberWatcher _watcher
Watch sat pools serial number.
Definition: PoolImpl.h:467
zypp::pool::PoolImpl::getHardLockQueries
bool getHardLockQueries(HardLockQueries &activeLocks_r)
Definition: PoolImpl.h:322
zypp::pool::PoolImpl::knownRepositoriesSize
size_type knownRepositoriesSize() const
Forward list of Repositories that contribute ResObjects from sat::Pool.
Definition: PoolImpl.h:264
zypp::pool::PoolImpl::size
size_type size() const
Definition: PoolImpl.h:208
zypp::pool::PoolImpl::hardLockQueries
const HardLockQueries & hardLockQueries() const
Definition: PoolImpl.h:283
zypp::pool::PoolImpl::store
const ContainerT & store() const
Definition: PoolImpl.h:363
zypp::pool::PoolImpl::checkSerial
void checkSerial() const
Definition: PoolImpl.h:449
zypp::pool::PoolImpl::knownRepositoriesEnd
repository_iterator knownRepositoriesEnd() const
Definition: PoolImpl.h:270
zypp::pool::PoolImpl::_store
ContainerT _store
Definition: PoolImpl.h:470
zypp::sat::Pool
Global sat-pool.
Definition: Pool.h:47
zypp::sat::Pool::serialIDs
const SerialNumber & serialIDs() const
Serial number changing whenever resusePoolIDs==true was used.
Definition: Pool.cc:58
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::capacity
size_type capacity() const
Internal array size for stats only.
Definition: Pool.cc:52
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:35
zypp::sat::Queue::size
size_type size() const
Definition: Queue.cc:49
zypp::sat::Queue::size_type
unsigned size_type
Definition: Queue.h:37
zypp::sat::Queue::empty
bool empty() const
Definition: Queue.cc:46
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:399
zypp::sat::Solvable::isKind
bool isKind(const ResKind &kind_r) const
Test whether a Solvable is of a certain ResKind.
Definition: Solvable.cc:301
zypp::sat::Solvable::ident
IdString ident() const
The identifier.
Definition: Solvable.cc:268
str
String related utilities and Regular expression matching.
zypp::sat::detail::IdType
int IdType
Generic Id type.
Definition: PoolMember.h:104
zypp::sat::detail::SolvableIdType
unsigned SolvableIdType
Id type to connect Solvable and sat-solvable.
Definition: PoolMember.h:125
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:187
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
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::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::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:74
zypp::pool::PoolTraits::ItemContainerT
std::vector< PoolItem > ItemContainerT
pure items
Definition: PoolTraits.h:71
zypp::pool::PoolTraits::Id2ItemT
std::unordered_multimap< sat::detail::IdType, PoolItem > Id2ItemT
ident index
Definition: PoolTraits.h:79
zypp::pool::PoolTraits::HardLockQueries
std::list< PoolQuery > HardLockQueries
hard locks from etc/zypp/locks
Definition: PoolTraits.h:88
zypp::pool::PoolTraits::hardLockQueries_iterator
HardLockQueries::const_iterator hardLockQueries_iterator
Definition: PoolTraits.h:89
zypp::pool::PoolTraits::size_type
ItemContainerT::size_type size_type
Definition: PoolTraits.h:75
zypp::resstatus::UserLockQueryManip
Manipulator for ResStatus::UserLockQueryField.
Definition: PoolImpl.h:43
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:45
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:52
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:62