Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

PkgSet Class Reference

#include <PkgSet.h>

List of all members.

Public Types

typedef std::map< PkgName,
PMSolvablePtr > 
PkgList_type
typedef PkgList_type::iterator iterator
typedef PkgList_type::const_iterator const_iterator
typedef std::list< PkgRevRelationRevRelList_type
typedef RevRelList_type::iterator RevRelList_iterator
typedef RevRelList_type::const_iterator RevRelList_const_iterator
typedef std::map< PkgName,
RevRelList_type
InvRel_type
typedef InvRel_type::iterator InvRel_iterator
typedef InvRel_type::const_iterator InvRel_const_iterator
typedef PMSolvable::PkgRelList_type &(* getAdditionalProvides_callback )(constPMSolvablePtr ptr)
typedef std::list< constPMSolvablePtr > SolvableList

Public Member Functions

 PkgSet ()
 ~PkgSet ()
bool empty () const
unsigned size () const
void add (PMSolvablePtr pkg, bool force=false)
void remove (PMSolvablePtr pkg)
void remove (PkgName name)
void new_provides (PMSolvablePtr pkg, const PkgRelation &prov)
PMSolvablePtr lookup (const PkgName &name) const
PMSolvablePtr operator[] (const PkgName &name) const
bool includes (const PkgName &name) const
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
const InvRel_typerequired () const
const InvRel_typeconflicted () const
const InvRel_typeprovided () const
const InvRel_typeobsoleted () const
 decl_InvRel_iterators (required) decl_InvRel_iterators(conflicted) decl_InvRel_iterators(provided) decl_InvRel_iterators(obsoleted) void setAdditionalProvidesCallback(getAdditionalProvides_callback callback)
getAdditionalProvides_callback AdditionalProvidesCallback () const
std::ostream & dumpOn (std::ostream &os)

Static Public Member Functions

const RevRelList_typegetRevRelforPkg (const InvRel_type &, const PkgName &)

Private Attributes

PkgList_type contents
InvRel_type _required
InvRel_type _conflicted
InvRel_type _provided
InvRel_type _obsoleted
getAdditionalProvides_callback _additionalprovides_callback


Detailed Description

A PkgSet represents an unordered collection of packages. This may be e.g. a set of currently installed packages, to be installed packages, or ones that are available for installation. A package name must be unique in a PkgSet, i.e. it is not possible to include more than one version of a package

Additionally to compounding packages, has one more important feature for dependency checking: It maintains reverse indices of all package relations. I.e., you can ask the set what packages (e.g.) require or provide a certain name. These reverse indices are the core of an efficient dependency and consistency checking.


Member Typedef Documentation

typedef PkgList_type::const_iterator PkgSet::const_iterator
 

typedef PMSolvable::PkgRelList_type&(* PkgSet::getAdditionalProvides_callback)( constPMSolvablePtr ptr )
 

typedef InvRel_type::const_iterator PkgSet::InvRel_const_iterator
 

typedef InvRel_type::iterator PkgSet::InvRel_iterator
 

typedef std::map<PkgName,RevRelList_type> PkgSet::InvRel_type
 

typedef PkgList_type::iterator PkgSet::iterator
 

typedef std::map<PkgName,PMSolvablePtr> PkgSet::PkgList_type
 

typedef RevRelList_type::const_iterator PkgSet::RevRelList_const_iterator
 

typedef RevRelList_type::iterator PkgSet::RevRelList_iterator
 

typedef std::list<PkgRevRelation> PkgSet::RevRelList_type
 

typedef std::list<constPMSolvablePtr> PkgSet::SolvableList
 


Constructor & Destructor Documentation

PkgSet::PkgSet  ) 
 

PkgSet::~PkgSet  ) 
 


Member Function Documentation

void PkgSet::add PMSolvablePtr  pkg,
bool  force = false
 

Adds a package to the set. If force is false, the package is added only if no equal or newer edition is already member of the set. This is handy most of the time, but can be overridden by passing true as second parameter. Then pkg is always added, replacing a previous member of the set with the same name.

getAdditionalProvides_callback PkgSet::AdditionalProvidesCallback  )  const [inline]
 

return current callback

const_iterator PkgSet::begin  )  const [inline]
 

iterator PkgSet::begin  )  [inline]
 

const InvRel_type& PkgSet::conflicted  )  const [inline]
 

PkgSet::decl_InvRel_iterators required   )  [inline]
 

set callback function which is called when Packages are added to this set

std::ostream& PkgSet::dumpOn std::ostream &  os  ) 
 

bool PkgSet::empty  )  const
 

const_iterator PkgSet::end  )  const [inline]
 

iterator PkgSet::end  )  [inline]
 

const PkgSet::RevRelList_type & PkgSet::getRevRelforPkg const InvRel_type ,
const PkgName
[static]
 

bool PkgSet::includes const PkgName name  )  const
 

package contained in this set?

PMSolvablePtr PkgSet::lookup const PkgName name  )  const
 

look up a package by name

Returns:
NULL if package is not in set

void PkgSet::new_provides PMSolvablePtr  pkg,
const PkgRelation prov
 

const InvRel_type& PkgSet::obsoleted  )  const [inline]
 

PMSolvablePtr PkgSet::operator[] const PkgName name  )  const [inline]
 

const InvRel_type& PkgSet::provided  )  const [inline]
 

void PkgSet::remove PkgName  name  ) 
 

remove a package by name

void PkgSet::remove PMSolvablePtr  pkg  ) 
 

remove a package

Note: it does not matter if pkg is actually the pointer stored. The item to be deleted is identified by name.

const InvRel_type& PkgSet::required  )  const [inline]
 

The required, conflicted, provided and obsoleted methods return the reverse indices for packages relations. The returned value is a hash that can be indexed by a PkgName. For example, to learn the names of all packages that require foo:

PkgSet pset; // ... const PkgSet::RevRelList_type& requires_foo = getRevRelforPkg(pset.required(),PkgName("foo")); for( PkgSet::RevRelList_const_iterator p = requires_foo.begin(); p != requires_foo.end(); ++p ) { cout << *p->pkg()->name << endl; }

unsigned PkgSet::size  )  const
 


Member Data Documentation

getAdditionalProvides_callback PkgSet::_additionalprovides_callback [private]
 

InvRel_type PkgSet::_conflicted [private]
 

InvRel_type PkgSet::_obsoleted [private]
 

InvRel_type PkgSet::_provided [private]
 

InvRel_type PkgSet::_required [private]
 

PkgList_type PkgSet::contents [private]
 


The documentation for this class was generated from the following files:
Generated on Fri Nov 9 14:30:32 2007 for yast2-packagemanager by doxygen 1.3.6