libzypp 17.37.10

zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator > Class Template Reference

Base class providing common iterator types based on a Solvable iterator. More...

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

## Public Types
using | size_type = size_t

## Public Member Functions
Convenience methods.
In case `Derived` is able to provide a more efficient implementation, the methods should be overloaded.
bool | empty () const
| Whether the collection is epmty.
size_type | size () const
| Size of the collection.
template<class TSolv>
bool | contains (const TSolv &solv_r) const
| Whether collection contains a specific Solvable.

## Iterate as Solvable
using | Solvable_iterator = DerivedSolvable_iterator
Solvable_iterator | solvableBegin () const
Solvable_iterator | solvableEnd () const
Iterable< Solvable_iterator > | solvable () const

## Iterate as PoolItem
using | PoolItem_iterator = transform_iterator<asPoolItem, Solvable_iterator>
using | UnifiedSolvable_iterator = filter_iterator<solvitermixin_detail::UnifyByIdent, Solvable_iterator>
PoolItem_iterator | poolItemBegin () const
PoolItem_iterator | poolItemEnd () const
Iterable< PoolItem_iterator > | poolItem () const

## Iterate ui::Selectable::Ptr
using | Selectable_iterator = transform_iterator<ui::asSelectable, UnifiedSolvable_iterator>
Selectable_iterator | selectableBegin () const
Selectable_iterator | selectableEnd () const
Iterable< Selectable_iterator > | selectable () const

## Iterate unified Solbvables to be transformed into Selectable.
UnifiedSolvable_iterator | unifiedSolvableBegin () const
UnifiedSolvable_iterator | unifiedSolvableEnd () const
Iterable< UnifiedSolvable_iterator > | unifiedSolvable () const
const Derived & | self () const
| SolvIterMixin ()
| ~SolvIterMixin ()
| SolvIterMixin (const SolvIterMixin &)=default
SolvIterMixin & | operator= (const SolvIterMixin &)=default
| SolvIterMixin (SolvIterMixin &&) noexcept=default
SolvIterMixin & | operator= (SolvIterMixin &&) noexcept=default

## Detailed Description

template<class Derived, class DerivedSolvable_iterator>
class zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >

Base class providing common iterator types based on a Solvable iterator.

A class deriving from SolvIterMixin must provide two methods `begin` and `end` returning iterator over sat::Solvable.

SolvIterMixin will then provide iterators over the corresponding PoolItem and ui::Selectable_Ptr.

SolvIterMixin will also provide default implementations for empty and size by iterating from `begin` to `end`. In case `Derived` is able to provide a more efficient implementation, the methods should be overloaded.

Note
  You will sometimes face the problem, that when using the PoolItem iterator you hit multiple version of the same package, while when using the ui::Selectable iterator the information which of the available candidates actually matched got lost. In this case class PoolItemBest may help you. Use it to pick the best version only.

namespace detail
{
class WhatProvidesIterator;
}
class WhatProvides : public SolvIterMixin<WhatProvides,detail::WhatProvidesIterator>
{
public:
typedef detail::WhatProvidesIterator const_iterator;
// Iterator pointing to the first Solvable.
const_iterator begin() const;
// Iterator pointing behind the last Solvable.
const_iterator end() const;
};
namespace detail
{
class WhatProvidesIterator : public boost::iterator_adaptor<
WhatProvidesIterator // Derived
, const detail::IdType * // Base
, const Solvable // Value
, boost::forward_traversal_tag // CategoryOrTraversal
, const Solvable // Reference
>
{
...
};
}
zypp::sat::SolvIterMixin
Base class providing common iterator types based on a Solvable iterator.
Definition SolvIterMixin.h:117
zypp::sat::WhatProvides
Container of Solvable providing a Capability (read only).
Definition WhatProvides.h:89
zypp::sat::detail::WhatProvidesIterator
WhatProvides iterator.
Definition WhatProvides.h:161
zypp::sat::detail
Definition PoolImpl.cc:72
zypp::solver::detail
Definition PoolImpl.h:110

Definition at line 116 of file SolvIterMixin.h.

## Member Typedef Documentation

## ◆ size_type

template<class Derived, class DerivedSolvable_iterator>

using zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::size_type = size_t

Definition at line 119 of file SolvIterMixin.h.

## ◆ Solvable_iterator

template<class Derived, class DerivedSolvable_iterator>

using zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::Solvable_iterator = DerivedSolvable_iterator

Definition at line 150 of file SolvIterMixin.h.

## ◆ PoolItem_iterator

template<class Derived, class DerivedSolvable_iterator>

using zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::PoolItem_iterator = transform_iterator<asPoolItem, Solvable_iterator>

Definition at line 161 of file SolvIterMixin.h.

## ◆ UnifiedSolvable_iterator

template<class Derived, class DerivedSolvable_iterator>

using zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::UnifiedSolvable_iterator = filter_iterator<solvitermixin_detail::UnifyByIdent, Solvable_iterator>
| private

Definition at line 171 of file SolvIterMixin.h.

## ◆ Selectable_iterator

template<class Derived, class DerivedSolvable_iterator>

using zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::Selectable_iterator = transform_iterator<ui::asSelectable, UnifiedSolvable_iterator>

Definition at line 175 of file SolvIterMixin.h.

