00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00012 #ifndef ZYPP_RESOLVER_H 00013 #define ZYPP_RESOLVER_H 00014 00015 #include <iosfwd> 00016 #include <functional> 00017 00018 #include "zypp/base/ReferenceCounted.h" 00019 #include "zypp/base/PtrTypes.h" 00020 00021 #include "zypp/ResPool.h" 00022 #include "zypp/UpgradeStatistics.h" 00023 #include "zypp/solver/detail/Resolver.h" 00024 #include "zypp/solver/detail/ResolverContext.h" 00025 #include "zypp/ProblemTypes.h" 00026 00028 namespace zypp 00029 { 00030 00031 00032 00034 // 00035 // CLASS NAME : Resolver 00036 // 00039 class Resolver : public base::ReferenceCounted, private base::NonCopyable 00040 { 00041 public: 00042 00044 Resolver( const ResPool & pool ); 00046 virtual ~Resolver(); 00047 00054 bool verifySystem (); 00055 00064 bool verifySystem (bool considerNewHardware); 00065 00080 bool establishPool (void); 00081 00095 bool freshenPool (void); 00096 00113 bool resolvePool (void); 00114 00130 bool resolvePool (bool tryAllPossibilities); 00131 00132 bool resolveDependencies( void ); 00133 00134 /* 00135 * Undo solver changes done in resolvePool() 00136 * Throwing away all ignored dependencies. 00137 */ 00138 void undo( void ); 00139 00140 /* 00141 * Get the most recent resolver context 00142 * 00143 * It will be NULL if resolvePool() or establishPool() was never called. 00144 * Depending on the return code of the last resolvePool() call, 00145 * it _either_ points to a valid or an invalid solution. 00146 */ 00147 solver::detail::ResolverContext_Ptr context (void) const; 00148 00162 void doUpgrade( UpgradeStatistics & opt_stats_r ); 00163 00168 std::list<PoolItem_Ref> problematicUpdateItems( void ) const; 00169 00175 ResolverProblemList problems(); 00176 00181 std::list<std::string> problemDescription( void ) const; 00182 00187 void applySolutions( const ProblemSolutionList & solutions ); 00188 00189 Arch architecture() const; 00190 void setArchitecture( const Arch & arch); 00191 00197 void setForceResolve (const bool force); 00198 const bool forceResolve(); 00199 00204 void setPreferHighestVersion (const bool highestVersion); 00205 const bool preferHighestVersion(); 00206 00217 bool transactResObject( ResObject::constPtr robj, bool install = true); 00218 00229 bool transactResKind( Resolvable::Kind kind ); 00230 00239 void transactReset( ResStatus::TransactByValue causer ); 00240 00245 void addRequire (const Capability & capability); 00246 00251 void addConflict (const Capability & capability); 00252 00260 void setTimeout( int seconds ); 00261 00266 int timeout(); 00267 00275 void setMaxSolverPasses (int count); 00276 00281 int maxSolverPasses (); 00282 00289 bool createSolverTestcase (const std::string & dumpPath = "/var/log/YaST2/solverTestcase"); 00290 00291 00304 const solver::detail::ItemCapKindList isInstalledBy (const PoolItem_Ref item); 00305 00318 const solver::detail::ItemCapKindList installs (const PoolItem_Ref item); 00319 00320 00321 protected: 00322 00323 private: 00324 solver::detail::Resolver_Ptr _pimpl; 00325 }; 00327 00329 } // namespace zypp 00331 #endif // ZYPP_RESOLVER_H
1.5.3