zypp::ForEachMatchInPool Class Reference
[Find matching Capabilities.Filters and FunctorsFilter functors operating on Capability.]

Functor invoking action_r on each matching Capability in a ResPool. More...

#include <CapMatchHelper.h>

List of all members.

Public Types

typedef function< bool(const
CapAndItem &)> 
Action

Public Member Functions

 ForEachMatchInPool (const ResPool &pool_r, const Dep &dep_r, const Action &action_r)
bool operator() (const Capability &cap_r) const

Private Attributes

ResPool _pool
Dep _dep
Action _action


Detailed Description

Functor invoking action_r on each matching Capability in a ResPool.

Functor is provided to ease using forEachMatchIn as action in other algorithms.

 bool consume( const CapAndItem & cai_r );

 ResPool  _pool;
 PoolItem _pi;

 // Invoke consume on all PoolItems obsoleted by pi.
 // short: forEachPoolItemMatchedBy( _pool, _pi, Dep::OBSOLETES, consume );
 for_each( _pi->dep(Dep::OBSOLETES).begin(),
           _pi->dep(Dep::OBSOLETES).end(),
           ForEachMatchInPool( _pool, Dep::PROVIDES, consume ) );

 // Invoke consume on all PoolItems obsoleting pi.
 // short: forEachPoolItemMatching( _pool, Dep::OBSOLETES, _pi, consume );
 for_each( pi->dep(Dep::PROVIDES).begin(),
           pi->dep(Dep::PROVIDES).end(),
           ForEachMatchInPool( _pool, Dep::OBSOLETES, consume ) );

See also:
forEachPoolItemMatchedBy

forEachPoolItemMatching

Definition at line 195 of file CapMatchHelper.h.


Member Typedef Documentation

typedef function<bool(const CapAndItem &)> zypp::ForEachMatchInPool::Action
 

Definition at line 198 of file CapMatchHelper.h.


Constructor & Destructor Documentation

zypp::ForEachMatchInPool::ForEachMatchInPool const ResPool pool_r,
const Dep dep_r,
const Action action_r
[inline]
 

Definition at line 201 of file CapMatchHelper.h.


Member Function Documentation

bool zypp::ForEachMatchInPool::operator() const Capability cap_r  )  const [inline]
 

Definition at line 209 of file CapMatchHelper.h.

References _action, _dep, _pool, and zypp::forEachMatchIn().


Member Data Documentation

ResPool zypp::ForEachMatchInPool::_pool [private]
 

Definition at line 216 of file CapMatchHelper.h.

Referenced by operator()().

Dep zypp::ForEachMatchInPool::_dep [private]
 

Definition at line 217 of file CapMatchHelper.h.

Referenced by operator()().

Action zypp::ForEachMatchInPool::_action [private]
 

Definition at line 218 of file CapMatchHelper.h.

Referenced by operator()().


The documentation for this class was generated from the following file:
Generated on Thu Apr 24 02:25:07 2008 for zypp by  doxygen 1.4.6