libzypp 17.31.23
zypp::PoolItem Class Reference

Combining sat::Solvable and ResStatus. More...

#include <PoolItem.h>

Inheritance diagram for zypp::PoolItem:

Classes

struct  Impl
 PoolItem implementation. More...
 

Public Member Functions

 PoolItem ()
 Default ctor for use in std::container.
 
 PoolItem (const sat::Solvable &solvable_r)
 Ctor looking up the sat::Solvable in the ResPool.
 
template<class Derived >
 PoolItem (const SolvableType< Derived > &solvable_r)
 Ctor looking up the sat::Solvable in the ResPool.
 
 PoolItem (const ResObject::constPtr &resolvable_r)
 Ctor looking up the ResObject in the ResPool.
 
 ~PoolItem ()
 Dtor.
 
Status related methods.
ResStatusstatus () const
 Returns the current status.
 
ResStatusstatusReset () const
 Resets status to the default state (KEEP_STATE bySOLVER; clears any lock!).
 
ResStatusstatusReinit () const
 Resets status to it's initial state in the ResPool (KEEP_STATE bySOLVER or LOCKED byUSER).
 
- Public Member Functions inherited from zypp::sat::SolvableType< PoolItem >
Solvable satSolvable () const
 Return the corresponding sat::Solvable.
 
 operator bool () const
 
IdString ident () const
 
ResKind kind () const
 
bool isKind (const ResKind &kind_r) const
 
bool isKind () const
 
bool isKind (TIterator begin, TIterator end) const
 
std::string name () const
 
Edition edition () const
 
Arch arch () const
 
IdString vendor () const
 
Repository repository () const
 
RepoInfo repoInfo () const
 
bool isSystem () const
 
bool onSystemByUser () const
 
bool onSystemByAuto () const
 
bool identIsAutoInstalled () const
 
bool multiversionInstall () const
 
bool isNeedreboot () const
 
bool isBlacklisted () const
 
bool isRetracted () const
 
bool isPtf () const
 
bool isPtfMaster () const
 
bool isPtfPackage () const
 
Date buildtime () const
 
Date installtime () const
 
std::string asString () const
 
std::string asUserString () const
 
bool identical (const Solvable &rhs) const
 
bool identical (const SolvableType< RDerived > &rhs) const
 
bool sameNVRA (const Solvable &rhs) const
 
bool sameNVRA (const SolvableType< RDerived > &rhs) const
 
Capabilities provides () const
 
Capabilities conflicts () const
 
Capabilities obsoletes () const
 
Capabilities recommends () const
 
Capabilities suggests () const
 
Capabilities enhances () const
 
Capabilities supplements () const
 
Capabilities prerequires () const
 
Capabilities dep (Dep which_r) const
 
Capabilities operator[] (Dep which_r) const
 
CapabilitySet providesNamespace (const std::string &namespace_r) const
 
CapabilitySet valuesOfNamespace (const std::string &namespace_r) const
 
bool supportsLocales () const
 
bool supportsLocale (const Locale &locale_r) const
 
bool supportsLocale (const LocaleSet &locales_r) const
 
bool supportsRequestedLocales () const
 
LocaleSet getSupportedLocales () const
 
CpeId cpeId () const
 
unsigned mediaNr () const
 
ByteCount installSize () const
 
ByteCount downloadSize () const
 
std::string distribution () const
 
std::string summary (const Locale &lang_r=Locale()) const
 
std::string description (const Locale &lang_r=Locale()) const
 
std::string insnotify (const Locale &lang_r=Locale()) const
 
std::string delnotify (const Locale &lang_r=Locale()) const
 
std::string licenseToConfirm (const Locale &lang_r=Locale()) const
 
bool needToAcceptLicense () const
 
std::string lookupStrAttribute (const SolvAttr &attr) const
 
std::string lookupStrAttribute (const SolvAttr &attr, const Locale &lang_r) const
 
bool lookupBoolAttribute (const SolvAttr &attr) const
 
detail::IdType lookupIdAttribute (const SolvAttr &attr) const
 
unsigned long long lookupNumAttribute (const SolvAttr &attr) const
 
unsigned long long lookupNumAttribute (const SolvAttr &attr, unsigned long long notfound_r) const
 
CheckSum lookupCheckSumAttribute (const SolvAttr &attr) const
 
OnMediaLocation lookupLocation () const
 
Solvable::IdType id () const
 

Friends

std::ostream & operator<< (std::ostream &str, const PoolItem &obj)
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &str, const PoolItem &obj)
 Stream output.
 
bool operator== (const PoolItem &lhs, const PoolItem &rhs)
 Required to disambiguate vs.
 
bool operator== (const PoolItem &lhs, const ResObject::constPtr &rhs)
 Convenience compare.
 
bool operator== (const ResObject::constPtr &lhs, const PoolItem &rhs)
 Convenience compare.
 
bool operator!= (const PoolItem &lhs, const PoolItem &rhs)
 Required to disambiguate vs.
 
bool operator!= (const PoolItem &lhs, const ResObject::constPtr &rhs)
 Convenience compare.
 
