4 #error "This file must be compiled as C++." 7 #include <arbiter/Resolver.h> 15 #include <unordered_map> 23 ArbiterResolver (ArbiterResolverBehaviors behaviors, ArbiterDependencyList dependencyList, std::shared_ptr<
const void> context)
25 , _behaviors(std::move(behaviors))
26 , _dependencyList
(std::move(dependencyList)
) 28 assert(_behaviors.createDependencyList);
29 assert(_behaviors.createAvailableVersionsList);
33 ArbiterResolver &
operator= (
const ArbiterResolver &) =
delete;
40 ArbiterDependencyList
fetchDependencies (
const ArbiterProjectIdentifier &project,
const ArbiterSelectedVersion &version) noexcept(
false);
47 ArbiterSelectedVersionList
fetchAvailableVersions (
const ArbiterProjectIdentifier &project) noexcept(
false);
60 std::vector<ArbiterSelectedVersion>
availableVersionsSatisfying (
const ArbiterProjectIdentifier &project,
const ArbiterRequirement &requirement) noexcept(
false);
65 ArbiterResolvedDependencyGraph
resolve () noexcept(
false);
68 std::ostream &
describe (std::ostream &os)
const override;
72 const ArbiterResolverBehaviors _behaviors;
73 const ArbiterDependencyList _dependencyList;
75 std::unordered_map<ArbiterResolvedDependency, ArbiterDependencyList> _cachedDependencies;
76 std::unordered_map<ArbiterProjectIdentifier, ArbiterSelectedVersionList> _cachedAvailableVersions;
ArbiterResolver(const ArbiterResolver &)=delete
auto makeIteratorRange(const Collection &collection)
Creates an IteratorRange encompassing the entirety of the given read-only collection.
ArbiterResolver(ArbiterResolverBehaviors behaviors, ArbiterDependencyList dependencyList, std::shared_ptr< const void > context)
std::ostream & describe(std::ostream &os) const override
Arbiter::Optional< ArbiterSelectedVersion > fetchSelectedVersionForMetadata(const Arbiter::SharedUserValue< ArbiterSelectedVersion > &metadata)
Fetches a selected version for the given metadata string.
ArbiterDependencyList fetchDependencies(const ArbiterProjectIdentifier &project, const ArbiterSelectedVersion &version) noexcept(false)
Fetches the list of dependencies for the given project and version.
ArbiterResolver & operator=(const ArbiterResolver &)=delete
std::vector< ArbiterSelectedVersion > availableVersionsSatisfying(const ArbiterProjectIdentifier &project, const ArbiterRequirement &requirement) noexcept(false)
Computes a list of available versions for the specified project which satisfy the given requirement...
ArbiterResolvedDependencyGraph resolve() noexcept(false)
Attempts to resolve all dependencies.
std::unique_ptr< Arbiter::Base > clone() const override
ArbiterDependencyList(const ArbiterDependencyList &)=default
bool operator==(const Arbiter::Base &other) const override
std::shared_ptr< const void > _context
ArbiterSelectedVersionList fetchAvailableVersions(const ArbiterProjectIdentifier &project) noexcept(false)
Fetches the list of available versions for the given project.
virtual std::unique_ptr< Base > clone() const =0