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< std::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 269 of file RpmDb.cc.


Constructor & Destructor Documentation

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

Definition at line 274 of file RpmDb.cc.


Member Function Documentation

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

Definition at line 275 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 280 of file RpmDb.cc.

References _index.

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

Definition at line 286 of file RpmDb.cc.

References _index, _list, name, and WAR.


Member Data Documentation

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

Definition at line 271 of file RpmDb.cc.

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

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

Definition at line 272 of file RpmDb.cc.

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

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

Definition at line 273 of file RpmDb.cc.

Referenced by 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 Thu Jul 6 00:07:35 2006 for zypp by  doxygen 1.4.6