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/solver/detail/Resolver.h"
00023 #include "zypp/solver/detail/SolverQueueItem.h"
00024 #include "zypp/ProblemTypes.h"
00025 
00027 namespace zypp
00028 { 
00029 
00030 
00032   //
00033   //    CLASS NAME : Resolver
00034   //
00043   class Resolver : public base::ReferenceCounted, private base::NonCopyable
00044   {
00045   public:
00046 
00048     Resolver( const ResPool & pool );
00050     virtual ~Resolver();
00051 
00060     bool verifySystem();
00061 
00062 
00077     bool resolvePool();
00078 
00079 
00097     bool resolveQueue( solver::detail::SolverQueueItemList & queue );
00098 
00099     /*
00100      * Undo solver changes done in resolvePool()
00101      * Throwing away all ignored dependencies.
00102      */
00103     void undo();
00104 
00105     /*
00106      * Resets solver information and verify option.
00107      */
00108     void reset();
00109 
00110 
00121     bool doUpgrade();
00122 
00132     void doUpdate( );
00133 
00141     std::list<PoolItem> problematicUpdateItems() const;
00142 
00148     ResolverProblemList problems();
00149 
00150 
00155     void applySolutions( const ProblemSolutionList & solutions );
00156 
00157 
00163     void setForceResolve( bool force );
00164     bool forceResolve() const;
00165 
00170     void setIgnoreAlreadyRecommended( bool yesno_r );
00171     bool ignoreAlreadyRecommended() const;
00172 
00178     void setOnlyRequires( bool yesno_r );
00179     void resetOnlyRequires(); // set back to default (described in zypp.conf)
00180     bool onlyRequires() const;
00181 
00185     bool upgradeMode() const;
00186 
00195     void setAllowVendorChange( bool yesno_r );
00196     void setDefaultAllowVendorChange(); // set back to default (in zypp.conf)
00197     bool allowVendorChange() const;
00198 
00204     void setSystemVerification( bool yesno_r );
00205     void setDefaultSystemVerification();
00206     bool systemVerification() const;
00207 
00217     void setSolveSrcPackages( bool yesno_r );
00218     void setDefaultSolveSrcPackages();
00219     bool solveSrcPackages() const;
00220 
00225     void setCleandepsOnRemove( bool yesno_r );
00226     void setDefaultCleandepsOnRemove(); // set back to default (in zypp.conf)
00227     bool cleandepsOnRemove() const;
00228 
00240     void addUpgradeRepo( Repository repo_r );
00241 
00245     bool upgradingRepo( Repository repo_r ) const;
00246 
00250     void removeUpgradeRepo( Repository repo_r );
00251 
00255     void removeUpgradeRepos();
00257 
00262     void addRequire( const Capability & capability );
00263 
00268     void addConflict( const Capability & capability );
00269 
00274     void removeRequire( const Capability & capability );
00275 
00280     void removeConflict( const Capability & capability );
00281 
00286     CapabilitySet getRequire() const;
00287 
00292     CapabilitySet getConflict() const;
00293 
00300     bool createSolverTestcase( const std::string & dumpPath = "/var/log/YaST2/solverTestcase", bool runSolver = true );
00301 
00316     solver::detail::ItemCapKindList isInstalledBy( const PoolItem & item );
00317 
00332     solver::detail::ItemCapKindList installs( const PoolItem & item );
00333 
00348     solver::detail::ItemCapKindList satifiedByInstalled( const PoolItem & item );
00349 
00350 
00365     solver::detail::ItemCapKindList installedSatisfied( const PoolItem & item );
00366 
00367 
00368   private:
00369     friend std::ostream & operator<<( std::ostream & str, const Resolver & obj );
00370 
00371     typedef solver::detail::Resolver Impl;
00372     zypp::RW_pointer<Impl,rw_pointer::Intrusive<Impl> > _pimpl;
00373   };
00375 
00377   std::ostream & operator<<( std::ostream & str, const Resolver & obj );
00378 
00380 } // namespace zypp
00382 #endif // ZYPP_RESOLVER_H
Generated on Fri Mar 2 09:45:53 2012 for libzypp by  doxygen 1.6.3