Cupt
Classes | Public Types | Public Member Functions | List of all members
cupt::system::Resolver Class Referenceabstract

dependency problems resolver More...

#include <cupt/system/resolver.hpp>

Inheritance diagram for cupt::system::Resolver:
cupt::system::NativeResolver

Classes

struct  AutoRemovalReason
 reason: auto-removal More...
 
struct  ImplicitReason
 reason: implicitly changed by resolver More...
 
struct  Offer
 the result of resolver's work More...
 
struct  Reason
 base class for resolver decision reasons More...
 
struct  RelationExpressionReason
 reason: other version's dependency More...
 
struct  RequestImportance
 
struct  SuggestedPackage
 resolver's main solution item More...
 
struct  SynchronizationReason
 reason: source-synchronized with a related binary package More...
 
struct  UserAnswer
 user callback answer variants More...
 
struct  UserReason
 reason: asked by user More...
 

Public Types

typedef map< string, SuggestedPackageSuggestedPackages
 
typedef std::function< UserAnswer::Type(const Offer &) > CallbackType
 callback function type
 

Public Member Functions

void installVersion (const vector< const BinaryVersion * > &, const string &annotation=string(), RequestImportance importance=RequestImportance::Must)
 
void removeVersions (const vector< const BinaryVersion * > &, const string &annotation=string(), RequestImportance importance=RequestImportance::Must)
 
virtual void satisfyRelationExpression (const RelationExpression &, bool invert=false, const string &annotation=string(), RequestImportance importance=RequestImportance::Must, bool asAutomatic=false)=0
 
virtual void upgrade ()=0
 
virtual void setAutomaticallyInstalledFlag (const string &packageName, bool flagValue)=0
 
virtual bool resolve (CallbackType)=0
 perform a resolve computations More...
 
virtual ~Resolver ()
 destructor
 

Detailed Description

dependency problems resolver

This class provides the dependency problems resolver interface for system state modifications.

First, you call class methods to specify how would you want to modify the system, and then you finally call resolve to get a consistent package set(s) for specified modifications.

Member Typedef Documentation

◆ SuggestedPackages

suggested set of packages

Member Function Documentation

◆ installVersion()

void cupt::system::Resolver::installVersion ( const vector< const BinaryVersion * > &  ,
const string &  annotation = string(),
RequestImportance  importance = RequestImportance::Must 
)

Requests installation of one of the specific version(s). If more than one version is supplied, installing any of them will be enough to satisfy this request.

Parameters
annotationpassed to satisfyRelationExpression
importancepassed to satisfyRelationExpression

◆ removeVersions()

void cupt::system::Resolver::removeVersions ( const vector< const BinaryVersion * > &  ,
const string &  annotation = string(),
RequestImportance  importance = RequestImportance::Must 
)

Requests removal of all supplied versions.

Parameters
annotationpassed to satisfyRelationExpression
importancepassed to satisfyRelationExpression

◆ resolve()

virtual bool cupt::system::Resolver::resolve ( CallbackType  )
pure virtual

perform a resolve computations

Takes all requested data and tries to find the best valid set of packages which conforms to what was requested.

Returns
true if the solution was found and accepted by user, false otherwise

Implemented in cupt::system::NativeResolver.

◆ satisfyRelationExpression()

virtual void cupt::system::Resolver::satisfyRelationExpression ( const RelationExpression ,
bool  invert = false,
const string &  annotation = string(),
RequestImportance  importance = RequestImportance::Must,
bool  asAutomatic = false 
)
pure virtual

Requests that specified relation expression is satisfied.

Parameters
invertif set to true, unsatisfies the expression rather than satisfy it
annotationuser-friendly description of request; if empty, standard one will be generated
importancespecifies is the request mandatory, and if not, what is the penalty:
  • Must: request is mandatory;
  • Try: request is optional, penalty is the value of 'cupt::resolver::score::unsatisfied-try' option;
  • Wish: request is optiona, penalty is the value of 'cupt::resolver::score::unsatisfied-wish' option;
  • any other value: request is optional, penalty is the value itself.
asAutomaticif new packages are to be installed as a result of perfoming this request, their 'automaticallyInstalledFlag' will have the value of this parameter.

Implemented in cupt::system::NativeResolver.

◆ setAutomaticallyInstalledFlag()

virtual void cupt::system::Resolver::setAutomaticallyInstalledFlag ( const string &  packageName,
bool  flagValue 
)
pure virtual

Requests that if a solution will have the package packageName, its corresponding Offer::SuggestedPackage::automaticallyInstalledFlag will have the value of flagValue.

Implemented in cupt::system::NativeResolver.

◆ upgrade()

virtual void cupt::system::Resolver::upgrade ( )
pure virtual

Requests an upgrade of all installed packages (to their preferred version).

Implemented in cupt::system::NativeResolver.


The documentation for this class was generated from the following file: