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

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

#include <SolvIterMixin.h>

Public Types

typedef size_t size_type
 

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. More...
 
size_type size () const
 Size of the collection. More...
 
template<class TSolv >
bool contains (const TSolv &solv_r) const
 Whether collection contains a specific Solvable. More...
 

Protected Member Functions

 SolvIterMixin ()
 
 ~SolvIterMixin ()
 
 SolvIterMixin (const SolvIterMixin &)
 
void operator= (const SolvIterMixin &)
 

Private Types

typedef filter_iterator< solvitermixin_detail::UnifyByIdent, Solvable_iteratorUnifiedSolvable_iterator
 

Private Member Functions

const Derived & self () const
 
Iterate unified Solbvables to be transformed into Selectable.
UnifiedSolvable_iterator unifiedSolvableBegin () const
 
UnifiedSolvable_iterator unifiedSolvableEnd () const
 
Iterable< UnifiedSolvable_iteratorunifiedSolvable () const
 

Iterate as Solvable

typedef DerivedSolvable_iterator Solvable_iterator
 
Solvable_iterator solvableBegin () const
 
Solvable_iterator solvableEnd () const
 
Iterable< Solvable_iteratorsolvable () const
 

Iterate as PoolItem

typedef transform_iterator< asPoolItem, Solvable_iteratorPoolItem_iterator
 
PoolItem_iterator poolItemBegin () const
 
PoolItem_iterator poolItemEnd () const
 
Iterable< PoolItem_iteratorpoolItem () const
 

Iterate ui::Selectable::Ptr

typedef transform_iterator< ui::asSelectable, UnifiedSolvable_iteratorSelectable_iterator
 
Selectable_iterator selectableBegin () const
 
Selectable_iterator selectableEnd () const
 
Iterable< Selectable_iteratorselectable () const
 

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
>
{
...
};
}

Definition at line 122 of file SolvIterMixin.h.

Member Typedef Documentation

◆ size_type

template<class Derived, class DerivedSolvable_iterator>
typedef size_t zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::size_type

Definition at line 125 of file SolvIterMixin.h.

◆ Solvable_iterator

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

Definition at line 156 of file SolvIterMixin.h.

◆ PoolItem_iterator

template<class Derived, class DerivedSolvable_iterator>
typedef transform_iterator<asPoolItem,Solvable_iterator> zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::PoolItem_iterator

Definition at line 167 of file SolvIterMixin.h.

◆ UnifiedSolvable_iterator

template<class Derived, class DerivedSolvable_iterator>
typedef filter_iterator<solvitermixin_detail::UnifyByIdent,Solvable_iterator> zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::UnifiedSolvable_iterator
private

Definition at line 177 of file SolvIterMixin.h.

◆ Selectable_iterator

template<class Derived, class DerivedSolvable_iterator>
typedef transform_iterator<ui::asSelectable,UnifiedSolvable_iterator> zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::Selectable_iterator

Definition at line 181 of file SolvIterMixin.h.

Constructor & Destructor Documentation

◆ SolvIterMixin() [1/2]

template<class Derived, class DerivedSolvable_iterator>
zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::SolvIterMixin ( )
inlineprotected

Definition at line 204 of file SolvIterMixin.h.

◆ ~SolvIterMixin()

template<class Derived, class DerivedSolvable_iterator>
zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::~SolvIterMixin ( )
inlineprotected

Definition at line 205 of file SolvIterMixin.h.

◆ SolvIterMixin() [2/2]

template<class Derived, class DerivedSolvable_iterator>
zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::SolvIterMixin ( const SolvIterMixin< Derived, DerivedSolvable_iterator > &  )
inlineprotected

Definition at line 206 of file SolvIterMixin.h.

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 134 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 138 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 143 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 157 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 159 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 161 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 168 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 170 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 172 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 182 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 184 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 186 of file SolvIterMixin.h.

◆ unifiedSolvableBegin()

template<class Derived, class DerivedSolvable_iterator>
UnifiedSolvable_iterator zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::unifiedSolvableBegin ( ) const
inlineprivate

Definition at line 193 of file SolvIterMixin.h.

◆ unifiedSolvableEnd()

template<class Derived, class DerivedSolvable_iterator>
UnifiedSolvable_iterator zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::unifiedSolvableEnd ( ) const
inlineprivate

Definition at line 195 of file SolvIterMixin.h.

◆ unifiedSolvable()

template<class Derived, class DerivedSolvable_iterator>
Iterable<UnifiedSolvable_iterator> zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::unifiedSolvable ( ) const
inlineprivate

Definition at line 197 of file SolvIterMixin.h.

◆ self()

template<class Derived, class DerivedSolvable_iterator>
const Derived& zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::self ( ) const
inlineprivate

Definition at line 201 of file SolvIterMixin.h.

◆ operator=()

template<class Derived, class DerivedSolvable_iterator>
void zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::operator= ( const SolvIterMixin< Derived, DerivedSolvable_iterator > &  )
inlineprotected

Definition at line 207 of file SolvIterMixin.h.


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