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/ProblemSolution.h"
19 /////////////////////////////////////////////////////////////////////////
21 { ///////////////////////////////////////////////////////////////////////
24 class ResolverProblem : public base::ReferenceCounted
30 * In particular, delete all members of _solutions.
39 Resolver_constPtr _resolver;
40 std::string _description;
42 ProblemSolutionList _solutions;
49 ResolverProblem( const std::string & description, const std::string & details );
56 // ---------------------------------- I/O
58 friend std::ostream& operator<<(std::ostream&, const ResolverProblem & problem);
60 // ---------------------------------- accessors
63 * Return a one-line description of the problem.
65 std::string description() const { return _description; }
68 * Return a (possibly muti-line) detailed description of the problem
69 * or an empty string if there are no useful details.
71 std::string details() const { return _details; }
74 * Set description of the problem.
76 void setDescription(const std::string & description)
77 { _description=description; }
80 * Set detail description of the problem.
82 void setDetails(const std::string & detail)
86 * Return the possible solutions to this problem.
87 * All problems should have at least 2-3 (mutually exclusive) solutions:
89 * - Undo: Do not perform the offending transaction
90 * (do not install the package that had unsatisfied requirements,
91 * do not remove the package that would break other packages' requirements)
93 * - Remove referrers: Remove all packages that would break because
94 * they depend on the package that is requested to be removed
96 * - Ignore: Inject artificial "provides" for a missing requirement
97 * (pretend that requirement is satisfied)
99 ProblemSolutionList solutions() const;
102 * Return the parent dependency resolver.
104 Resolver_constPtr resolver() const { return _resolver; }
106 // ---------------------------------- methods
109 * Add a solution to this problem. This class takes over ownership of
110 * the problem and will delete it when neccessary.
112 void addSolution( ProblemSolution_Ptr solution, bool inFront = false );
115 ///////////////////////////////////////////////////////////////////////
117 /////////////////////////////////////////////////////////////////////////
119 #endif // ZYPP_RESOLVERPROBLEM_H