zypp::sat::Solvable Class Reference

A Solvable object within the sat Pool. More...

#include <Solvable.h>

Inheritance diagram for zypp::sat::Solvable:
[legend]

List of all members.

Classes

class  SplitIdent
 Helper that splits an identifier into kind and name or vice versa. More...

Public Types

typedef sat::detail::SolvableIdType IdType

Public Member Functions

 Solvable ()
 Default ctor creates noSolvable.
 Solvable (IdType id_r)
 PoolImpl ctor.
bool isSystem () const
 Return whether this Solvable belongs to the system repo.
Repository repository () const
 The Repository this Solvable belongs to.
IdString ident () const
 The identifier.
ResKind kind () const
bool isKind (const ResKind &kind_r) const
 Test whether a Solvable is of a certain ResKind.
template<class _Res >
bool isKind () const
template<class _Iterator >
bool isKind (_Iterator begin, _Iterator end)
std::string name () const
Edition edition () const
Arch arch () const
IdString vendor () const
bool multiversionInstall () const
 Whether different versions of this package can be installed at the same time.
bool installOnly () const ZYPP_DEPRECATED
std::string asString () const
 String representation "ident-edition.arch" or "noSolvable".
bool identical (Solvable rhs) const
 Test whether two Solvables have the same content.
bool sameNVRA (Solvable rhs) const
 Test for same name-version-release.arch.
Solvable nextInPool () const
 Return next Solvable in Pool (or noSolvable).
Solvable nextInRepo () const
 Return next Solvable in Repo (or noSolvable).
::_Solvable * get () const
 Expert backdoor.
IdType id () const
 Expert backdoor.
Attribute lookup.
See also:
LookupAttr and ArrayAttr providing a general, more query like interface for attribute retrieval.


std::string lookupStrAttribute (const SolvAttr &attr) const
 returns the string attribute value for attr or an empty string if it does not exists.
std::string lookupStrAttribute (const SolvAttr &attr, const Locale &lang_r) const
unsigned lookupNumAttribute (const SolvAttr &attr) const
 returns the numeric attribute value for attr or 0 if it does not exists.
bool lookupBoolAttribute (const SolvAttr &attr) const
 returns the boolean attribute value for attr or false if it does not exists.
detail::IdType lookupIdAttribute (const SolvAttr &attr) const
 returns the id attribute value for attr or detail::noId if it does not exists.
CheckSum lookupCheckSumAttribute (const SolvAttr &attr) const
 returns the CheckSum attribute value for attr or an empty CheckSum if ir does not exist.
OnMediaLocation lookupLocation () const
 returns OnMediaLocation data: This is everything we need to download e.g.
Access to the \ref Solvable dependencies.
Note:
Prerequires are a subset of requires.


Capabilities operator[] (Dep which_r) const
Capabilities provides () const
Capabilities requires () const
Capabilities conflicts () const
Capabilities obsoletes () const
Capabilities recommends () const
Capabilities suggests () const
Capabilities enhances () const
Capabilities supplements () const
Capabilities prerequires () const
CapabilitySet providesNamespace (const std::string &namespace_r) const
 Return the namespaced provides 'namespace([value])[ op edition]' of this Solvable.
CapabilitySet valuesOfNamespace (const std::string &namespace_r) const
 Return 'value[ op edition]' for namespaced provides 'namespace(value)[ op edition]'.
Locale support.
bool supportsLocales () const
 Whether this Solvable claims to support locales.
bool supportsLocale (const Locale &locale_r) const
 Whether this Solvable supports a specific Locale.
bool supportsLocale (const LocaleSet &locales_r) const
 Whether this Solvable supports at least one of the specified locales.
bool supportsRequestedLocales () const
 Whether this Solvable supports at least one requested locale.
void getSupportedLocales (LocaleSet &locales_r) const
 Return the supported locales via locales_r.
LocaleSet getSupportedLocales () const

Static Public Attributes

static const Solvable noSolvable
 Represents no Solvable.

Private Member Functions

friend base::SafeBool () const
bool boolTest () const

Private Attributes

IdType _id

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &str, const Solvable &obj)
std::ostream & dumpOn (std::ostream &str, const Solvable &obj)
bool operator== (const Solvable &lhs, const Solvable &rhs)
bool operator!= (const Solvable &lhs, const Solvable &rhs)
bool operator< (const Solvable &lhs, const Solvable &rhs)
bool identical (Solvable lhs, Solvable rhs)
bool sameNVRA (Solvable lhs, Solvable rhs)
template<class _Res >
bool isKind (const sat::Solvable &solvable_r)


Detailed Description

A Solvable object within the sat Pool.

