12#ifndef ZYPP_UI_SELECTABLEIMPL_H
13#define ZYPP_UI_SELECTABLEIMPL_H
16#include <zypp/base/LogTools.h>
18#include <zypp/base/PtrTypes.h>
21#include <zypp/Resolver.h>
59 template <
class TIterator>
61 const std::string & name_r,
64 :
_ident( sat::Solvable::SplitIdent( kind_r, name_r ).
ident() )
68 for_( it, begin_r, end_r )
70 if ( it->status().isInstalled() )
87 const std::string &
name()
const
132 if ( pi.isBlacklisted() )
134 if ( pi.repository() == repo_r )
169 && ! ( defaultCand->
arch() == Arch_noarch ||
installed->arch() == Arch_noarch ) )
183 bool blacklistedOk =
false;
186 if ( !blacklistedOk && pi.isBlacklisted() )
190 blacklistedOk =
true;
217 if ( identical( *it, rhs ) )
231 if ( identical( *it, rhs ) )
320 if ( pi.isBlacklisted() )
329 if ( not pi.isBlacklisted() )
331 if ( pi.isRetracted() )
340 if ( pi.isRetracted() )
349 if ( not pi.isBlacklisted() )
374 if ( pi.multiversionInstall() )
427 if ( pi.status().isLocked() )
432 if ( pi.status().isLocked() )
443 if ( pi.status().transacts() )
453 if ( pi.status().transacts() )
464 bool solver_allowVendorChange(
ResPool::instance().resolver().allowVendorChange() );
471 if ( ipi.arch() == api.arch() || ipi.arch() == Arch_noarch || api.arch() == Arch_noarch )
473 if ( ! solver_allowVendorChange )
477 else if ( ! sameArch )
498 if ( ! pi.status().isLocked() )
508 if ( ! pi.status().isLocked() )
544 str <<
" (I 0) {}" << endl <<
" ";
556 str <<
" " << t <<
" " << pi << endl;
563 str <<
"(A 0) {}" << endl <<
" ";
575 t = pi == up ?
'C' :
'c';
581 str <<
" " << t <<
" " << pi << endl;
600 t = pi == up ?
'C' :
'c';
606 str <<
" " << t <<
" " << pi <<
"\t" << obj.
pickStatus( pi ) << endl;
Access to the sat-pools string space.
Combining sat::Solvable and ResStatus.
bool isRelevant() const
Returns true if the solvable is relevant which means e.g.
bool isBroken() const
Whether a relevant items requirements are broken.
ResStatus & status() const
Returns the current status.
bool isSatisfied() const
Whether a relevant items requirements are met.
bool isUndetermined() const
No validation is performed for packages.
static ResPool instance()
Singleton ctor.
bool isLicenceConfirmed() const
void setLicenceConfirmed(bool toVal_r=true)
static const VendorAttr & instance()
(Pseudo)Singleton, mapped to the current Target::vendorAttr settings or to noTargetInstance.
bool identIsAutoInstalled() const
Whether an installed solvable with the same ident is flagged as AutoInstalled.
SelectableTraits::picklist_iterator picklist_iterator
SelectableTraits::picklist_size_type picklist_size_type
String related utilities and Regular expression matching.
Status
UI status Status values calculated by Selectable.
Easy-to use interface to the ZYPP dependency resolver.
bool isBlacklisted() const
AvailableItemSet::const_iterator installed_const_iterator
std::vector< PoolItem > PickList
AvailableItemSet::size_type available_size_type
AvailableItemSet::iterator installed_iterator
AvailableItemSet::const_iterator available_const_iterator
std::set< PoolItem, AVOrder > AvailableItemSet
std::set< PoolItem, IOrder > InstalledItemSet
AvailableItemSet::size_type installed_size_type
AvailableItemSet::iterator available_iterator
Selectable implementation.
PoolItem installedObj() const
Installed object (transacting ot highest version).
PoolItem theObj() const
Best among all objects.
installed_iterator installedEnd() const
bool allInstalledLocked() const
PoolItem transactingCandidate() const
bool availableEmpty() const
PoolItem transactingInstalled() const
PoolItem _candidate
The object selected by setCandidateObj() method.
bool setPickStatus(const PoolItem &pi_r, Status state_r, ResStatus::TransactByValue causer_r)
const std::string & name() const
bool picklistEmpty() const
SelectableTraits::InstalledItemSet InstalledItemSet
available_iterator availableBegin() const
SelectableTraits::available_iterator available_iterator
bool isUnmaintained() const
bool identicalInstalled(const PoolItem &rhs) const
True if rhs has the same content as an installed one.
installed_iterator installedBegin() const
bool installedEmpty() const
PoolItem identicalAvailableObj(const PoolItem &rhs) const
Return an available Object with the same content as rhs.
SelectableTraits::installed_iterator installed_iterator
picklist_iterator picklistBegin() const
available_iterator availableEnd() const
SelectableTraits::available_size_type available_size_type
InstalledItemSet _installedItems
SelectableTraits::PickList PickList
SelectableTraits::installed_const_iterator installed_const_iterator
PoolItem updateCandidateObj() const
The best candidate for update, if there is one.
AvailableItemSet _availableItems
Iterable< installed_iterator > installed() const
bool pickInstall(const PoolItem &pi_r, ResStatus::TransactByValue causer_r, bool yesno_r)
picklist_size_type picklistSize() const
bool multiversionInstall() const
Iterable< available_iterator > available() const
PoolItem identicalInstalledObj(const PoolItem &rhs) const
\Return an installed Object with the same content as rhs.
bool hasPtfInstalled() const
picklist_iterator picklistEnd() const
PoolItem defaultCandidate() const
SelectableTraits::AvailableItemSet AvailableItemSet
SelectableTraits::installed_size_type installed_size_type
bool setStatus(Status state_r, ResStatus::TransactByValue causer_r)
scoped_ptr< PickList > _picklistPtr
lazy initialized picklist
ResStatus::TransactByValue modifiedBy() const
Return who caused the modification.
bool hasBlacklistedInstalled() const
PoolItem candidateObj() const
Best among available objects.
Status pickStatus(const PoolItem &pi_r) const
std::ostream & dumpOn(std::ostream &str, const Selectable::Impl &obj)
Stream output.
bool identicalAvailable(const PoolItem &rhs) const
True if rhs is installed and one with the same content is available.
PoolItem highestAvailableVersionObj() const
Simply the highest available version, ignoring priorities and policies.
std::ostream & operator<<(std::ostream &str, const Selectable::Impl &obj)
Stream output.
Impl(const ResKind &kind_r, const std::string &name_r, TIterator begin_r, TIterator end_r)
void setLicenceConfirmed(bool val_r)
Set LicenceConfirmed bit.
PoolItem setCandidate(const PoolItem &newCandidate_r, ResStatus::TransactByValue causer_r)
Set a userCandidate (out of available objects).
bool isUndetermined() const
PoolItem candidateObjFrom(Repository repo_r) const
The best candidate provided by a specific Repository, if there is one.
bool hasLicenceConfirmed() const
Return value of LicenceConfirmed bit.
bool hasBlacklisted() const
bool identIsAutoInstalled() const
Whether this ident is flagged as AutoInstalled.
bool hasRetracted() const
available_size_type availableSize() const
bool hasRetractedInstalled() const
SelectableTraits::available_const_iterator available_const_iterator
bool pickDelete(const PoolItem &pi_r, ResStatus::TransactByValue causer_r, bool yesno_r)
bool hasLocks() const
True if it includes locked items (don't mix this with the locked status).
installed_size_type installedSize() const
bool allCandidatesLocked() const
const PickList & picklist() const
#define for_(IT, BEG, END)
Convenient for-loops using iterator.