Table of Contents

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

requirements Requirements

The requirements to satisfy.

candidateProvider ISelectionCandidateProvider

Generates 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

ISelectionCandidateProvider

Selections

Used to iteratively construct the selections to be returned.

protected Selections Selections

Field Value

Selections

Methods

DemandsFor(Command, FeedUri)

Generates SolverDemands for the dependencies specified by a Command.

protected IEnumerable<SolverDemand> DemandsFor(Command command, FeedUri interfaceUri)

Parameters

command Command

The command to scan for dependencies.

interfaceUri FeedUri

The interface URI of the feed providing the command.

Returns

IEnumerable<SolverDemand>

DemandsFor(ImplementationSelection, Requirements)

Generates SolverDemands for the dependencies specified by an ImplementationSelection.

protected IEnumerable<SolverDemand> DemandsFor(ImplementationSelection selection, Requirements requirements)

Parameters

selection ImplementationSelection

The selection to scan for dependencies.

requirements Requirements

Requirements to inherit into the demands.

Returns

IEnumerable<SolverDemand>

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

demand SolverDemand

The demand to fulfill.

Returns

bool

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