libyui-qt-pkg  2.47.5
YQPkgSelMapper Class Reference

Mapping from ZyppPkg to the correspoinding ZyppSel. More...

#include <YQPkgSelMapper.h>

Collaboration diagram for YQPkgSelMapper:

Public Member Functions

 YQPkgSelMapper ()
 Constructor. More...
 
virtual ~YQPkgSelMapper ()
 Destructor. More...
 
ZyppSel findZyppSel (ZyppPkg pkg)
 Find the corresponding ZyppSel to a ZyppPkg. More...
 
void rebuildCache ()
 Rebuild the shared cache. More...
 

Static Public Member Functions

static int refCount ()
 Reference count - indicates how many instances of this class are alive right now.
 

Protected Types

typedef std::map< ZyppPkg, ZyppSel > Cache
 
typedef std::pair< ZyppPkg, ZyppSel > CachePair
 
typedef Cache::iterator CacheIterator
 

Static Protected Attributes

static int _refCount = 0
 
static Cache _cache
 

Detailed Description

Mapping from ZyppPkg to the correspoinding ZyppSel.

All instances of this class share the same cache. The cache remains alive as long as any instance of this class exists.

Definition at line 55 of file YQPkgSelMapper.h.

Constructor & Destructor Documentation

◆ YQPkgSelMapper()

YQPkgSelMapper::YQPkgSelMapper ( )

Constructor.

Builds a cache, if necessary.

Definition at line 52 of file YQPkgSelMapper.cc.

Here is the call graph for this function:

◆ ~YQPkgSelMapper()

YQPkgSelMapper::~YQPkgSelMapper ( )
virtual

Destructor.

Clears the cache if this was the last YQPkgSelMapper (i.e. if refCount() reaches 0)

Definition at line 59 of file YQPkgSelMapper.cc.

Member Function Documentation

◆ findZyppSel()

ZyppSel YQPkgSelMapper::findZyppSel ( ZyppPkg  pkg)

Find the corresponding ZyppSel to a ZyppPkg.

Returns 0 if there is no corresponding ZyppSel.

Definition at line 109 of file YQPkgSelMapper.cc.

◆ rebuildCache()

void YQPkgSelMapper::rebuildCache ( )

Rebuild the shared cache.

This is expensive. Call this only when the ZyppPool has changed, i.e. after installation sources were added or removed.

Since the cache is shared, this affects all instances of this class.

Definition at line 69 of file YQPkgSelMapper.cc.


The documentation for this class was generated from the following files: