1 #ifndef ARBITER_GRAPH_H 2 #define ARBITER_GRAPH_H 12 struct ArbiterProjectIdentifier;
14 struct ArbiterResolvedDependency;
15 struct ArbiterSelectedVersion;
21 typedef struct ArbiterResolvedDependencyGraph ArbiterResolvedDependencyGraph;
121 typedef struct ArbiterResolvedDependencyInstaller ArbiterResolvedDependencyInstaller;
bool ArbiterResolvedDependencyGraphAddRoot(ArbiterResolvedDependencyGraph *graph, const struct ArbiterResolvedDependency *node, const struct ArbiterRequirement *requirement, char **error)
Attempts to add a root node into the dependency graph, without making it inconsistent.
bool ArbiterResolvedDependencyGraphAddEdge(ArbiterResolvedDependencyGraph *graph, const struct ArbiterProjectIdentifier *dependent, const struct ArbiterResolvedDependency *dependency, const struct ArbiterRequirement *requirement, char **error)
Attempts to add an edge (dependency relationship) into the dependency graph, from dependent to depend...
void ArbiterResolvedDependencyGraphCopyAll(const ArbiterResolvedDependencyGraph *graph, struct ArbiterResolvedDependency **buffer)
Copies all of the resolved dependencies in the given graph into the C array buffer, which must have enough space to contain ArbiterResolvedDependencyGraphCount() elements.
const struct ArbiterSelectedVersion * ArbiterResolvedDependencyGraphProjectVersion(const ArbiterResolvedDependencyGraph *graph, const struct ArbiterProjectIdentifier *project)
Returns the version which was selected for the given project in the dependency graph, or NULL if the project is not part of the graph.
size_t ArbiterResolvedDependencyGraphCountDependencies(const ArbiterResolvedDependencyGraph *graph, const struct ArbiterProjectIdentifier *project)
Returns the number of dependencies that the given project has in the graph, or 0 if the project does ...
const struct ArbiterRequirement * ArbiterResolvedDependencyGraphProjectRequirement(const ArbiterResolvedDependencyGraph *graph, const struct ArbiterProjectIdentifier *project)
Returns the requirement which is attached to the given project in the dependency graph, or NULL if the project is not part of the graph.
size_t ArbiterResolvedDependencyInstallerCountInPhase(const ArbiterResolvedDependencyInstaller *installer, size_t phaseIndex)
Returns the number of resolved dependencies that exist within the given zero-based installer phase...
size_t ArbiterResolvedDependencyInstallerPhaseCount(const ArbiterResolvedDependencyInstaller *installer)
Returns the number of phases that the installer has, for use with ArbiterResolvedDependencyInstallerC...
ArbiterResolvedDependencyGraph * ArbiterResolvedDependencyGraphCreate(void)
Creates an empty resolved dependency graph.
ArbiterResolvedDependencyInstaller * ArbiterResolvedDependencyInstallerCreate(const ArbiterResolvedDependencyGraph *graph)
Creates an installer for the given resolved dependency graph.
virtual std::unique_ptr< ArbiterRequirement > intersect(const ArbiterRequirement &rhs) const =0
Attempts to create a requirement which expresses the intersection of this requirement and the given o...
void ArbiterResolvedDependencyGraphGetAllDependencies(const ArbiterResolvedDependencyGraph *graph, const struct ArbiterProjectIdentifier *project, const struct ArbiterProjectIdentifier **buffer)
Copies pointers to the projects representing the given project's dependencies into the C array buffer...
size_t ArbiterResolvedDependencyGraphCount(const ArbiterResolvedDependencyGraph *graph)
Returns the number of unique nodes in the given graph, for use with ArbiterResolvedDependencyGraphGet...
void ArbiterResolvedDependencyInstallerGetAllInPhase(const ArbiterResolvedDependencyInstaller *installer, size_t phaseIndex, const struct ArbiterResolvedDependency **buffer)
Copies pointers to the resolved dependencies which exist at the given zero-based installer phase into...