Resolver.h

Go to the documentation of this file.
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 
00133     /*
00134      * Undo solver changes done in resolvePool()
00135      * Throwing away all ignored dependencies.
00136      */
00137     void undo( void );
00138 
00139     /*
00140      * Get the most recent resolver context
00141      *
00142      * It will be NULL if resolvePool() or establishPool() was never called.
00143      * Depending on the return code of the last resolvePool() call,
00144      * it _either_ points to a valid or an invalid solution.
00145      */
00146     solver::detail::ResolverContext_Ptr context (void) const;
00147 
00161     void doUpgrade( UpgradeStatistics & opt_stats_r );
00162 
00167     std::list<PoolItem_Ref> problematicUpdateItems( void ) const;
00168 
00174     ResolverProblemList problems();
00175 
00180     std::list<std::string> problemDescription( void ) const;      
00181 
00186     void applySolutions( const ProblemSolutionList & solutions );
00187 
00188     Arch architecture() const;
00189     void setArchitecture( const Arch & arch);
00190 
00196     void setForceResolve (const bool force);
00197     const bool forceResolve();
00198 
00203     void setPreferHighestVersion (const bool highestVersion);
00204     const bool preferHighestVersion();      
00205 
00216     bool transactResObject( ResObject::constPtr robj, bool install = true);
00217 
00228     bool transactResKind( Resolvable::Kind kind );
00229 
00238     void transactReset( ResStatus::TransactByValue causer );
00239 
00247     void setTimeout( int seconds );
00248 
00253     int timeout();      
00254 
00262     void setMaxSolverPasses (int count);
00263 
00268     int maxSolverPasses ();
00269 
00275     bool createSolverTestcase (const std::string & dumpPath = "/var/log/YaST2/solverTestcase");      
00276 
00277   protected:
00278 
00279   private:
00280     solver::detail::Resolver_Ptr _pimpl;
00281   };
00283 
00285 } // namespace zypp
00287 #endif // ZYPP_RESOLVER_H

Generated on Thu Apr 24 02:24:51 2008 for zypp by  doxygen 1.4.6