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