00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00012 #include <iostream> 00013 00014 #include "zypp/Resolver.h" 00015 #include "zypp/UpgradeStatistics.h" 00016 #include "zypp/solver/detail/Resolver.h" 00017 #include "zypp/solver/detail/Testcase.h" 00018 00019 using namespace std; 00020 00022 namespace zypp 00023 { 00024 00025 IMPL_PTR_TYPE(Resolver); 00026 #if 0 00027 Resolver_Ptr Resolver::_resolver = NULL; 00028 Resolver_Ptr Resolver::resolver() 00029 { 00030 if (_resolver == NULL) { 00031 _resolver = new Resolver(); 00032 } 00033 return _resolver; 00034 } 00035 #endif 00036 00037 // 00038 // METHOD NAME : Resolver::Resolver 00039 // METHOD TYPE : Ctor 00040 // 00041 Resolver::Resolver( const ResPool & pool ) 00042 { 00043 _pimpl = new solver::detail::Resolver(pool); 00044 } 00045 00047 // 00048 // METHOD NAME : Resolver::~Resolver 00049 // METHOD TYPE : Dtor 00050 // 00051 Resolver::~Resolver() 00052 {} 00053 00055 // 00056 // Resolver interface forwarded to implementation 00057 // 00059 bool Resolver::verifySystem () 00060 { return _pimpl->verifySystem(false); } 00061 bool Resolver::verifySystem (bool considerNewHardware) 00062 { return _pimpl->verifySystem(considerNewHardware); } 00063 bool Resolver::establishPool () 00064 { return _pimpl->establishPool(); } 00065 bool Resolver::freshenPool () 00066 { return _pimpl->freshenPool(); } 00067 bool Resolver::resolvePool () 00068 { return _pimpl->resolvePool( false ); }// do not try all possibilities 00069 bool Resolver::resolvePool( bool tryAllPossibilities ) 00070 { return _pimpl->resolvePool( tryAllPossibilities ); } 00071 void Resolver::undo() 00072 { _pimpl->undo(); } 00073 solver::detail::ResolverContext_Ptr Resolver::context (void) const 00074 { return _pimpl->context(); } 00075 ResolverProblemList Resolver::problems () 00076 { return _pimpl->problems (); } 00077 std::list<std::string> Resolver::problemDescription( void ) const 00078 { return _pimpl->problemDescription (); } 00079 void Resolver::applySolutions( const ProblemSolutionList & solutions ) 00080 { _pimpl->applySolutions (solutions); } 00081 void Resolver::doUpgrade( UpgradeStatistics & opt_stats_r ) 00082 { _pimpl->doUpgrade(opt_stats_r); } 00083 Arch Resolver::architecture() const 00084 { return _pimpl->architecture(); } 00085 void Resolver::setArchitecture( const Arch & arch ) 00086 { _pimpl->setArchitecture( arch ); } 00087 void Resolver::setForceResolve( const bool force ) 00088 { _pimpl->setForceResolve( force ); } 00089 const bool Resolver::forceResolve() 00090 { return _pimpl->forceResolve(); } 00091 void Resolver::setPreferHighestVersion( const bool highestVersion ) 00092 { _pimpl->setPreferHighestVersion( highestVersion ); } 00093 const bool Resolver::preferHighestVersion() 00094 { return _pimpl->preferHighestVersion(); } 00095 bool Resolver::transactResObject( ResObject::constPtr robj, bool install) 00096 { return _pimpl->transactResObject( robj, install ); } 00097 bool Resolver::transactResKind( Resolvable::Kind kind ) 00098 { return _pimpl->transactResKind( kind ); } 00099 void Resolver::transactReset( ResStatus::TransactByValue causer ) 00100 { _pimpl->transactReset( causer ); } 00101 std::list<PoolItem_Ref> Resolver::problematicUpdateItems( void ) const 00102 { return _pimpl->problematicUpdateItems(); } 00103 void Resolver::setTimeout( int seconds ) 00104 { _pimpl->setTimeout( seconds ); } 00105 void Resolver::setMaxSolverPasses (int count) 00106 { _pimpl->setMaxSolverPasses( count ); } 00107 int Resolver::timeout() 00108 { return _pimpl->timeout(); } 00109 int Resolver::maxSolverPasses() 00110 { return _pimpl->maxSolverPasses(); } 00111 bool Resolver::createSolverTestcase (const std::string & dumpPath) 00112 { solver::detail::Testcase testcase (dumpPath); 00113 return testcase.createTestcase(*_pimpl);} 00114 00116 } // namespace zypp
1.4.6