12#ifndef ZYPP_UI_SELECTABLE_H
13#define ZYPP_UI_SELECTABLE_H
17#include <zypp/base/ReferenceCounted.h>
18#include <zypp/base/NonCopyable.h>
19#include <zypp/base/PtrTypes.h>
20#include <zypp/base/Iterator.h>
57 typedef intrusive_ptr<Selectable>
Ptr;
58 typedef intrusive_ptr<const Selectable>
constPtr;
92 static Ptr get(
const std::string & name_r )
101 {
return resolvable_r ?
get( resolvable_r->satSolvable() ) :
Ptr(); }
120 const std::string &
name()
const;
385 {
return pickDelete( pi_r, causer_r,
false ); }
RepoManager implementation.
Access to the sat-pools string space.
Combining sat::Solvable and ResStatus.
static const ResKind package
TraitsType::constPtrType constPtr
Base class for reference counted objects.
Main filter selecting PoolItems by name and kind.
A Solvable object within the sat Pool.
Collects PoolItems of same kind and name.
bool hasRetractedInstalled() const
True if this Selectable contains an installed retracted item.
bool setStatus(Status state_r, ResStatus::TransactByValue causer_r=ResStatus::USER)
Try to set a new Status.
available_iterator availableEnd() const
bool hasPtfInstalled() const
True if this Selectable contains an installed ptf item.
bool onSystem() const
True if would be on system after commit.
static Ptr get(ResKind kind_r, const std::string &name_r)
Get the Selctable by kind and name.
bool pickNoInstall(const PoolItem &pi_r, ResStatus::TransactByValue causer_r=ResStatus::USER)
Deselect a specific available item from installation.
SelectableTraits::available_size_type available_size_type
ResTraits< TRes >::constPtrType installedAsKind() const
Return the installedObj resolvable casted to a specific kind.
bool offSystem() const
True if would be off system after commit.
installed_size_type installedSize() const
SelectableTraits::picklist_iterator picklist_iterator
bool toModify() const
True if either to delete or to install.
picklist_iterator picklistBegin() const
bool hasCandidateObj() const
True if candidate object is present.
bool multiversionInstall() const
Whether at least one of the available packages has multiversionInstall set.
Iterable< picklist_iterator > picklist() const
ResTraits< TRes >::constPtrType candidateAsKind() const
Return the candidateObj resolvable casted to a specific kind.
Status pickStatus(const PoolItem &pi_r) const
Compute the ui::Status for an individual PoolItem.
bool toDelete() const
True if to delete.
bool isUnmaintained() const
True if this package has no replacement from the available repositories.
picklist_size_type picklistSize() const
bool setDeleted(ResStatus::TransactByValue causer_r=ResStatus::USER)
Take care the item gets deleted if it is installed.
bool isSatisfied() const
Whether a relevant patchs requirements are met.
static Ptr get(const std::string &name_r)
Get the Package Selctable by name.
bool hasCandidateObjOnly() const
True if candidate object is present but no installed.
static Ptr get(const PoolItem &pi_r)
Get the Selctable containing a specific PoolItem.
static Ptr get(const pool::ByIdent &ident_r)
Get the Selctable.
installed_iterator installedBegin() const
bool locked() const
True if locked (subclass of unmodified).
friend std::ostream & operator<<(std::ostream &str, const Selectable &obj)
available_size_type availableSize() const
intrusive_ptr< Selectable > Ptr
static constexpr const picklist_size_type picklistNoPos
Returned by picklistPos if the Item does not belong to the picklist.
void setLicenceConfirmed(bool val_r=true)
Set LicenceConfirmed bit.
bool setToDelete(ResStatus::TransactByValue causer_r=ResStatus::USER)
Set the item to be deleted (must be installed).
friend std::ostream & dumpOn(std::ostream &str, const Selectable &obj)
ResStatus::TransactByValue modifiedBy() const
Return who caused the modification.
static Ptr get(const ResObject::constPtr &resolvable_r)
Get the Selctable containing a specific ResObject.
SelectableTraits::installed_size_type installed_size_type
PoolItem installedObj() const
The last Installed object.
PoolItem highestAvailableVersionObj() const
Simply the highest available version, ignoring priorities and policies.
bool pickNoDelete(const PoolItem &pi_r, ResStatus::TransactByValue causer_r=ResStatus::USER)
Deselect a specific installed item from deletion.
bool hasLocks() const
True if it includes locked items (don't mix this with the locked status).
bool hasBothObjects() const
True if installed and candidate object is present.
bool hasRetracted() const
True if this Selectable contains available retracted items.
bool hasBlacklistedInstalled() const
True if this Selectable contains an installed blacklisted item (retracted,ptf,...).
picklist_iterator picklistEnd() const
bool setInstalled(ResStatus::TransactByValue causer_r=ResStatus::USER)
Take care the item gets installed if it is not.
bool hasBlacklisted() const
True if this Selectable contains available blacklisted items (retracted,ptf,...).
Iterable< available_iterator > available() const
static Ptr get(const sat::Solvable &solv_r)
Get the Selctable containing a specific sat::Solvable.
RW_pointer< Impl > _pimpl
Pointer to implementation.
intrusive_ptr< const Selectable > constPtr
IdString ident() const
The identifier.
installed_iterator installedEnd() const
bool unset(ResStatus::TransactByValue causer_r=ResStatus::USER)
Set the item to stay unmodified.
PoolItem updateCandidateObj() const
The best candidate for update, if there is one.
PoolItem candidateObjFrom(Repository repo_r) const
The best candidate provided by a specific Repository, if there is one.
bool identicalInstalledUpdateCandidate() const
True if the updateCandidateObj is installed (same content).
bool setUpToDate(ResStatus::TransactByValue causer_r=ResStatus::USER)
Take care the item gets installed if it is not, or is older.
bool unmodified() const
True if neither to delete or to install.
const std::string & name() const
The ResObjects name.
SelectableTraits::installed_iterator installed_iterator
bool hasPtf() const
True if this Selectable contains available ptf items.
SelectableTraits::available_iterator available_iterator
Iterates over ResObject::constPtr.
Iterable< installed_iterator > installed() const
PoolItem theObj() const
An object you could use as pars pro toto.
bool availableEmpty() const
shared_ptr< Impl > Impl_Ptr
bool identIsAutoInstalled() const
Whether this ident is flagged as AutoInstalled.
available_iterator availableBegin() const
static Ptr get(IdString ident_r)
Get the Selctable by its sat-identifier.
bool identicalInstalledCandidate() const
True if the candidateObj is installed (same content).
bool pickInstall(const PoolItem &pi_r, ResStatus::TransactByValue causer_r=ResStatus::USER, bool yesno_r=true)
Select a specific available item for installation.
bool setOnSystem(const PoolItem &newCandidate_r, ResStatus::TransactByValue causer_r=ResStatus::USER)
Arrange the specified candidate (out of available objects) to be on system after commit.
PoolItem setCandidate(const PoolItem &newCandidate_r, ResStatus::TransactByValue causer_r=ResStatus::USER)
Set a candidate (out of available objects).
bool hasObject() const
True if either installed or candidate object is present.
bool isRelevant() const
Returns true if the patch is relevant which means that at least one package of the patch is installed...
bool isUnwanted() const
Broken (needed) but locked patches.
PoolItem candidateObj() const
The 'best' or 'most interesting' among all available objects.
bool toInstall() const
True if to install.
bool identicalAvailable(const PoolItem &rhs) const
True if rhs is installed and one with the same content is available.
bool isBroken() const
Whether a relevant patchs requirements are broken.
bool hasInstalledObj() const
True if installed object is present.
bool setPickStatus(const PoolItem &pi_r, Status state_r, ResStatus::TransactByValue causer_r=ResStatus::USER)
Assign a new status to a specific item.
Status status() const
Return the current Status.
bool hasLicenceConfirmed() const
Return value of LicenceConfirmed bit.
bool identicalInstalled(const PoolItem &rhs) const
True if rhs has the same content as an installed one.
PoolItem identicalAvailableObj(const PoolItem &rhs) const
Return an available Object with the same content as rhs.
bool hasInstalledObjOnly() const
True if installed object is present but no candidate.
bool isUndetermined() const
Returns true for packages, because packages are not classified by the solver.
ResKind kind() const
The ResObjects kind.
bool setToInstall(ResStatus::TransactByValue causer_r=ResStatus::USER)
Set the item to be installed (new- or re-install).
bool setFate(Fate fate_r, ResStatus::TransactByValue causer_r=ResStatus::USER)
bool pickDelete(const PoolItem &pi_r, ResStatus::TransactByValue causer_r=ResStatus::USER, bool yesno_r=true)
Select a specific installed item for deletion.
bool isNeeded() const
This includes unlocked broken patches, as well as those already selected to be installed.
bool picklistEmpty() const
SelectableTraits::picklist_size_type picklist_size_type
PoolItem identicalInstalledObj(const PoolItem &rhs) const
\Return an installed Object with the same content as rhs.
bool installedEmpty() const
picklist_size_type picklistPos(const PoolItem &pi_r) const
Return the position of pi_r in the piclist or picklistNoPos.
String related utilities and Regular expression matching.
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Status
UI status Status values calculated by Selectable.
std::ostream & operator<<(std::ostream &str, const Selectable &obj)
std::ostream & dumpOn(std::ostream &str, const Selectable &obj)
Easy-to use interface to the ZYPP dependency resolver.
Wrapper for const correct access via Smart pointer types.
intrusive_ptr< const TRes > constPtrType
Solvable satSolvable() const
Return the corresponding sat::Solvable.
AvailableItemSet::size_type available_size_type
AvailableItemSet::iterator installed_iterator
PickList::size_type picklist_size_type
AvailableItemSet::size_type installed_size_type
PickList::const_iterator picklist_iterator
AvailableItemSet::iterator available_iterator
Solvable to Selectable transform functor.
Selectable_Ptr operator()(const sat::Solvable &solv_r) const
Selectable_Ptr operator()(const PoolItem &pi_r) const
Selectable_Ptr result_type
#define DEFINE_PTR_TYPE(NAME)
Forward declaration of Ptr types.