12 #ifndef ZYPP_UI_SELECTABLE_H 13 #define ZYPP_UI_SELECTABLE_H 58 using Ptr = intrusive_ptr<Selectable>;
59 using constPtr = intrusive_ptr<const Selectable>;
89 static Ptr get(
ResKind kind_r,
const std::string & name_r )
93 static Ptr get(
const std::string & name_r )
102 {
return resolvable_r ?
get( resolvable_r->satSolvable() ) :
Ptr(); }
106 {
return get( pi_r.satSolvable() ); }
121 const std::string & name()
const;
150 PoolItem updateCandidateObj()
const;
158 PoolItem highestAvailableVersionObj()
const;
161 bool identIsAutoInstalled()
const;
167 bool identicalAvailable(
const PoolItem & rhs )
const;
173 bool identicalInstalled(
const PoolItem & rhs )
const;
179 {
return identicalInstalled( candidateObj() ); }
185 {
return identicalInstalled( updateCandidateObj() ); }
207 {
return asKind<TRes>( candidateObj() ); }
217 {
return asKind<TRes>( candidateObj() ); }
250 std::vector<std::string> supersededBy()
const;
258 bool availableEmpty()
const;
259 available_size_type availableSize()
const;
260 available_iterator availableBegin()
const;
261 available_iterator availableEnd()
const;
263 {
return makeIterable( availableBegin(), availableEnd() ); }
272 bool installedEmpty()
const;
273 installed_size_type installedSize()
const;
274 installed_iterator installedBegin()
const;
275 installed_iterator installedEnd()
const;
277 {
return makeIterable( installedBegin(), installedEnd() ); }
287 bool picklistEmpty()
const;
288 picklist_size_type picklistSize()
const;
289 picklist_iterator picklistBegin()
const;
290 picklist_iterator picklistEnd()
const;
292 {
return makeIterable( picklistBegin(), picklistEnd() ); }
315 {
return (! installedEmpty()) || candidateObj(); }
319 {
return ! installedEmpty(); }
323 {
return bool(candidateObj()); }
327 {
return (! installedEmpty()) && candidateObj(); }
331 {
return (! installedEmpty()) && ! candidateObj(); }
335 {
return ( installedEmpty() ) && candidateObj(); }
339 bool hasBlacklisted()
const;
342 bool hasBlacklistedInstalled()
const;
345 bool hasRetracted()
const;
348 bool hasRetractedInstalled()
const;
354 bool hasPtfInstalled()
const;
361 bool isUnmaintained()
const;
374 bool multiversionInstall()
const;
383 {
return pickInstall( pi_r, causer_r,
false ); }
392 {
return pickDelete( pi_r, causer_r,
false ); }
432 bool isUndetermined()
const;
437 bool isRelevant()
const;
440 bool isSatisfied()
const;
443 bool isBroken()
const;
450 bool isNeeded()
const;
453 bool isUnwanted()
const;
470 {
return fate() == UNMODIFIED; }
486 bool hasLocks()
const;
490 {
return fate() != UNMODIFIED; }
494 {
return fate() == TO_DELETE; }
498 {
return fate() == TO_INSTALL; }
502 {
return( ( hasInstalledObj() && !toDelete() )
503 ||( hasCandidateObj() && toInstall() ) ); }
507 {
return ! onSystem(); }
514 {
return setFate( TO_INSTALL, causer_r ); }
524 {
return setFate( TO_DELETE, causer_r ); }
531 {
return setFate( UNMODIFIED, causer_r ); }
555 bool hasLicenceConfirmed()
const;
558 void setLicenceConfirmed(
bool val_r =
true );
590 Selectable_Ptr operator()(
const sat::Solvable & solv_r )
const;
602 #endif // ZYPP_UI_SELECTABLE_H bool locked() const
True if locked (subclass of unmodified).
A Solvable object within the sat Pool.
SelectableTraits::available_size_type available_size_type
Status
UI status Status values calculated by Selectable.
bool toModify() const
True if either to delete or to install.
static const ResKind package
Collects PoolItems of same kind and name.
AvailableItemSet::size_type available_size_type
bool unmodified() const
True if neither to delete or to install.
AvailableItemSet::iterator installed_iterator
bool hasCandidateObj() const
True if candidate object is present.
shared_ptr< Impl > Impl_Ptr
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.
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.
intrusive_ptr< const Selectable > constPtr
AvailableItemSet::size_type installed_size_type
intrusive_ptr< const TRes > constPtrType
bool pickNoInstall(const PoolItem &pi_r, ResStatus::TransactByValue causer_r=ResStatus::USER)
Deselect a specific available item from installation.
bool identicalInstalledUpdateCandidate() const
True if the updateCandidateObj is installed (same content).
bool hasInstalledObjOnly() const
True if installed object is present but no candidate.
ResTraits< TRes >::constPtrType candidateAsKind() const
Return the candidateObj resolvable casted to a specific kind.
SelectableTraits::available_iterator available_iterator
Iterates over ResObject::constPtr.
bool identicalInstalledCandidate() const
True if the candidateObj is installed (same content).
Selectable_Ptr result_type
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
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)
std::ostream & dumpOn(std::ostream &str, const Selectable &obj)
PickList::size_type picklist_size_type
PickList::const_iterator picklist_iterator
TraitsType::constPtrType constPtr
SelectableTraits::installed_size_type installed_size_type
Base class for reference counted objects.
bool hasCandidateObjOnly() const
True if candidate object is present but no installed.
SelectableTraits::picklist_iterator picklist_iterator
ResTraits< TRes >::constPtrType installedAsKind() const
Return the installedObj resolvable casted to a specific kind.
bool hasBothObjects() const
True if installed and candidate object is present.
bool unset(ResStatus::TransactByValue causer_r=ResStatus::USER)
Set the item to stay unmodified.
DEFINE_PTR_TYPE(Selectable)
bool hasObject() const
True if either installed or candidate object is present.
Iterable< picklist_iterator > picklist() const
Selectable_Ptr operator()(const PoolItem &pi_r) const
bool toDelete() const
True if to delete.
Combining sat::Solvable and ResStatus.
AvailableItemSet::iterator available_iterator
SelectableTraits::installed_iterator installed_iterator
Easy-to use interface to the ZYPP dependency resolver.
bool pickNoDelete(const PoolItem &pi_r, ResStatus::TransactByValue causer_r=ResStatus::USER)
Deselect a specific installed item from deletion.
Solvable to Selectable transform functor.
Solvable satSolvable() const
Return the corresponding sat::Solvable.
bool hasInstalledObj() const
True if installed object is present.
SelectableTraits::picklist_size_type picklist_size_type
Main filter selecting PoolItems by name and kind.
RW_pointer< Impl > _pimpl
Pointer to implementation.
intrusive_ptr< Selectable > Ptr
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.