Note:
Unfortunately libsatsolver combines the objects kind and name in a single identifier "pattern:kde_multimedia", except for packages and source packes. They are not prefixed by any kind string. Instead the architecture is abused to store "src" and "nosrc" values.
Solvable will hide this inconsistency by treating source packages as an own kind of solvable and map their arch to Arch_noarch.

Definition at line 57 of file Solvable.h.


Member Typedef Documentation

Definition at line 61 of file Solvable.h.


Constructor & Destructor Documentation

zypp::sat::Solvable::Solvable (  )  [inline]

Default ctor creates noSolvable.

Definition at line 65 of file Solvable.h.

Referenced by nextInPool(), and nextInRepo().

zypp::sat::Solvable::Solvable ( IdType  id_r  )  [inline, explicit]

PoolImpl ctor.

Definition at line 69 of file Solvable.h.


Member Function Documentation

bool zypp::sat::Solvable::isSystem (  )  const

Return whether this Solvable belongs to the system repo.

Note:
This includes the otherwise hidden systemSolvable.

Reimplemented in zypp::Resolvable.

Definition at line 153 of file Solvable.cc.

References _id, zypp::sat::detail::PoolMember::myPool(), NO_SOLVABLE_RETURN, and zypp::sat::detail::systemSolvableId().

Referenced by zypp::PoolItem::makePoolItem(), zypp::sat::operator<<(), and zypp::solver::detail::SATResolver::solving().

Repository zypp::sat::Solvable::repository (  )  const

std::string zypp::sat::Solvable::lookupStrAttribute ( const SolvAttr attr  )  const

std::string zypp::sat::Solvable::lookupStrAttribute ( const SolvAttr attr,
const Locale lang_r 
) const

unsigned zypp::sat::Solvable::lookupNumAttribute ( const SolvAttr attr  )  const

bool zypp::sat::Solvable::lookupBoolAttribute ( const SolvAttr attr  )  const

returns the boolean attribute value for attr or false if it does not exists.

Definition at line 197 of file Solvable.cc.

References zypp::IdStringType< Derived >::id(), and NO_SOLVABLE_RETURN.

Referenced by zypp::Pattern::isDefault(), zypp::Patch::rebootSuggested(), zypp::Patch::reloginSuggested(), zypp::Patch::restartSuggested(), and zypp::Pattern::userVisible().

detail::IdType zypp::sat::Solvable::lookupIdAttribute ( const SolvAttr attr  )  const

returns the id attribute value for attr or detail::noId if it does not exists.

Definition at line 203 of file Solvable.cc.

References zypp::IdStringType< Derived >::id(), NO_SOLVABLE_RETURN, and zypp::sat::detail::noId().

Referenced by zypp::Package::sourcePkgEdition(), and zypp::Package::sourcePkgName().

CheckSum zypp::sat::Solvable::lookupCheckSumAttribute ( const SolvAttr attr  )  const

returns the CheckSum attribute value for attr or an empty CheckSum if ir does not exist.

Definition at line 209 of file Solvable.cc.

References zypp::IdStringType< Derived >::id(), zypp::CheckSum::md5(), NO_SOLVABLE_RETURN, zypp::CheckSum::sha1(), and zypp::CheckSum::sha256().

Referenced by zypp::Package::checksum(), and lookupLocation().

OnMediaLocation zypp::sat::Solvable::lookupLocation (  )  const

IdString zypp::sat::Solvable::ident (  )  const

ResKind zypp::sat::Solvable::kind (  )  const

bool zypp::sat::Solvable::isKind ( const ResKind kind_r  )  const

