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 * Return the possible solutions to this problem.
75 * All problems should have at least 2-3 (mutually exclusive) solutions:
77 * - Undo: Do not perform the offending transaction
78 * (do not install the package that had unsatisfied requirements,
79 * do not remove the package that would break other packages' requirements)
81 * - Remove referrers: Remove all packages that would break because
82 * they depend on the package that is requested to be removed
84 * - Ignore: Inject artificial "provides" for a missing requirement
85 * (pretend that requirement is satisfied)
87 ProblemSolutionList solutions() const;
90 * Return the parent dependency resolver.
92 Resolver_constPtr resolver() const { return _resolver; }
94 // ---------------------------------- methods
97 * Add a solution to this problem. This class takes over ownership of
98 * the problem and will delete it when neccessary.
100 void addSolution( ProblemSolution_Ptr solution, bool inFront = false );
103 ///////////////////////////////////////////////////////////////////////
105 /////////////////////////////////////////////////////////////////////////
107 #endif // ZYPP_RESOLVERPROBLEM_H