Zero Install .NET API 2.20.0
ZeroInstall.Services.Solvers.SolverRunBase Class Referenceabstract

Common base class for representing a single run of a solver. More...

Public Member Functions

Selections Solve ()
 Provides Selections that satisfy the specified Requirements. More...
 

Protected Member Functions

 SolverRunBase (Requirements requirements, ISelectionCandidateProvider candidateProvider)
 Creates a new solver run. More...
 
bool TryFulfill (SolverDemand demand)
 Tries to fulfill the specified demand . Adds the result to Selections if successful. More...
 
abstract bool TryFulfill (SolverDemand demand, IEnumerable< SelectionCandidate > candidates)
 Tries to fulfill the specified solver demand. Adds the result to Selections if successful. More...
 
abstract bool TryFulfill (IEnumerable< SolverDemand > demands)
 Tries to fulfill the specified demands . Adds the results to Selections if successful. More...
 
IEnumerable< SolverDemandDemandsFor (ImplementationSelection selection, Requirements requirements)
 Generates SolverDemands for the dependencies specified by an ImplementationSelection. More...
 

Static Protected Member Functions

static List< SolverDemand > List< SolverDemand > recommended Bucketize (IEnumerable< SolverDemand > demands)
 

Protected Attributes

readonly ISelectionCandidateProvider CandidateProvider
 Generates SelectionCandidates for the solver to choose from.
 
Selections Selections
 Used to iteratively construct the selections to be returned.
 

Static Protected Attributes

static List< SolverDemandessential
 

Detailed Description

Common base class for representing a single run of a solver.

This is intended to be used by private classes within ISolver implementations to hold state during a run of ISolver.Solve.

Constructor & Destructor Documentation

◆ SolverRunBase()

ZeroInstall.Services.Solvers.SolverRunBase.SolverRunBase ( Requirements  requirements,
ISelectionCandidateProvider  candidateProvider 
)
inlineprotected

Creates a new solver run.

Parameters
requirementsThe requirements to satisfy.
candidateProviderGenerates SelectionCandidates for the solver to choose from.

Member Function Documentation

◆ DemandsFor()

IEnumerable< SolverDemand > ZeroInstall.Services.Solvers.SolverRunBase.DemandsFor ( ImplementationSelection  selection,
Requirements  requirements 
)
inlineprotected

Generates SolverDemands for the dependencies specified by an ImplementationSelection.

Parameters
selectionThe selection to scan for dependencies.
requirementsRequirements to inherit into the demands.

◆ Solve()

Selections ZeroInstall.Services.Solvers.SolverRunBase.Solve ( )
inline

Provides Selections that satisfy the specified Requirements.

Returns
The selected ImplementationSelections.
Exceptions
SolverExceptionThe solver was unable to provide Selections that fulfill the Requirements.

◆ TryFulfill() [1/3]

abstract bool ZeroInstall.Services.Solvers.SolverRunBase.TryFulfill ( IEnumerable< SolverDemand demands)
protectedpure virtual

Tries to fulfill the specified demands . Adds the results to Selections if successful.

Returns
true if all Importance.Essential demands could be met, false if not.

◆ TryFulfill() [2/3]

bool ZeroInstall.Services.Solvers.SolverRunBase.TryFulfill ( SolverDemand  demand)
inlineprotected

Tries to fulfill the specified demand . Adds the result to Selections if successful.

Returns
true if the demand could be met, false if not.

◆ TryFulfill() [3/3]

abstract bool ZeroInstall.Services.Solvers.SolverRunBase.TryFulfill ( SolverDemand  demand,
IEnumerable< SelectionCandidate candidates 
)
protectedpure virtual

Tries to fulfill the specified solver demand. Adds the result to Selections if successful.

Parameters
demandThe demand to fulfill.
candidatesThe candidates to consider for fulfilling the demand.
Returns
true if the demand could be met, false if not.

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