apt 3.1.11 commandline package manager

Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
Solver Class Reference

## Classes
struct | Var
| Tagged union holding either a package, version, or nothing; representing the reason for installing something. More...
struct | Clause
| A single clause. More...
struct | Work
| A single work item. More...
struct | State
| The solver state. More...
struct | Solved
| A solved item. More...
struct | CompareProviders3

## Public Types
enum class | Decision : uint16_t { NONE , MUST , MUSTNOT }

## Public Member Functions
void | Push (Var var, Work work)
bool | Pop ()
void | UndoOne ()
bool | AddWork (Work &&work)
| Solver (pkgCache &Cache, pkgDepCache::Policy &Policy, EDSP::Request::Flags requestFlags)
bool | Assume (Var var, bool decision, const Clause *reason=nullptr)
bool | Enqueue (Var var, bool decision, const Clause *reason=nullptr)
bool | FromDepCache (pkgDepCache &depcache)
bool | ToDepCache (pkgDepCache &depcache) const
bool | Solve ()
std::string | WhyStr (Var reason) const
std::string | LongWhyStr (Var var, bool decision, const Clause *rclause, std::string prefix, std::unordered_set< Var > &seen) const
| Print a long reason string.

## Static Public Member Functions
static APT_PUBLIC std::string | InternalCliWhy (pkgDepCache &depcache, pkgCache::PkgIterator Pkg, bool decision)

## Friends
struct | std::hash< APT::Solver::Var >

## Constructor & Destructor Documentation

## ◆ Solver()

Solver | ( | pkgCache & | cache,
|  | pkgDepCache::Policy & | policy,
|  | EDSP::Request::Flags | requestFlags )

Todo
  DEDUP with pkgDepCache.

## Member Function Documentation

## ◆ LongWhyStr()

std::string LongWhyStr | ( | Var | var,
|  | bool | decision,
|  | const Clause * | rclause,
|  | std::string | prefix,
|  | std::unordered_set< Var > & | seen ) const

Print a long reason string.

Print a reason as to why rclause implies decision for the variable var.

Parameters

  var | The variable to print the reason for
  decision | The assumed decision to print the reason for (may be different from actual decision if rclause is specified)
  rclause | The clause that caused this variable to be marked (or would be marked)
  prefix | A prefix, for indentation purposes, as this is recursive
  seen | A set of seen objects such that the output does not repeat itself (not for safety, it is acyclic)

References LongWhyStr().

Referenced by LongWhyStr().

## ◆ Pop()

bool Pop | ( |  | ) |
| nodiscard

Todo
  We should just mark the entries as erased and only do a compaction

Todo
  There should be a reason!

References UndoOne().

## ◆ UndoOne()

void UndoOne | ( |  | ) |

Todo
  Add the undo handling here once we have watchers.

Referenced by Pop().

The documentation for this class was generated from the following files:

- apt-pkg/solver3.h
- apt-pkg/solver3.cc