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

Dependency Class Reference

A Dependency encapsulates all the depedency atoms. More...

#include <dependency.h>

List of all members.

Public Member Functions

 Dependency ()
 Default Constructor.
 Dependency (DependencyStage passedStage)
 Constructor to set the stage.
 Dependency (PMString dependency, DependencyStage passedStage)
 Create the dependency using the traditional portage string.
bool operator== (Dependency param)
 The equality operator.
bool operator!= (Dependency param)
 The non equality operator.
void AddDependency (PMString dependency)
 Populate the packages with the dependencies detailed in dependency.
void ClearDependencies ()
 Clear all DependentPackage's.
bool SatisfyDependency (PackageVersion version)
 Check if the version satisfies the dependency.
bool SatisfyDependency (PMString packageString)
 Check if the package string satisfies the dependency.

Public Attributes

std::vector< DependentPackagepackages
 Only contains multiple packages for ||.
DependencyStage stage
 The stage the dependency has to be installed by.


Detailed Description

A Dependency is the class that wraps the traditionally thought of dependency. Details all of portage's dependencys, including || ( or ) dependencies and all other forms of dependency. Its worth noting that std::vector<DependentPackage> packages can only contain multiple DependentPackage's if an || dependency is used.


Constructor & Destructor Documentation

Dependency::Dependency  ) 
 

Default constructor - does nothing.

Dependency::Dependency DependencyStage  passedStage  ) 
 

Constructor that sets the stage.

Parameters:
passedStage The stage for this dependency.

Dependency::Dependency PMString  dependency,
DependencyStage  passedStage
 

Constructor that sets the packages up and sets the stage.

Parameters:
dependency The full portage atom for a dependency. This can include || ( package package ), although the || should be removed.
passedStage The stage for this dependency.


Member Function Documentation

void Dependency::AddDependency PMString  dependency  ) 
 

Adds a dependency, creates as many DependentPackages as needed, i.e. for || depends. Doesn't clear the vector of DependentPackages, so you can keep calling AddDependency() to add more.

Parameters:
dependency The atom to add as a dependency. Should not contain anything other than an atom.

void Dependency::ClearDependencies  ) 
 

Empty packages.

bool Dependency::operator!= Dependency  param  ) 
 

Non Equality operator.

Parameters:
param The Dependency to test against.
Returns:
true if the Dependencys are not equal.

bool Dependency::operator== Dependency  param  ) 
 

Equality operator.

Parameters:
param The Dependency to test against.
Returns:
true if the Dependencys are equal.

bool Dependency::SatisfyDependency PMString  packageString  ) 
 

Returns true if packageString satisfies the dependency.

Parameters:
packageString A portage style cat/name-version string to test.
Returns:
true if packageString satisfies this Dependency.
Exceptions:
PortageException(eBadVersionCompare,version1 version2) if there is a bug in version compare.
PortageException(eEmptyVersionCompare). 

bool Dependency::SatisfyDependency PackageVersion  version  ) 
 

Returns true if version satisfies the dependency.

Parameters:
version The PackageVersion to be tested.
Returns:
true if version satisfies this Dependency.
Exceptions:
PortageException(eBadVersionCompare,version1 version2) if there is a bug in version compare.
PortageException(eEmptyVersionCompare). 


The documentation for this class was generated from the following files:
Generated on Wed May 25 15:29:54 2005 for Package Management System for Gentoo Linux by  doxygen 1.4.1