22 #ifndef ZYPP_SOLVER_DETAIL_SAT_RESOLVER_H
23 #define ZYPP_SOLVER_DETAIL_SAT_RESOLVER_H
24 #ifndef ZYPP_USE_RESOLVER_INTERNALS
25 #error Do not directly include this file!
29 #include <solv/solver.h>
30 #include <solv/pool.h>
75 class SATResolver :
public base::ReferenceCounted,
private base::NonCopyable,
private sat::detail::PoolMember
85 PoolItemList _problem_items;
88 PoolItemList _items_to_install;
89 PoolItemList _items_to_remove;
90 PoolItemList _items_to_lock;
91 PoolItemList _items_to_keep;
94 PoolItemList _result_items_to_install;
95 PoolItemList _result_items_to_remove;
98 bool _allowdowngrade:1;
99 bool _allowarchchange:1;
100 bool _allowvendorchange:1;
101 bool _allowuninstall:1;
102 bool _updatesystem:1;
103 bool _noupdateprovide:1;
104 bool _dosplitprovides:1;
105 bool _onlyRequires:1;
106 bool _ignorealreadyrecommended:1;
108 bool _distupgrade_removeunsupported:1;
109 bool _dup_allowdowngrade:1;
113 bool _solveSrcPackages:1;
114 bool _cleandepsOnRemove:1;
118 std::string SATprobleminfoString (Id problem, std::string &detail, Id &ignoreId);
119 void resetItemTransaction (PoolItem item);
122 void solverInit(
const PoolItemList & weakItems);
131 void setSystemRequirements();
139 sat::Solvable mapSolvable (
const Id &
id);
140 PoolItem mapItem (
const PoolItem &item);
145 virtual ~SATResolver();
149 virtual std::ostream &
dumpOn( std::ostream & str )
const;
150 friend std::ostream&
operator<<(std::ostream& str,
const SATResolver & obj)
151 {
return obj.dumpOn (str); }
153 ResPool pool (
void)
const;
154 void setPool (
const ResPool & pool) { _pool = pool; }
159 const PoolItemList & weakItems,
160 const std::set<Repository> & upgradeRepos
164 const PoolItemList & weakItems
172 bool fixsystem ()
const {
return _fixsystem;}
173 void setFixsystem (
const bool fixsystem) { _fixsystem = fixsystem;}
175 bool ignorealreadyrecommended ()
const {
return _ignorealreadyrecommended;}
176 void setIgnorealreadyrecommended (
const bool ignorealreadyrecommended) { _ignorealreadyrecommended = ignorealreadyrecommended;}
178 bool distupgrade ()
const {
return _distupgrade;}
179 void setDistupgrade (
const bool distupgrade) { _distupgrade = distupgrade;}
181 bool distupgrade_removeunsupported ()
const {
return _distupgrade_removeunsupported;}
182 void setDistupgrade_removeunsupported (
const bool distupgrade_removeunsupported) { _distupgrade_removeunsupported = distupgrade_removeunsupported;}
184 bool allowdowngrade ()
const {
return _allowdowngrade;}
185 void setAllowdowngrade (
const bool allowdowngrade) { _allowdowngrade = allowdowngrade;}
187 bool allowarchchange ()
const {
return _allowarchchange;}
188 void setAllowarchchange (
const bool allowarchchange) { _allowarchchange = allowarchchange;}
190 bool allowvendorchange ()
const {
return _allowvendorchange;}
191 void setAllowvendorchange (
const bool allowvendorchange) { _allowvendorchange = allowvendorchange;}
193 bool allowuninstall ()
const {
return _allowuninstall;}
194 void setAllowuninstall (
const bool allowuninstall) { _allowuninstall = allowuninstall;}
196 bool updatesystem ()
const {
return _updatesystem;}
197 void setUpdatesystem (
const bool updatesystem) { _updatesystem = updatesystem;}
199 bool noupdateprovide ()
const {
return _noupdateprovide;}
200 void setNoupdateprovide (
const bool noupdateprovide) { _noupdateprovide = noupdateprovide;}
202 bool dosplitprovides ()
const {
return _dosplitprovides;}
203 void setDosplitprovides (
const bool dosplitprovides) { _dosplitprovides = dosplitprovides;}
205 bool onlyRequires ()
const {
return _onlyRequires;}
206 void setOnlyRequires (
const bool onlyRequires) { _onlyRequires = onlyRequires;}
208 bool solveSrcPackages()
const {
return _solveSrcPackages; }
209 void setSolveSrcPackages(
bool state_r ) { _solveSrcPackages = state_r; }
211 bool cleandepsOnRemove()
const {
return _cleandepsOnRemove; }
212 void setCleandepsOnRemove(
bool state_r ) { _cleandepsOnRemove = state_r; }
214 PoolItemList problematicUpdateItems(
void )
const {
return _problem_items; }
215 PoolItemList problematicUpdateItems() {
return _problem_items; }
217 PoolItemList resultItemsToInstall () {
return _result_items_to_install; }
218 PoolItemList resultItemsToRemove () {
return _result_items_to_remove; }
233 #endif // ZYPP_USE_RESOLVER_INTERNALS
234 #endif // ZYPP_SOLVER_DETAIL_SAT_RESOLVER_H
std::list< ProblemSolution_Ptr > ProblemSolutionList
::_Pool CPool
Wrapped libsolv C data type exposed as backdoor.
std::list< SolverQueueItem_Ptr > SolverQueueItemList
::_Solver CSolver
Wrapped libsolv C data type exposed as backdoor.
Queue StringQueue
Queue with String ids.
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
std::list< ResolverProblem_Ptr > ResolverProblemList
ostream & operator<<(ostream &os, const SolutionActionList &actionlist)
std::ostream & dumpOn(std::ostream &str, const Capability &obj)
std::unordered_set< Capability > CapabilitySet
::_Queue CQueue
Wrapped libsolv C data type exposed as backdoor.