3 * Easy-to use interface to the ZYPP dependency resolver
5 * Author: Stefan Hundhammer <sh@suse.de>
9 #ifndef ZYPP_RESOLVERPROBLEM_H
10 #define ZYPP_RESOLVERPROBLEM_H
15 #include "zypp/base/ReferenceCounted.h"
16 #include "zypp/base/PtrTypes.h"
17 #include "zypp/Resolver.h"
18 #include "zypp/ProblemSolution.h"
20 /////////////////////////////////////////////////////////////////////////
22 { ///////////////////////////////////////////////////////////////////////
25 class ResolverProblem : public base::ReferenceCounted
31 * In particular, delete all members of _solutions.
40 Resolver_constPtr _resolver;
41 std::string _description;
43 ProblemSolutionList _solutions;
50 ResolverProblem( const std::string & description, const std::string & details );
57 // ---------------------------------- I/O
59 friend std::ostream& operator<<(std::ostream&, const ResolverProblem & problem);
61 // ---------------------------------- accessors
64 * Return a one-line description of the problem.
66 std::string description() const { return _description; }
69 * Return a (possibly muti-line) detailed description of the problem
70 * or an empty string if there are no useful details.
72 std::string details() const { return _details; }
75 * Return the possible solutions to this problem.
76 * All problems should have at least 2-3 (mutually exclusive) solutions:
78 * - Undo: Do not perform the offending transaction
79 * (do not install the package that had unsatisfied requirements,
80 * do not remove the package that would break other packages' requirements)
82 * - Remove referrers: Remove all packages that would break because
83 * they depend on the package that is requested to be removed
85 * - Ignore: Inject artificial "provides" for a missing requirement
86 * (pretend that requirement is satisfied)
88 ProblemSolutionList solutions() const;
91 * Return the parent dependency resolver.
93 Resolver_constPtr resolver() const { return _resolver; }
95 // ---------------------------------- methods
98 * Add a solution to this problem. This class takes over ownership of
99 * the problem and will delete it when neccessary.
101 void addSolution( ProblemSolution_Ptr solution );
104 ///////////////////////////////////////////////////////////////////////
106 /////////////////////////////////////////////////////////////////////////
108 #endif // ZYPP_RESOLVERPROBLEM_H