zypp::target::rpm::RpmDb::Packages Class Reference

Helper class for RpmDb::getPackages() to build the list<Package::Ptr> returned. More...

List of all members.

Public Member Functions

 Packages ()
void clear ()
Package::Ptr lookup (const string &name_r) const
void buildIndex ()

Public Attributes

list< Package::Ptr_list
map< string,
Package::Ptr
_index
bool _valid


Detailed Description

Helper class for RpmDb::getPackages() to build the list<Package::Ptr> returned.

We have to assert, that there is a unique entry for every string.

In the first step we build the _list list which contains all packages (even those which are contained in multiple versions).

At the end buildIndex() is called to build the _index is created and points to the last installed versions of all packages. Operations changing the rpmdb content (install/remove package) should set _valid to false. The next call to RpmDb::getPackages() will then reread the the rpmdb.

Note that outside RpmDb::getPackages() _list and _index are always in sync. So you may use lookup(PkgName) to retrieve a specific Package::Ptr.

Definition at line 212 of file RpmDb.cc.


Constructor & Destructor Documentation

zypp::target::rpm::RpmDb::Packages::Packages (  )  [inline]

Definition at line 218 of file RpmDb.cc.


Member Function Documentation

void zypp::target::rpm::RpmDb::Packages::clear (  )  [inline]

Definition at line 220 of file RpmDb.cc.

References _index, _list, and _valid.

Referenced by zypp::target::rpm::RpmDb::closeDatabase(), and zypp::target::rpm::RpmDb::doGetPackages().

Package::Ptr zypp::target::rpm::RpmDb::Packages::lookup ( const string &  name_r  )  const [inline]

Definition at line 226 of file RpmDb.cc.

References _index.

Referenced by zypp::target::rpm::RpmDb::doGetPackages().

void zypp::target::rpm::RpmDb::Packages::buildIndex (  )  [inline]

Definition at line 233 of file RpmDb.cc.

References _index, _list, _valid, name, and WAR.

Referenced by zypp::target::rpm::RpmDb::doGetPackages().


Member Data Documentation

list<Package::Ptr> zypp::target::rpm::RpmDb::Packages::_list

Definition at line 215 of file RpmDb.cc.

Referenced by buildIndex(), clear(), and zypp::target::rpm::RpmDb::doGetPackages().

map<string,Package::Ptr> zypp::target::rpm::RpmDb::Packages::_index

Definition at line 216 of file RpmDb.cc.

Referenced by buildIndex(), clear(), and lookup().

bool zypp::target::rpm::RpmDb::Packages::_valid

Definition at line 217 of file RpmDb.cc.

Referenced by buildIndex(), clear(), zypp::target::rpm::RpmDb::doRebuildDatabase(), zypp::target::rpm::RpmDb::importPubkey(), zypp::target::rpm::RpmDb::modifyDatabase(), and zypp::target::rpm::RpmDb::packagesValid().


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