12#ifndef ZYPP_POOL_POOLIMPL_H
13#define ZYPP_POOL_POOLIMPL_H
68 return userLock ? 1 : -1;
76 inline PoolQuery makeTrivialQuery( IdString ident_r )
78 sat::Solvable::SplitIdent ident( ident_r );
82 q.addKind( ident.kind() );
84 q.setCaseSensitive(
true);
90 unsigned s( activeLocks_r.size() );
91 activeLocks_r.remove( makeTrivialQuery( ident_r ) );
92 return( activeLocks_r.size() != s );
97 PoolQuery q( makeTrivialQuery( ident_r ) );
98 for_( it, activeLocks_r.begin(), activeLocks_r.end() )
103 activeLocks_r.push_back( q );
227 return( slv_r.
id() < mystore.size() ? mystore[slv_r.
id()] :
PoolItem() );
299 MIL <<
"HardLockQueries match " << locked.
size() <<
" Solvables." << endl;
310 MIL <<
"Apply " << newLocks_r.size() <<
" HardLockQueries" << endl;
318 MIL <<
"HardLockQueries match " << locked.
size() <<
" Solvables." << endl;
335 typedef std::unordered_set<IdString> IdentSet;
337 IdentSet removedLocks;
345 addedLocks.insert( it->satSolvable().ident() );
348 removedLocks.insert( it->satSolvable().ident() );
353 bool setChanged =
false;
354 for_( it, removedLocks.begin(), removedLocks.end() )
356 if ( addedLocks.find( *it ) != addedLocks.end() )
358 if ( hardLockQueriesRemove( activeLocks_r, *it ) && ! setChanged )
361 for_( it, addedLocks.begin(), addedLocks.end() )
363 if ( hardLockQueriesAdd( activeLocks_r, *it ) && ! setChanged )
376 bool addedItems =
false;
378 std::list<PoolItem> addedProducts;
382 if (
pool.capacity() )
393 else if ( reusedIDs || (s && ! pi) )
399 addedProducts.push_back( pi );
410 if ( ! addedProducts.empty() )
412 for_( it, addedProducts.begin(), addedProducts.end() )
444 _id2item.insert( std::make_pair(
id, *it ) );
Integral type with defined initial value when default constructed.
std::string asString() const
Access to the sat-pools string space.
IdType id() const
Expert backdoor.
Combining sat::Solvable and ResStatus.
ResStatus & status() const
Returns the current status.
static PoolItem makePoolItem(const sat::Solvable &solvable_r)
PoolItem generator for pool::PoolImpl.
Helper class to collect (not only) PoolQuery results.
size_type size() const
The number of sat::Solvables.
bool contains(sat::Solvable result_r) const
Test whether some item is in the result set.
static const ResKind srcpackage
static const ResKind product
ResPool::instance().proxy();.
Store initial establish status of pseudo installed items.
ResStatus::ValidateValue validateValue(sat::Queue::size_type i) const
ResPool::EstablishedStates::ChangedPseudoInstalled changedPseudoInstalled() const
Return all pseudo installed items whose current state differs from their initial one.
A copy of the Pools initial ValidateValues of pseudo installed items.
std::map< PoolItem, ResStatus::ValidateValue > ChangedPseudoInstalled
Map holding pseudo installed items where current and established status differ.
ValidateValue validate() const
void setUserLockQueryMatch(bool match_r)
bool isUserLockQueryMatch() const
bool setLock(bool toLock_r, TransactByValue causer_r)
Apply a lock (prevent transaction).
bool isUserLocked() const
Simple serial number watcher.
Simple serial number provider.
const_iterator begin() const
void reapplyHardLocks() const
PoolTraits::HardLockQueries HardLockQueries
PoolItem find(const sat::Solvable &slv_r) const
Return the corresponding PoolItem.
HardLockQueries _hardLockQueries
Set of queries that define hardlocks.
PoolTraits::ItemContainerT ContainerT
ResPool::EstablishedStates establishedStates() const
True factory for ResPool::EstablishedStates.
Repository reposFind(const std::string &alias_r) const
PoolTraits::size_type size_type
shared_ptr< ResPoolProxy > _poolProxy
const HardLockQueries & hardLockQueries() const
repository_iterator knownRepositoriesBegin() const
void RestoreState(const ResKind &kind_r)
const SerialNumber & serial() const
Housekeeping data serial number.
friend std::ostream & operator<<(std::ostream &str, const PoolImpl &obj)
DefaultIntegral< bool, true > _id2itemDirty
shared_ptr< EstablishedStatesImpl > _establishedStates
const_iterator end() const
ResPoolProxy proxy(ResPool self) const
DefaultIntegral< bool, true > _storeDirty
void SaveState(const ResKind &kind_r)
void setHardLockQueries(const HardLockQueries &newLocks_r)
SerialNumberWatcher _watcherIDs
Watch sat pools Serial number of IDs - changes whenever resusePoolIDs==true - ResPool must also inval...
const sat::Pool satpool() const
convenience.
PoolTraits::hardLockQueries_iterator hardLockQueries_iterator
SerialNumberWatcher _watcher
Watch sat pools serial number.
bool getHardLockQueries(HardLockQueries &activeLocks_r)
size_type knownRepositoriesSize() const
Forward list of Repositories that contribute ResObjects from sat::Pool.
const Id2ItemT & id2item() const
const ContainerT & store() const
PoolTraits::const_iterator const_iterator
PoolTraits::Id2ItemT Id2ItemT
ResPool::EstablishedStates::Impl EstablishedStatesImpl
repository_iterator knownRepositoriesEnd() const
PoolTraits::repository_iterator repository_iterator
sat::detail::SolvableIdType SolvableIdType
RepositoryIterator reposEnd() const
Iterator behind the last Repository.
size_type reposSize() const
Number of repos in Pool.
bool solvablesEmpty() const
Whether Pool contains solvables.
RepositoryIterator reposBegin() const
Iterator to the first Repository.
Repository reposFind(const std::string &alias_r) const
Find a Repository named alias_r.
size_type solvablesSize() const
Number of solvables in Pool.
const SerialNumber & serial() const
Housekeeping data serial number.
static Pool instance()
Singleton ctor.
void prepare() const
Update housekeeping data if necessary (e.g.
Libsolv Id queue wrapper.
static const SolvAttr name
A Solvable object within the sat Pool.
IdType id() const
Expert backdoor.
bool isKind(const ResKind &kind_r) const
Test whether a Solvable is of a certain ResKind.
IdString ident() const
The identifier.
String related utilities and Regular expression matching.
unsigned int SolvableIdType
Id type to connect Solvable and sat-solvable.
int IdType
Generic Id type.
void establish(sat::Queue &pseudoItems_r, sat::Queue &pseudoFlags_r)
ResPool helper to compute the initial status of Patches etc.
Easy-to use interface to the ZYPP dependency resolver.
filter_iterator< TFilter, typename TContainer::const_iterator > make_filter_begin(TFilter f, const TContainer &c)
Convenience to create filter_iterator from container::begin().
filter_iterator< TFilter, typename TContainer::const_iterator > make_filter_end(TFilter f, const TContainer &c)
Convenience to create filter_iterator from container::end().
ResTraits< TRes >::PtrType asKind(const sat::Solvable &solvable_r)
Directly create a certain kind of ResObject from sat::Solvable.
Pool internal filter skiping invalid/unwanted PoolItems.
filter_iterator< ByPoolItem, ItemContainerT::const_iterator > const_iterator
sat::Pool::RepositoryIterator repository_iterator
list of known Repositories
std::unordered_multimap< sat::detail::IdType, PoolItem > Id2ItemT
ident index
ItemContainerT::size_type size_type
HardLockQueries::const_iterator hardLockQueries_iterator
std::vector< PoolItem > ItemContainerT
pure items
std::list< PoolQuery > HardLockQueries
hard locks from etc/zypp/locks
Manipulator for ResStatus::UserLockQueryField.
static void setLock(ResStatus &status_r, bool yesno_r)
Set lock and UserLockQuery bit according to yesno_r.
static void reapplyLock(ResStatus &status_r, bool yesno_r)
Update lock and UserLockQuery bit IFF the item gained the bit.
static int diffLock(const ResStatus &status_r)
Test whether the lock status differs from the remembered UserLockQuery bit.
Provides API related macros.
#define for_(IT, BEG, END)
Convenient for-loops using iterator.