Class SolverUtils
- Namespace
- ZeroInstall.Services.Solvers
- Assembly
- ZeroInstall.Services.dll
Helper functions for ISolver implementations.
public static class SolverUtils
- Inheritance
-
SolverUtils
- Inherited Members
Methods
AddCommand(ImplementationSelection, Requirements, Implementation)
Adds a Command specified in an Implementation to a ImplementationSelection.
public static Command? AddCommand(this ImplementationSelection selection, Requirements requirements, Implementation from)
Parameters
selectionImplementationSelectionThe ImplementationSelection to add the Command to.
requirementsRequirementsThe requirements specifying which Command to extract.
fromImplementationThe Implementation to get the Command from.
Returns
AddDependencies(IDependencyContainer, Requirements, IDependencyContainer)
Transfers Dependencys from one IDependencyContainer to another.
public static void AddDependencies(this IDependencyContainer target, Requirements requirements, IDependencyContainer from)
Parameters
targetIDependencyContainerThe IDependencyContainer to add the Dependencys to.
requirementsRequirementsThe requirements which restrict which Dependencys are applicable.
fromIDependencyContainerThe IDependencyContainer to get the Dependencys to.
AddRestriction(Requirements, Restriction)
Adds the version restriction from source to the requirements.
public static void AddRestriction(this Requirements requirements, Restriction source)
Parameters
requirementsRequirementssourceRestriction
AddRestrictions(Requirements, Requirements)
Adds the version restrictions from source to the requirements.
public static void AddRestrictions(this Requirements requirements, Requirements source)
Parameters
requirementsRequirementssourceRequirements
BucketizeImportance(IEnumerable<SolverDemand>)
Separates solver demands into buckets by importance.
public static (List<SolverDemand> essential, List<SolverDemand> recommended) BucketizeImportance(this IEnumerable<SolverDemand> demands)
Parameters
demandsIEnumerable<SolverDemand>
Returns
PurgeRestrictions(Selections)
Removes all Restrictions from Selections.
public static void PurgeRestrictions(this Selections selections)
Parameters
selectionsSelections
ToSelection(SelectionCandidate, Requirements, IReadOnlyList<SelectionCandidate>)
Turns a SelectionCandidate into a ImplementationSelection.
public static ImplementationSelection ToSelection(this SelectionCandidate candidate, Requirements requirements, IReadOnlyList<SelectionCandidate> allCandidates)
Parameters
candidateSelectionCandidateThe selection candidate.
requirementsRequirementsThe requirements the candidate was chosen for.
allCandidatesIReadOnlyList<SelectionCandidate>All candidates that were considered for selection (including
candidate). These are used to present the user with possible alternatives.
Returns
ToSelections(IEnumerable<SelectionCandidate>, SolverDemand)
Turns SelectionCandidates into ImplementationSelections.
[LinqTunnel]
public static IEnumerable<ImplementationSelection> ToSelections(this IEnumerable<SelectionCandidate> candidates, SolverDemand demand)
Parameters
candidatesIEnumerable<SelectionCandidate>The selection candidates.
demandSolverDemandThe solver demand the candidates were chosen for.