libyui-ncurses-pkg
Loading...
Searching...
No Matches
NCPkgSelMapper Class Reference

#include <NCPkgSelMapper.h>

Public Member Functions

 NCPkgSelMapper ()
virtual ~NCPkgSelMapper ()
ZyppSel findZyppSel (ZyppPkg pkg)
void rebuildCache ()

Static Public Member Functions

static int refCount ()

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.

Constructor & Destructor Documentation

◆ NCPkgSelMapper()

NCPkgSelMapper::NCPkgSelMapper ( )

Constructor. Builds a cache, if necessary.

◆ ~NCPkgSelMapper()

NCPkgSelMapper::~NCPkgSelMapper ( )
virtual

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

Member Function Documentation

◆ findZyppSel()

ZyppSel NCPkgSelMapper::findZyppSel ( ZyppPkg pkg)

Find the corresponding ZyppSel to a ZyppPkg. Returns 0 if there is no corresponding ZyppSel.

◆ rebuildCache()

void NCPkgSelMapper::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.

◆ refCount()

int NCPkgSelMapper::refCount ( )
inlinestatic

Reference count - indicates how many instances of this class are alive right now.


The documentation for this class was generated from the following files:
  • /builddir/build/BUILD/libyui-4.6.2-build/libyui-4.6.2/libyui-ncurses-pkg/src/NCPkgSelMapper.h
  • /builddir/build/BUILD/libyui-4.6.2-build/libyui-4.6.2/libyui-ncurses-pkg/src/NCPkgSelMapper.cc