I just added a class SolvIterMixin (zypp/sat/SolvIterMixin.h).
Classes providing a sat::Solvable iterator - i.e methods begin() and end()
returning an iterator pointing to sat::Solvable - may derive from it to
add additional iterators. by now:
// value_type sat::Solvable (the same as the derived class' begin/end)
Solvable_iterator solvableBegin() const
Solvable_iterator solvableEnd() const
// value_type PoolItem
PoolItem_iterator poolItemBegin() const
PoolItem_iterator poolItemEnd() const
// value_type ui::Selectable::Ptr
Selectable_iterator selectableBegin() const
Selectable_iterator selectableEnd() const
(The Selectable_iterator will soon be enhanced to avoid multiple visits of
the same Selectable, because multiple Solvables/PoolItems refer to the
same Selectable.)
The intention is that all classes providing a collection of solvables
(Queries, Pattern/Patch contents, ...) offer this interface.
To use SolvIterMixin derive from it and pass the class and the iterator
type as template argument:
* namespace detail
* {
* class WhatProvidesIterator;
* }
*
* class WhatProvides
* : public SolvIterMixin