libzypp  13.10.6
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 _Solv >
bool contains (const _Solv &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_iterator
UnifiedSolvable_iterator
 

Private Member Functions

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

Iterate as Solvable

typedef DerivedSolvable_iterator Solvable_iterator
 
Solvable_iterator solvableBegin () const
 
Solvable_iterator solvableEnd () const
 

Iterate as PoolItem

typedef transform_iterator
< asPoolItem,
Solvable_iterator
PoolItem_iterator
 
PoolItem_iterator poolItemBegin () const
 
PoolItem_iterator poolItemEnd () const
 

Iterate ui::Selectable::Ptr

typedef transform_iterator
< ui::asSelectable,
UnifiedSolvable_iterator
Selectable_iterator
 
Selectable_iterator selectableBegin () const
 
Selectable_iterator selectableEnd () 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

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.

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.

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

Definition at line 165 of file SolvIterMixin.h.

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 173 of file SolvIterMixin.h.

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

Definition at line 177 of file SolvIterMixin.h.

Constructor & Destructor Documentation

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

Definition at line 196 of file SolvIterMixin.h.

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

Definition at line 197 of file SolvIterMixin.h.

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

Definition at line 198 of file SolvIterMixin.h.

Member Function Documentation

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.

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.

template<class Derived, class DerivedSolvable_iterator>
template<class _Solv >
bool zypp::sat::SolvIterMixin< Derived, DerivedSolvable_iterator >::contains ( const _Solv &  solv_r) const
inline

Whether collection contains a specific Solvable.

Definition at line 143 of file SolvIterMixin.h.

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.

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.

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

Definition at line 166 of file SolvIterMixin.h.

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

Definition at line 168 of file SolvIterMixin.h.

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

Definition at line 178 of file SolvIterMixin.h.

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

Definition at line 180 of file SolvIterMixin.h.

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

Definition at line 187 of file SolvIterMixin.h.

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

Definition at line 189 of file SolvIterMixin.h.

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

Definition at line 193 of file SolvIterMixin.h.

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

Definition at line 199 of file SolvIterMixin.h.


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