bool operator!= (const ResObject::constPtr &lhs, const PoolItem &rhs)
 Convenience compare.
 

Status validation.

Performed for non-packages.

class pool::PoolImpl
 
RW_pointer< Impl_pimpl
 Pointer to implementation.
 
bool isUndetermined () const
 No validation is performed for packages.
 
bool isRelevant () const
 Returns true if the solvable is relevant which means e.g.
 
bool isSatisfied () const
 Whether a relevant items requirements are met.
 
bool isBroken () const
 Whether a relevant items requirements are broken.
 
bool isNeeded () const
 This includes unlocked broken patches, as well as those already selected to be installed (otherwise classified as satisfied).
 
bool isUnwanted () const
 Broken (needed) but locked patches.
 
ResPool pool () const
 Return the ResPool the item belongs to.
 
 operator sat::Solvable () const
 This is a sat::SolvableType.
 
sat::Solvable buddy () const
 Return the buddy we share our status object with.
 
ResObject::constPtr resolvable () const
 Returns the ResObject::constPtr.
 
 operator ResObject::constPtr () const
 Implicit conversion into ResObject::constPtr to support query filters operating on ResObject.
 
ResObject::constPtr operator-> () const
 Forward -> access to ResObject.
 
static PoolItem makePoolItem (const sat::Solvable &solvable_r)
 PoolItem generator for pool::PoolImpl.
 
void setBuddy (const sat::Solvable &solv_r)
 Buddies are set by pool::PoolImpl.
 
 PoolItem (Impl *implptr_r)
 Expose type only.
 

tmp hack for save/restore state.

struct PoolItemSaver
 
void saveState () const
 
void restoreState () const
 
bool sameState () const
 

Additional Inherited Members

- Public Attributes inherited from zypp::sat::SolvableType< PoolItem >
Capabilities const
 
- Protected Member Functions inherited from zypp::sat::SolvableType< PoolItem >
 SolvableType ()
 
 SolvableType (const SolvableType &)
 
 SolvableType (SolvableType &&)
 
void operator= (const SolvableType &)
 
void operator= (SolvableType &&)
 
 ~SolvableType ()
 

Detailed Description

Combining sat::Solvable and ResStatus.

The "real" PoolItem is usually somewhere in the ResPool. This is a reference to it. All copies made will reference (and modify) the same PoolItem. All changes via a PoolItem are immediately visible in all copies (now COW).

Note
PoolItem is a SolvableType, which provides direct access to many of the underlying sat::Solvables properties.
See also
sat::SolvableType
Note
Constness: Like pointer types, a const PoolItem does not refer to a const PoolItem. The reference is const, i.e. you can't change the refered PoolItem. The PoolItem (i.e. the status) is always mutable.

Definition at line 50 of file PoolItem.h.

Constructor & Destructor Documentation

◆ PoolItem() [1/5]

zypp::PoolItem::PoolItem ( )

Default ctor for use in std::container.

Definition at line 183 of file PoolItem.cc.

◆ PoolItem() [2/5]

zypp::PoolItem::PoolItem ( const sat::Solvable solvable_r)
explicit

Ctor looking up the sat::Solvable in the ResPool.

Definition at line 187 of file PoolItem.cc.

◆ PoolItem() [3/5]

template<class Derived >
zypp::PoolItem::PoolItem ( const SolvableType< Derived > &  solvable_r)
inlineexplicit

Ctor looking up the sat::Solvable in the ResPool.

Definition at line 62 of file PoolItem.h.

◆ PoolItem() [4/5]

zypp::PoolItem::PoolItem ( const ResObject::constPtr resolvable_r)
explicit

Ctor looking up the ResObject in the ResPool.

Definition at line 191 of file PoolItem.cc.

◆ ~PoolItem()

zypp::PoolItem::~PoolItem ( )

Dtor.

Definition at line 204 of file PoolItem.cc.

◆ PoolItem() [5/5]

zypp::PoolItem::PoolItem ( Impl implptr_r)
explicitprivate

Expose type only.

Definition at line 195 of file PoolItem.cc.

Member Function Documentation

◆ status()

ResStatus & zypp::PoolItem::status ( ) const

Returns the current status.

Definition at line 211 of file PoolItem.cc.

◆ statusReset()

ResStatus & zypp::PoolItem::statusReset ( ) const

Resets status to the default state (KEEP_STATE bySOLVER; clears any lock!).

Definition at line 212 of file PoolItem.cc.

◆ statusReinit()

ResStatus & zypp::PoolItem::statusReinit ( ) const

Resets status to it's initial state in the ResPool (KEEP_STATE bySOLVER or LOCKED byUSER).

The state depends on whether the PoolItem matched a hard lock defined in /etc/zypp/locks or not.

Definition at line 213 of file PoolItem.cc.

◆ isUndetermined()

bool zypp::PoolItem::isUndetermined ( ) const

No validation is performed for packages.

Definition at line 216 of file PoolItem.cc.

◆ isRelevant()

bool zypp::PoolItem::isRelevant ( ) const

Returns true if the solvable is relevant which means e.g.

for patches that at least one package of the patch is installed.

