Author: mlandres
Date: Fri Apr 11 14:43:37 2008
New Revision: 9535
URL: http://svn.opensuse.org/viewcvs/zypp?rev=9535&view=rev
Log:
- Add ResPool::satisfiedProductsBegin/End iterator over all products
whose dependencies are satisfied. This reflects the status determined
by the last solver run. (#368104)
Modified:
trunk/libzypp/zypp/Filter.h
trunk/libzypp/zypp/ResPool.h
Modified: trunk/libzypp/zypp/Filter.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Filter.h?rev=9535&r1=9534&r2=9535&view=diff
==============================================================================
--- trunk/libzypp/zypp/Filter.h (original)
+++ trunk/libzypp/zypp/Filter.h Fri Apr 11 14:43:37 2008
@@ -18,6 +18,7 @@
#include "zypp/base/Function.h"
// #include "zypp/ResFilters.h" included at the end!
#include "zypp/sat/Pool.h"
+#include "zypp/PoolItem.h"
///////////////////////////////////////////////////////////////////
namespace zypp
@@ -126,6 +127,27 @@
template<class _Res>
inline ByKind byKind()
{ return ByKind( ResTraits<_Res>::kind ); }
+ ///////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : SatisfiedProducts
+ //
+ /** Filter returning the satisfied products.
+ */
+ class SatisfiedProducts
+ {
+ public:
+ /** Filter on \ref PoolItem. */
+ bool operator()( const PoolItem & pi_r ) const
+ { return pi_r.satSolvable().isKind( ResKind::product ) && pi_r.isSatisfied(); }
+
+ /** Filter on satSolvabe/ResObject. */
+ template<class _Solv>
+ bool operator()( const _Solv & solv_r ) const
+ { return operator()( PoolItem( solv_r ) ); }
+ };
+ ///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
//@}
Modified: trunk/libzypp/zypp/ResPool.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ResPool.h?rev=9535&r1=9534&r2=9535&view=diff
==============================================================================
--- trunk/libzypp/zypp/ResPool.h (original)
+++ trunk/libzypp/zypp/ResPool.h Fri Apr 11 14:43:37 2008
@@ -77,7 +77,7 @@
/** */
size_type size() const;
- /** \name Iterate through all PoolItems (all kinds). */
+ /** \name Iterate over all PoolItems (all kinds). */
//@{
/** */
const_iterator begin() const
@@ -99,7 +99,7 @@
{ return( resolvable_r ? find( resolvable_r->satSolvable() ) : PoolItem() ); }
public:
- /** \name Iterate through all PoolItems matching a \c _Filter. */
+ /** \name Iterate over all PoolItems matching a \c _Filter. */
//@{
template<class _Filter>
filter_iterator<_Filter,const_iterator> filterBegin( const _Filter & filter_r ) const
@@ -111,7 +111,7 @@
//@}
public:
- /** \name Iterate through all PoolItems of a certain name and kind. */
+ /** \name Iterate over all PoolItems of a certain name and kind. */
//@{
typedef pool::ByIdent ByIdent;
typedef pool::PoolTraits::byIdent_iterator byIdent_iterator;
@@ -179,7 +179,7 @@
//@}
public:
- /** \name Iterate through all ResObjects of a certain kind. */
+ /** \name Iterate over all ResObjects of a certain kind. */
//@{
typedef filter::ByKind ByKind;
typedef filter_iterator