Class SolverRunBase
- Namespace
- ZeroInstall.Services.Solvers
- Assembly
- ZeroInstall.Services.dll
Common base class for representing a single run of a solver.
public abstract class SolverRunBase
- Inheritance
-
SolverRunBase
- Inherited Members
Remarks
This is intended to be used by private classes within ISolver implementations to hold state during a run of Solve(Requirements).
Constructors
SolverRunBase(Requirements, ISelectionCandidateProvider)
Common base class for representing a single run of a solver.
protected SolverRunBase(Requirements requirements, ISelectionCandidateProvider candidateProvider)
Parameters
requirementsRequirementsThe requirements to satisfy.
candidateProviderISelectionCandidateProviderGenerates SelectionCandidates for the solver to choose from.
Remarks
This is intended to be used by private classes within ISolver implementations to hold state during a run of Solve(Requirements).
Fields
CandidateProvider
Generates SelectionCandidates for the solver to choose from.
protected readonly ISelectionCandidateProvider CandidateProvider
Field Value
Selections
Used to iteratively construct the selections to be returned.
protected Selections Selections
Field Value
Methods
DemandsFor(Command, FeedUri)
Generates SolverDemands for the dependencies specified by a Command.
protected IEnumerable<SolverDemand> DemandsFor(Command command, FeedUri interfaceUri)
Parameters
commandCommandThe command to scan for dependencies.
interfaceUriFeedUriThe interface URI of the feed providing the command.
Returns
DemandsFor(ImplementationSelection, Requirements)
Generates SolverDemands for the dependencies specified by an ImplementationSelection.
protected IEnumerable<SolverDemand> DemandsFor(ImplementationSelection selection, Requirements requirements)
Parameters
selectionImplementationSelectionThe selection to scan for dependencies.
requirementsRequirementsRequirements to inherit into the demands.
Returns
Solve()
Provides Selections that satisfy the specified Requirements.
public Selections Solve()
Returns
- Selections
The selected ImplementationSelections.
Exceptions
- SolverException
The solver was unable to provide Selections that fulfill the Requirements.
TryFulfill(SolverDemand)
Tries to fulfill the specified solver demand. Adds the result to Selections if successful.
protected abstract bool TryFulfill(SolverDemand demand)
Parameters
demandSolverDemandThe demand to fulfill.
Returns
- bool
trueif the demand could be met,falseif not.