1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/Resolver.h
12 #ifndef ZYPP_RESOLVER_H
13 #define ZYPP_RESOLVER_H
18 #include "zypp/base/ReferenceCounted.h"
19 #include "zypp/base/PtrTypes.h"
21 #include "zypp/ResPool.h"
22 #include "zypp/UpgradeStatistics.h"
23 #include "zypp/solver/detail/Resolver.h"
24 #include "zypp/solver/detail/ResolverContext.h"
25 #include "zypp/ProblemTypes.h"
27 ///////////////////////////////////////////////////////////////////
29 { /////////////////////////////////////////////////////////////////
33 ///////////////////////////////////////////////////////////////////
35 // CLASS NAME : Resolver
37 /** Resolver interface.
39 class Resolver : public base::ReferenceCounted, private base::NonCopyable
44 Resolver( const ResPool & pool );
49 * Resolve package dependencies:
51 * Verify consistency of system
54 bool verifySystem (void);
57 * Establish state of 'higher level' Resolvables in Pool
59 * Must be called when dealing with non-package resolvables,
60 * like Patches, Patterns, and Products
63 void establishPool (void);
66 * Resolve package dependencies:
68 * Try to execute all pending transactions (there may be more than
71 * Returns "true" on success (i.e., if there were no problems that
72 * need user interaction) and "false" if there were problems. In
73 * the latter case, use problems() and later applySolutions()
76 bool resolvePool (void);
79 * Get the most recent resolver context
81 * It will be NULL if resolvePool() or establishPool() was never called.
82 * Depending on the return code of the last resolvePool() call,
83 * it _either_ points to a valid or an invalid solution.
85 solver::detail::ResolverContext_Ptr context (void) const;
88 * Do an distribution upgrade
90 * This will run a full upgrade on the pool, taking all upgrade
91 * dependencies (provide/obsolete for package renames, split-
92 * provides, etc.) into account and actually removing installed
93 * packages if no upgrade exists.
95 * To be run with great caution. It basically brings your
96 * system 'back to start'.
97 * Quite helpful to get back to a 'sane state'. Quite disastrous
98 * since you'll loose all non-distribution packages
100 void doUpgrade( UpgradeStatistics & opt_stats_r );
103 * Return the dependency problems found by the last call to
104 * resolveDependencies(). If there were no problems, the returned
105 * list will be empty.
107 ResolverProblemList problems();
110 * Apply problem solutions. No more than one solution per problem
113 bool applySolutions( const ProblemSolutionList & solutions );
118 solver::detail::Resolver_Ptr _pimpl;
120 ///////////////////////////////////////////////////////////////////
122 /////////////////////////////////////////////////////////////////
124 ///////////////////////////////////////////////////////////////////
125 #endif // ZYPP_RESOLVER_H