template<class _Res >
bool zypp::sat::Solvable::isKind (  )  const [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Reimplemented in zypp::Resolvable.

Definition at line 159 of file Solvable.h.

References isKind().

Referenced by isKind().

template<class _Iterator >
bool zypp::sat::Solvable::isKind ( _Iterator  begin,
_Iterator  end 
) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 163 of file Solvable.h.

References for_, and isKind().

Referenced by isKind().

std::string zypp::sat::Solvable::name (  )  const

Reimplemented in zypp::Resolvable.

Definition at line 356 of file Solvable.cc.

References zypp::IdString::c_str(), ident(), and NO_SOLVABLE_RETURN.

Referenced by zypp::filter::SameItemAs::operator()().

Edition zypp::sat::Solvable::edition (  )  const

Arch zypp::sat::Solvable::arch (  )  const

IdString zypp::sat::Solvable::vendor (  )  const

bool zypp::sat::Solvable::multiversionInstall (  )  const

Whether different versions of this package can be installed at the same time.

Per default false.

See also:
also ZConfig::multiversion.

Reimplemented in zypp::Resolvable.

Definition at line 384 of file Solvable.cc.

References ident(), and zypp::sat::detail::PoolMember::myPool().

Referenced by zypp::sat::WhatObsoletes::ctorAdd(), installOnly(), and zypp::ui::Selectable::Impl::multiversionInstall().

bool zypp::sat::Solvable::installOnly (  )  const

Deprecated:
Use multiversionInstall.

Reimplemented in zypp::Resolvable.

Definition at line 389 of file Solvable.cc.

References multiversionInstall().

std::string zypp::sat::Solvable::asString (  )  const

String representation "ident-edition.arch" or "noSolvable".

   product:openSUSE-11.1.x86_64
   autoyast2-2.16.19-0.1.src
   noSolvable

Definition at line 500 of file Solvable.cc.

References _id, zypp::str::form(), NO_SOLVABLE_RETURN, and zypp::sat::detail::systemSolvableId().

Referenced by zypp::solver::detail::SATResolver::problems().

bool zypp::sat::Solvable::identical ( Solvable  rhs  )  const

Test whether two Solvables have the same content.

Basically the same name, edition, arch, vendor and buildtime.

Definition at line 509 of file Solvable.cc.

References get(), and NO_SOLVABLE_RETURN.

Referenced by identical(), and zypp::PoolItem::identical().

bool zypp::sat::Solvable::sameNVRA ( Solvable  rhs  )  const [inline]

Test for same name-version-release.arch.

Definition at line 195 of file Solvable.h.

References arch(), edition(), and ident().

Referenced by sameNVRA(), and zypp::PoolItem::sameNVRA().

Capabilities zypp::sat::Solvable::operator[] ( Dep  which_r  )  const

Capabilities zypp::sat::Solvable::provides (  )  const

Reimplemented in zypp::Resolvable.

Definition at line 418 of file Solvable.cc.

References zypp::sat::_getCapabilities(), and NO_SOLVABLE_RETURN.

Referenced by operator[](), providesNamespace(), and valuesOfNamespace().

Capabilities zypp::sat::Solvable::requires (  )  const

Reimplemented in zypp::Resolvable.

Definition at line 423 of file Solvable.cc.

References zypp::sat::_getCapabilities(), and NO_SOLVABLE_RETURN.

Referenced by operator[]().

Capabilities zypp::sat::Solvable::conflicts (  )  const

Reimplemented in zypp::Resolvable.

Definition at line 428 of file Solvable.cc.

References zypp::sat::_getCapabilities(), and NO_SOLVABLE_RETURN.

Referenced by operator[]().

Capabilities zypp::sat::Solvable::obsoletes (  )  const

Reimplemented in zypp::Resolvable.

Definition at line 433 of file Solvable.cc.

References zypp::sat::_getCapabilities(), and NO_SOLVABLE_RETURN.

Referenced by zypp::sat::WhatObsoletes::ctorAdd(), and operator[]().

Capabilities zypp::sat::Solvable::recommends (  )  const

Reimplemented in zypp::Resolvable.

Definition at line 438 of file Solvable.cc.

References zypp::sat::_getCapabilities(), and NO_SOLVABLE_RETURN.

Referenced by operator[]().

Capabilities zypp::sat::Solvable::suggests (  )  const

Reimplemented in zypp::Resolvable.

Definition at line 443 of file Solvable.cc.

References zypp::sat::_getCapabilities(), and NO_SOLVABLE_RETURN.

Referenced by operator[]().

Capabilities zypp::sat::Solvable::enhances (  )  const

Reimplemented in zypp::Resolvable.

Definition at line 448 of file Solvable.cc.

References zypp::sat::_getCapabilities(), and NO_SOLVABLE_RETURN.

Referenced by operator[]().

Capabilities zypp::sat::Solvable::supplements (  )  const

Capabilities zypp::sat::Solvable::prerequires (  )  const

Reimplemented in zypp::Resolvable.

Definition at line 458 of file Solvable.cc.

References NO_SOLVABLE_RETURN, and zypp::sat::detail::solvablePrereqMarker().

Referenced by operator[]().

CapabilitySet zypp::sat::Solvable::providesNamespace ( const std::string &  namespace_r  )  const

Return the namespaced provides 'namespace([value])[ op edition]' of this Solvable.

Reimplemented in zypp::Resolvable.

Definition at line 467 of file Solvable.cc.

References zypp::Capabilities::begin(), zypp::Capabilities::end(), for_, zypp::str::hasPrefix(), NO_SOLVABLE_RETURN, and provides().

CapabilitySet zypp::sat::Solvable::valuesOfNamespace ( const std::string &  namespace_r  )  const

Return 'value[ op edition]' for namespaced provides 'namespace(value)[ op edition]'.

Similar to providesNamespace, but the namespace is stripped from the dependencies. This is convenient if the namespace denotes packages that should be looked up. E.g. the weakremover namespace used in a products release package denotes the packages that were dropped from the distribution.

See also:
Product::droplist

Reimplemented in zypp::Resolvable.

Definition at line 481 of file Solvable.cc.

References zypp::Capabilities::begin(), zypp::Capabilities::end(), for_, zypp::str::hasPrefix(), NO_SOLVABLE_RETURN, and provides().

Referenced by zypp::Product::droplist().

bool zypp::sat::Solvable::supportsLocales (  )  const

Whether this Solvable claims to support locales.

Reimplemented in zypp::ResObject.

Definition at line 593 of file Solvable.cc.

References zypp::functor::false_c(), and supplements().

bool zypp::sat::Solvable::supportsLocale ( const Locale locale_r  )  const

Whether this Solvable supports a specific Locale.

Reimplemented in zypp::ResObject.

Definition at line 599 of file Solvable.cc.

References supplements().

Referenced by supportsRequestedLocales().

bool zypp::sat::Solvable::supportsLocale ( const LocaleSet locales_r  )  const

Whether this Solvable supports at least one of the specified locales.

Reimplemented in zypp::ResObject.

Definition at line 605 of file Solvable.cc.

References supplements().

bool zypp::sat::Solvable::supportsRequestedLocales (  )  const

Whether this Solvable supports at least one requested locale.

See also:
Pool::setRequestedLocales

Reimplemented in zypp::ResObject.

Definition at line 613 of file Solvable.cc.

References zypp::sat::detail::PoolMember::myPool(), and supportsLocale().

void zypp::sat::Solvable::getSupportedLocales ( LocaleSet locales_r  )  const

Return the supported locales via locales_r.

Definition at line 616 of file Solvable.cc.

References supplements().

LocaleSet zypp::sat::Solvable::getSupportedLocales (  )  const [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Reimplemented in zypp::ResObject.

Definition at line 246 of file Solvable.h.

References getSupportedLocales().

Referenced by getSupportedLocales().

Solvable zypp::sat::Solvable::nextInPool (  )  const

Return next Solvable in Pool (or noSolvable).

Definition at line 130 of file Solvable.cc.

References _id, zypp::sat::detail::PoolMember::myPool(), and Solvable().

Referenced by zypp::sat::detail::SolvableIterator::increment().

Solvable zypp::sat::Solvable::nextInRepo (  )  const

Return next Solvable in Repo (or noSolvable).

Definition at line 133 of file Solvable.cc.

References _id, zypp::sat::detail::PoolMember::myPool(), NO_SOLVABLE_RETURN, noSolvable, and Solvable().

_Solvable * zypp::sat::Solvable::get (  )  const

IdType zypp::sat::Solvable::id (  )  const [inline]

zypp::sat::Solvable::base::SafeBool (  )  const [private]

bool zypp::sat::Solvable::boolTest (  )  const [inline, private]

Definition at line 298 of file Solvable.h.


Friends And Related Function Documentation

std::ostream & operator<< ( std::ostream &  str,
const Solvable obj 
) [related]

Stream output

Definition at line 627 of file Solvable.cc.

std::ostream & dumpOn ( std::ostream &  str,
const Solvable obj 
) [related]

More verbose stream output including dependencies

Definition at line 643 of file Solvable.cc.

bool operator== ( const Solvable lhs,
const Solvable rhs 
) [related]

Definition at line 311 of file Solvable.h.

References get().

bool operator!= ( const Solvable lhs,
const Solvable rhs 
) [related]

Definition at line 315 of file Solvable.h.

References get().

bool operator< ( const Solvable lhs,
const Solvable rhs 
) [related]

Definition at line 319 of file Solvable.h.

References get().

bool identical ( Solvable  lhs,
Solvable  rhs 
) [related]

Test for same content.

Definition at line 323 of file Solvable.h.

References identical().

bool sameNVRA ( Solvable  lhs,
Solvable  rhs 
) [related]

Test for same name version release and arch.

Definition at line 327 of file Solvable.h.

References sameNVRA().

template<class _Res >
bool isKind ( const sat::Solvable solvable_r  )  [related]

Test whether a sat::Solvable is of a certain Kind.

Definition at line 385 of file Solvable.h.

References isKind().


Member Data Documentation

Definition at line 300 of file Solvable.h.

Referenced by asString(), get(), id(), isSystem(), nextInPool(), and nextInRepo().


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

doxygen