libzypp: zypp::sat::WhatProvides Class Reference

libzypp 17.38.14

zypp::sat::WhatProvides Class Reference

Container of Solvable providing a Capability (read only). More...

`#include <zypp/sat/WhatProvides.h>`

Inheritance diagram for zypp::sat::WhatProvides:

## Classes
class | Impl
| WhatProvides implementation date. More...

## Public Types
using | value_type = Solvable
using | size_type = unsigned int
using | const_iterator = detail::WhatProvidesIterator
Public Types inherited from zypp::sat::SolvIterMixin< WhatProvides, detail::WhatProvidesIterator >
using | size_type
using | Solvable_iterator
using | PoolItem_iterator
using | Selectable_iterator

## Public Member Functions
| WhatProvides ()
| Default ctor.
| WhatProvides (Capability cap_r)
| Ctor from Capability.
| WhatProvides (Capabilities caps_r)
| Ctor collecting all providers of capabilities in `caps_r`.
| WhatProvides (const CapabilitySet &caps_r)
| Ctor collecting all providers of capabilities in `caps_r`.
bool | empty () const
| Whether the container is empty.
size_type | size () const
| Number of solvables inside.
const_iterator | begin () const
| Iterator pointing to the first Solvable.
const_iterator | end () const
| Iterator pointing behind the last Solvable.
Public Member Functions inherited from zypp::sat::SolvIterMixin< WhatProvides, detail::WhatProvidesIterator >
bool | empty () const
| Whether the collection is epmty.
size_type | size () const
| Size of the collection.
bool | contains (const TSolv &solv_r) const
| Whether collection contains a specific Solvable.
Solvable_iterator | solvableBegin () const
Solvable_iterator | solvableEnd () const
Iterable< Solvable_iterator > | solvable () const
PoolItem_iterator | poolItemBegin () const
PoolItem_iterator | poolItemEnd () const
Iterable< PoolItem_iterator > | poolItem () const
Selectable_iterator | selectableBegin () const
Selectable_iterator | selectableEnd () const
Iterable< Selectable_iterator > | selectable () const

## Private Attributes
RW_pointer< Impl > | _pimpl

## Additional Inherited Members
| SolvIterMixin ()
| ~SolvIterMixin ()
SolvIterMixin & | operator= (const SolvIterMixin &)=default
Static Protected Member Functions inherited from zypp::sat::detail::PoolMember
static PoolImpl & | myPool ()
static bool | poolValid ()

## Detailed Description

Container of Solvable providing a Capability (read only).

Capability cap("amarok < 1.13");
WhatProvides q( cap );
Solvable firstMatch;
if ( ! q.empty() )
{
cout << "Found " << q.size() << " matches for " << cap << ":" << endl;
firstMatch = *q.begin();
for_( it, q.begin(), q.end() )
cout << *it << endl;
}
if ( firstMatch )
{
WhatProvides req( firstMatch.requires() );
if ( ! req.empty() )
{
cout << "Found " << req.size() << " items providing requirements of " << firstMatch << ":" << endl;
}
}
for_
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Definition Easy.h:27
zypp::Capability
A sat capability.
Definition Capability.h:63
zypp::sat::Solvable
A Solvable object within the sat Pool.
Definition Solvable.h:54
zypp::sat::WhatProvides::WhatProvides
WhatProvides()
Default ctor.
Definition WhatProvides.cc:94

Note
  Note that there are capabilities which are not provided by any Solvable, but are system properties. For example:
  rpmlib(PayloadIsBzip2) <= 3.0.5-1
  In that case a Solvable::noSolvable is returned, which has `isSystem` set `true`, although there should never be a Solvable::noSolvable returned with `isSystem` set `false`. If so, please file a bugreport.
  WhatProvides q( Capability("rpmlib(PayloadIsBzip2) <= 3.0.5-1") );
  for_( it, q.begin(), q.end() )
  {
  if ( *it )
  cout << "Capability is provided by package " << *it << endl;
  else if ( it->isSystem() )
  cout << "Capability is a system property" << endl;
  else
  ; // never reaching this \c else
  }

Definition at line 87 of file WhatProvides.h.

## Member Typedef Documentation

## ◆ value_type

using zypp::sat::WhatProvides::value_type = Solvable

Definition at line 91 of file WhatProvides.h.

## ◆ size_type

using zypp::sat::WhatProvides::size_type = unsigned int

Definition at line 92 of file WhatProvides.h.

## ◆ const_iterator

using zypp::sat::WhatProvides::const_iterator = detail::WhatProvidesIterator

Definition at line 118 of file WhatProvides.h.

## Constructor & Destructor Documentation

## ◆ WhatProvides() [1/4]

zypp::sat::WhatProvides::WhatProvides | ( |  | ) |

Default ctor.

Definition at line 94 of file WhatProvides.cc.

## ◆ WhatProvides() [2/4]

zypp::sat::WhatProvides::WhatProvides | ( | Capability | cap_r | ) |
| explicit

Ctor from Capability.

Definition at line 97 of file WhatProvides.cc.

## ◆ WhatProvides() [3/4]

zypp::sat::WhatProvides::WhatProvides | ( | Capabilities | caps_r | ) |
| explicit

Ctor collecting all providers of capabilities in `caps_r`.

Definition at line 107 of file WhatProvides.cc.

## ◆ WhatProvides() [4/4]

zypp::sat::WhatProvides::WhatProvides | ( | const CapabilitySet & | caps_r | ) |
| explicit

Ctor collecting all providers of capabilities in `caps_r`.

Definition at line 118 of file WhatProvides.cc.

## Member Function Documentation

## ◆ empty()

bool zypp::sat::WhatProvides::empty | ( |  | ) | const

Whether the container is empty.

Definition at line 129 of file WhatProvides.cc.

## ◆ size()

WhatProvides::size_type zypp::sat::WhatProvides::size | ( |  | ) | const

Number of solvables inside.

Definition at line 134 of file WhatProvides.cc.

## ◆ begin()

WhatProvides::const_iterator zypp::sat::WhatProvides::begin | ( |  | ) | const

Iterator pointing to the first Solvable.

Definition at line 145 of file WhatProvides.cc.

## ◆ end()

WhatProvides::const_iterator zypp::sat::WhatProvides::end | ( |  | ) | const
| inline

Iterator pointing behind the last Solvable.

Definition at line 234 of file WhatProvides.h.

## Member Data Documentation

## ◆ _pimpl

RW_pointer<Impl> zypp::sat::WhatProvides::_pimpl
| private

Definition at line 128 of file WhatProvides.h.

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

- zypp/sat/WhatProvides.h
- zypp/sat/WhatProvides.cc