Find matching Capabilities.
[Algorithms]


Classes

class  zypp::ForEachMatchInPool
 Functor invoking action_r on each matching Capability in a ResPool. More...
struct  zypp::OncePerPoolItem
 Functor translating CapAndItem actions into PoolItem actions avoiding multiple invocations for the same PoolItem. More...

Functions

int zypp::forEachMatchIn (CapSet::const_iterator begin_r, CapSet::const_iterator end_r, const Capability &lhs_r, function< bool(const Capability &)> action_r)
 Algorithm invoking action_r on each CapSet entry that matches a given Capability.
int zypp::forEachMatchIn (const CapSet &capset_r, const Capability &lhs_r, function< bool(const Capability &)> action_r)
 Algorithm invoking action_r on each CapSet entry that matches a given Capability.
void zypp::forEachPoolItemMatchedBy (const ResPool &pool_r, const PoolItem &poolitem_r, const Dep &poolitemdep_r, function< bool(const CapAndItem &)> action_r)
 Find all items in a ResPool matched by a certain PoolItems dependency set.
void zypp::forEachPoolItemMatching (const ResPool &pool_r, const Dep &pooldep_r, const PoolItem &poolitem_r, function< bool(const CapAndItem &)> action_r)
 Find all items in a ResPool matching a certain PoolItem.
int zypp::ResPool::forEachMatchIn (const ResPool &pool_r, const Dep &dep_r, const Capability &lhs_r, function< bool(const CapAndItem &)> action_r)
 Algorithm invoking action_r on each matching Capability in a ResPool.

Function Documentation

int zypp::forEachMatchIn ( CapSet::const_iterator  begin_r,
CapSet::const_iterator  end_r,
const Capability &  lhs_r,
function< bool(const Capability &)>  action_r 
) [inline]

Algorithm invoking action_r on each CapSet entry that matches a given Capability.

Definition at line 52 of file CapMatchHelper.h.

References zypp::Capability::index(), and zypp::invokeOnEach().

Referenced by zypp::ui::PatternExpander::Impl::expandInclude(), and zypp::ForEachMatchInPool::operator()().

int zypp::forEachMatchIn ( const CapSet &  capset_r,
const Capability &  lhs_r,
function< bool(const Capability &)>  action_r 
) [inline]

Algorithm invoking action_r on each CapSet entry that matches a given Capability.

Definition at line 66 of file CapMatchHelper.h.

References zypp::invokeOnEach().

void zypp::forEachPoolItemMatchedBy ( const ResPool &  pool_r,
const PoolItem &  poolitem_r,
const Dep &  poolitemdep_r,
function< bool(const CapAndItem &)>  action_r 
) [inline]

Find all items in a ResPool matched by a certain PoolItems dependency set.

Iterates poolitem_r->dep(poolitemdep_r) and invokes action_r on each item in pool_r, that provides a match.

 bool consume( const CapAndItem & cai_r );

 ResPool  _pool;
 PoolItem _pi;

 // Invoke consume on all PoolItems obsoleted by pi.
 forEachPoolItemMatchedBy( _pool, _pi, Dep::OBSOLETES, consume );

Note:
action_r is invoked for each matching Capability. So if the same PoolItem provides multiple matches, action_r refers to the same PoolItem multiple times. It may as well be that poolitem_r provides a matching Capability. Use OncePerPoolItem to compensate this if neccessary.

Definition at line 182 of file CapMatchHelper.h.

References zypp::Dep::PROVIDES.

Referenced by zypp::target::obsoleteMatchesFromStorage().

void zypp::forEachPoolItemMatching ( const ResPool &  pool_r,
const Dep &  pooldep_r,
const PoolItem &  poolitem_r,
function< bool(const CapAndItem &)>  action_r 
) [inline]

Find all items in a ResPool matching a certain PoolItem.

Iterates poolitem_r->dep(Dep::PROVIDES) and invoking action_r on each item in pool_r, that provides a match.

 bool consume( const CapAndItem & cai_r );

 ResPool  _pool;
 PoolItem _pi;

 // Invoke consume on all PoolItems obsoleting pi.
 forEachPoolItemMatching( _pool, Dep::OBSOLETES, _pi, consume );

Note:
action_r is invoked for each matching Capability. So if the same PoolItem provides multiple matches, action_r refers to the same PoolItem multiple times. It may as well be that poolitem_r provides a matching Capability. Use OncePerPoolItem to compensate this if neccessary.

Definition at line 213 of file CapMatchHelper.h.

References zypp::Dep::PROVIDES.

int forEachMatchIn ( const ResPool pool_r,
const Dep dep_r,
const Capability lhs_r,
function< bool(const CapAndItem &)>  action_r 
) [related, inherited]

Algorithm invoking action_r on each matching Capability in a ResPool.

 // Returns wheter willing to collect more items.
 bool consume( const CapAndItem & cai_r );

 ResPool    _pool;
 Capability _cap;
 // Invoke consume on all provides that match _cap
 forEachMatchIn( _pool, Dep::PROVIDES, _cap, consume );

See also:
ForEachMatchInPool

Definition at line 91 of file CapMatchHelper.h.

References zypp::ResPool::byCapabilityIndexBegin(), zypp::ResPool::byCapabilityIndexEnd(), zypp::Capability::index(), and zypp::invokeOnEach().


Generated on Tue Nov 28 16:49:35 2006 for zypp by  doxygen 1.5.0