Definition at line 217 of file PoolItem.cc.

◆ isSatisfied()

bool zypp::PoolItem::isSatisfied ( ) const

Whether a relevant items requirements are met.

Definition at line 218 of file PoolItem.cc.

◆ isBroken()

bool zypp::PoolItem::isBroken ( ) const

Whether a relevant items requirements are broken.

Definition at line 219 of file PoolItem.cc.

◆ isNeeded()

bool zypp::PoolItem::isNeeded ( ) const

This includes unlocked broken patches, as well as those already selected to be installed (otherwise classified as satisfied).

Definition at line 220 of file PoolItem.cc.

◆ isUnwanted()

bool zypp::PoolItem::isUnwanted ( ) const

Broken (needed) but locked patches.

Definition at line 221 of file PoolItem.cc.

◆ pool()

ResPool zypp::PoolItem::pool ( ) const

Return the ResPool the item belongs to.

Definition at line 207 of file PoolItem.cc.

◆ operator sat::Solvable()

zypp::PoolItem::operator sat::Solvable ( ) const
inlineexplicit

This is a sat::SolvableType.

Definition at line 121 of file PoolItem.h.

◆ buddy()

sat::Solvable zypp::PoolItem::buddy ( ) const

Return the buddy we share our status object with.

A Product e.g. may share its status with an associated reference Package.

Definition at line 214 of file PoolItem.cc.

◆ resolvable()

ResObject::constPtr zypp::PoolItem::resolvable ( ) const

Returns the ResObject::constPtr.

See also
operator->

Definition at line 226 of file PoolItem.cc.

◆ operator ResObject::constPtr()

zypp::PoolItem::operator ResObject::constPtr ( ) const
inline

Implicit conversion into ResObject::constPtr to support query filters operating on ResObject.

Definition at line 138 of file PoolItem.h.

◆ operator->()

ResObject::constPtr zypp::PoolItem::operator-> ( ) const
inline

Forward -> access to ResObject.

Definition at line 142 of file PoolItem.h.

◆ makePoolItem()

PoolItem zypp::PoolItem::makePoolItem ( const sat::Solvable solvable_r)
staticprivate

PoolItem generator for pool::PoolImpl.

Definition at line 199 of file PoolItem.cc.

◆ setBuddy()

void zypp::PoolItem::setBuddy ( const sat::Solvable solv_r)
private

Buddies are set by pool::PoolImpl.

Definition at line 215 of file PoolItem.cc.

◆ saveState()

void zypp::PoolItem::saveState ( ) const
private

Definition at line 223 of file PoolItem.cc.

◆ restoreState()

void zypp::PoolItem::restoreState ( ) const
private

Definition at line 224 of file PoolItem.cc.

◆ sameState()

bool zypp::PoolItem::sameState ( ) const
private

Definition at line 225 of file PoolItem.cc.

Friends And Related Function Documentation

◆ pool::PoolImpl

friend class pool::PoolImpl
friend

Definition at line 146 of file PoolItem.h.

◆ PoolItemSaver

friend struct PoolItemSaver
friend
Todo:
get rid of it.

Definition at line 163 of file PoolItem.h.

◆ operator<< [1/2]

std::ostream & operator<< ( std::ostream &  str,
const PoolItem obj 
)
friend

Definition at line 229 of file PoolItem.cc.

◆ operator<<() [2/2]

std::ostream & operator<< ( std::ostream &  str,
const PoolItem obj 
)
related

Stream output.

Definition at line 229 of file PoolItem.cc.

◆ operator==() [1/3]

bool operator== ( const PoolItem lhs,
const PoolItem rhs 
)
related

Required to disambiguate vs.

(PoolItem,ResObject::constPtr) due to implicit PoolItem::operator ResObject::constPtr

Definition at line 176 of file PoolItem.h.

◆ operator==() [2/3]

bool operator== ( const PoolItem lhs,
const ResObject::constPtr rhs 
)
related

Convenience compare.

Definition at line 180 of file PoolItem.h.

◆ operator==() [3/3]

bool operator== ( const ResObject::constPtr lhs,
const PoolItem rhs 
)
related

Convenience compare.

Definition at line 184 of file PoolItem.h.

◆ operator!=() [1/3]

bool operator!= ( const PoolItem lhs,
const PoolItem rhs 
)
related

Required to disambiguate vs.

(PoolItem,ResObject::constPtr) due to implicit PoolItem::operator ResObject::constPtr

Definition at line 189 of file PoolItem.h.

◆ operator!=() [2/3]

bool operator!= ( const PoolItem lhs,
const ResObject::constPtr rhs 
)
related

Convenience compare.

Definition at line 193 of file PoolItem.h.

◆ operator!=() [3/3]

bool operator!= ( const ResObject::constPtr lhs,
const PoolItem rhs 
)
related

Convenience compare.

Definition at line 197 of file PoolItem.h.

Member Data Documentation

◆ _pimpl

RW_pointer<Impl> zypp::PoolItem::_pimpl
private

Pointer to implementation.

Definition at line 157 of file PoolItem.h.


The documentation for this class was generated from the following files: