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

Functor translating CapAndItem actions into PoolItem actions avoiding multiple invocations for the same PoolItem. More...

#include <CapMatchHelper.h>

List of all members.

Public Types

typedef function
< bool(const
PoolItem &)> 
Action

Public Member Functions

 OncePerPoolItem (const PoolItem &self_r=PoolItem())
 OncePerPoolItem (const Action &action_r, const PoolItem &self_r=PoolItem())
bool operator() (const CapAndItem &cai_r) const
const std::set
< PoolItem > & 
collectedItems () const

Private Attributes

Action _action
PoolItem _self
shared_ptr< std::set
< PoolItem > > 
_uset


Detailed Description

Functor translating CapAndItem actions into PoolItem actions avoiding multiple invocations for the same PoolItem.

Additionally you may omit invocation of action_r for a specific PoolItem.

Even if no _action is given, the PoolItems that would have been processed are collected in a std::set, available via collectedItems.

 bool consume( const CapAndItem & cai_r );
 bool consumePi( const PoolItem & pi_r );

 ResPool  _pool;
 PoolItem _pi;

 // Invoke consume on all PoolItems obsoleted by pi.
 // Once for each matching Capability, thus the same PoolItem
 // might be involved mutiple times.
 forEachPoolItemMatchedBy( _pool, _pi, Dep::OBSOLETES,
                           consume );

 // Invoke consume on all PoolItems obsoleted by pi.
 // Once for each PoolItem, still including _pi in case
 // it provides a match by itself.
 forEachPoolItemMatchedBy( _pool, _pi, Dep::OBSOLETES,
                           OncePerPoolItem( consumePi ) );

 // Invoke consume on all PoolItems obsoleted by pi.
 // Once for each PoolItem, omitting invokation for
 // _pi (in case it obsoletes itself).
 forEachPoolItemMatchedBy( _pool, _pi, Dep::OBSOLETES,
                           OncePerPoolItem( consumePi, _pi ) );

Definition at line 332 of file CapMatchHelper.h.


Member Typedef Documentation

typedef function<bool(const PoolItem &)> zypp::OncePerPoolItem::Action

Definition at line 335 of file CapMatchHelper.h.


Constructor & Destructor Documentation

zypp::OncePerPoolItem::OncePerPoolItem ( const PoolItem self_r = PoolItem()  )  [inline, explicit]

Definition at line 339 of file CapMatchHelper.h.

zypp::OncePerPoolItem::OncePerPoolItem ( const Action action_r,
const PoolItem self_r = PoolItem() 
) [inline]

Definition at line 344 of file CapMatchHelper.h.


Member Function Documentation

bool zypp::OncePerPoolItem::operator() ( const CapAndItem cai_r  )  const [inline]

Definition at line 351 of file CapMatchHelper.h.

References _action, _self, _uset, and zypp::CapAndItem::item.

const std::set<PoolItem>& zypp::OncePerPoolItem::collectedItems (  )  const [inline]

Definition at line 364 of file CapMatchHelper.h.

References _uset.


Member Data Documentation

Action zypp::OncePerPoolItem::_action [private]

Definition at line 368 of file CapMatchHelper.h.

Referenced by operator()().

PoolItem zypp::OncePerPoolItem::_self [private]

Definition at line 369 of file CapMatchHelper.h.

Referenced by operator()().

shared_ptr<std::set<PoolItem> > zypp::OncePerPoolItem::_uset [private]

Definition at line 370 of file CapMatchHelper.h.

Referenced by collectedItems(), and operator()().


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