Find matching Capabilities.
[Algorithms]


Namespaces

namespace  zypp::capmatch_detail

Classes

class  zypp::ForEachMatchInCapSet
 Functor invoking action_r on each matching Capability in a CapSet. More...
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.
int zypp::forEachMatchIn (const CapSet &lhs_r, const CapSet &rhs_r, function< bool(const Capability &, const Capability &)> action_r)
 Invoke action_r on each matching pair of Capabilities within two CapSets.
bool zypp::hasMatches (const CapSet &lhs_r, const Capability &rhs_r)
 Return true if the CapSet contains at least one Capabilitiy that matches.
bool zypp::hasMatches (const CapSet &lhs_r, const CapSet &rhs_r)
 Return true if the CapSets contain at least one pair of Capabilities that match.
int 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.
int 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(), zypp::hasMatches(), zypp::locks::AddLockToPool::operator()(), zypp::ForEachMatchInPool::operator()(), and zypp::ForEachMatchInCapSet::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().

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

Invoke action_r on each matching pair of Capabilities within two CapSets.

Definition at line 135 of file CapMatchHelper.h.

References zypp::invokeOnEach().

bool zypp::hasMatches ( const CapSet &  lhs_r,
const Capability &  rhs_r 
) [inline]

Return true if the CapSet contains at least one Capabilitiy that matches.

Definition at line 157 of file CapMatchHelper.h.

References zypp::forEachMatchIn().

Referenced by zypp::detail::PatchImplIf::all_atoms(), and zypp::solver::detail::QueueItemInstall::process().

bool zypp::hasMatches ( const CapSet &  lhs_r,
const CapSet &  rhs_r 
) [inline]

Return true if the CapSets contain at least one pair of Capabilities that match.

Definition at line 165 of file CapMatchHelper.h.

References zypp::forEachMatchIn().

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

References zypp::invokeOnEach(), and zypp::Dep::PROVIDES.

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

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

References zypp::invokeOnEach(), and 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 Sep 25 19:23:12 2007 for libzypp by  doxygen 1.5.3