## Constructor & Destructor Documentation

## ◆ SolvIterMixin() [1/3]

template<class Derived, class DerivedSolvable_iterator>

zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::SolvIterMixin | ( |  | ) |
| inline protected

Definition at line 198 of file SolvIterMixin.h.

## ◆ ~SolvIterMixin()

template<class Derived, class DerivedSolvable_iterator>

zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::~SolvIterMixin | ( |  | ) |
| inline protected

Definition at line 199 of file SolvIterMixin.h.

## ◆ SolvIterMixin() [2/3]

template<class Derived, class DerivedSolvable_iterator>

zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::SolvIterMixin | ( | const SolvIterMixin< Derived, DerivedSolvable_iterator > & |  | ) |
| protected default

## ◆ SolvIterMixin() [3/3]

template<class Derived, class DerivedSolvable_iterator>

zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::SolvIterMixin | ( | SolvIterMixin< Derived, DerivedSolvable_iterator > && |  | ) |
| protected default noexcept

## Member Function Documentation

## ◆ empty()

template<class Derived, class DerivedSolvable_iterator>

bool zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::empty | ( |  | ) | const
| inline

Whether the collection is epmty.

Definition at line 128 of file SolvIterMixin.h.

## ◆ size()

template<class Derived, class DerivedSolvable_iterator>

size_type zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::size | ( |  | ) | const
| inline

Size of the collection.

Definition at line 132 of file SolvIterMixin.h.

## ◆ contains()

template<class Derived, class DerivedSolvable_iterator>
template<class TSolv>

bool zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::contains | ( | const TSolv & | solv_r | ) | const
| inline

Whether collection contains a specific Solvable.

Definition at line 137 of file SolvIterMixin.h.

## ◆ solvableBegin()

template<class Derived, class DerivedSolvable_iterator>

Solvable_iterator zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::solvableBegin | ( |  | ) | const
| inline

Definition at line 151 of file SolvIterMixin.h.

## ◆ solvableEnd()

template<class Derived, class DerivedSolvable_iterator>

Solvable_iterator zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::solvableEnd | ( |  | ) | const
| inline

Definition at line 153 of file SolvIterMixin.h.

## ◆ solvable()

template<class Derived, class DerivedSolvable_iterator>

Iterable< Solvable_iterator > zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::solvable | ( |  | ) | const
| inline

Definition at line 155 of file SolvIterMixin.h.

## ◆ poolItemBegin()

template<class Derived, class DerivedSolvable_iterator>

PoolItem_iterator zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::poolItemBegin | ( |  | ) | const
| inline

Definition at line 162 of file SolvIterMixin.h.

## ◆ poolItemEnd()

template<class Derived, class DerivedSolvable_iterator>

PoolItem_iterator zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::poolItemEnd | ( |  | ) | const
| inline

Definition at line 164 of file SolvIterMixin.h.

## ◆ poolItem()

template<class Derived, class DerivedSolvable_iterator>

Iterable< PoolItem_iterator > zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::poolItem | ( |  | ) | const
| inline

Definition at line 166 of file SolvIterMixin.h.

## ◆ selectableBegin()

template<class Derived, class DerivedSolvable_iterator>

Selectable_iterator zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::selectableBegin | ( |  | ) | const
| inline

Definition at line 176 of file SolvIterMixin.h.

## ◆ selectableEnd()

template<class Derived, class DerivedSolvable_iterator>

Selectable_iterator zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::selectableEnd | ( |  | ) | const
| inline

Definition at line 178 of file SolvIterMixin.h.

## ◆ selectable()

template<class Derived, class DerivedSolvable_iterator>

Iterable< Selectable_iterator > zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::selectable | ( |  | ) | const
| inline

Definition at line 180 of file SolvIterMixin.h.

## ◆ unifiedSolvableBegin()

template<class Derived, class DerivedSolvable_iterator>

UnifiedSolvable_iterator zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::unifiedSolvableBegin | ( |  | ) | const
| inline private

Definition at line 187 of file SolvIterMixin.h.

## ◆ unifiedSolvableEnd()

template<class Derived, class DerivedSolvable_iterator>

UnifiedSolvable_iterator zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::unifiedSolvableEnd | ( |  | ) | const
| inline private

Definition at line 189 of file SolvIterMixin.h.

## ◆ unifiedSolvable()

template<class Derived, class DerivedSolvable_iterator>

Iterable< UnifiedSolvable_iterator > zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::unifiedSolvable | ( |  | ) | const
| inline private

Definition at line 191 of file SolvIterMixin.h.

## ◆ self()

template<class Derived, class DerivedSolvable_iterator>

const Derived & zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::self | ( |  | ) | const
| inline private

Definition at line 195 of file SolvIterMixin.h.

## ◆ operator=() [1/2]

template<class Derived, class DerivedSolvable_iterator>

SolvIterMixin & zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::operator= | ( | const SolvIterMixin< Derived, DerivedSolvable_iterator > & |  | ) |
| protected default

## ◆ operator=() [2/2]

template<class Derived, class DerivedSolvable_iterator>

SolvIterMixin & zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::operator= | ( | SolvIterMixin< Derived, DerivedSolvable_iterator > && |  | ) |
| protected default noexcept

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

- zypp/sat/SolvIterMixin.h