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 205 of file CapMatchHelper.h.


Member Typedef Documentation

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

Definition at line 208 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 211 of file CapMatchHelper.h.


Member Function Documentation

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

Definition at line 219 of file CapMatchHelper.h.

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


Member Data Documentation

ResPool zypp::ForEachMatchInPool::_pool [private]

Definition at line 226 of file CapMatchHelper.h.

Referenced by operator()().

Dep zypp::ForEachMatchInPool::_dep [private]

Definition at line 227 of file CapMatchHelper.h.

Referenced by operator()().

Action zypp::ForEachMatchInPool::_action [private]

Definition at line 228 of file CapMatchHelper.h.

Referenced by operator()().


The documentation for this class was generated from the following file:
Generated on Tue Sep 25 19:23:14 2007 for libzypp by  doxygen 1.5.3