Class | Satsolver::Pool |
In: |
satsolver.i
|
Parent: | Object |
The Pool contains information about solvables stored optimized for memory consumption and fast retrieval.
Solvables represent (RPM) packages and are grouped in repositories.
Solving of dependencies works on the Pool, usually with a distinguished repository of installed solvables.
Pool should be a Singleton, there is no actual need to have multiple pools.
Since a lot of objects back reference the Pool they belong to, the Pool desctructor is left as a no-op. In the rare case that one has to free memory allocated to a Pool, call discard and do not reference any objects (Repo, Solvable, Solver, …) originating from this Pool.
Add RPM database to Pool.
For chrooted RPM databases, pass the toplevel directory as parameter.
Returns a newly created Repository
Create a relation.
Equivalent to: Relation.new
Create an empty repository, optionally with a name.
This repository should then be populated with Solvables.
Equivalent to: Repo.new
There is no destructor defined for Pool since the pool pointer is mostly used implicitly (e.g. in Solvable or Solver) which cannot be reliably tracked in the bindings.
Deleting the Pool is seldomly needed anyways. Just call Pool::discard to explicitly free the pool. Just remember that Solvables originating from this Pool are invalidated.
Find solvable by name.
Optionally restrict search to a Repository.
This function is useful to detect if a Solvable exists at all. If multiple Solvables would match, this call returns any one of them. Use Pool.each_provider to interate over all matches.
Return the repository representing the installed solvables. Returns nil if installed= was not called before.
Obsolete uses provides
Obsolete dependencies usually match on package names only. Setting this flag will make obsoletes also match a provides.
Prepare the pool for solving.
After calling prepare, one must not add or remove Repositories or add/remove Solvables within a Repository.
Search for Solvable attributes
See Dataiterator for example code
Set the pool to an unprepared status.
You must run Pool.prepare before using a solver on this Pool.