Testcase.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00013 #ifndef ZYPP_SOLVER_DETAIL_TESTCASE_H
00014 #define ZYPP_SOLVER_DETAIL_TESTCASE_H
00015 
00016 #include <iosfwd>
00017 #include <string>
00018 #include "zypp/base/ReferenceCounted.h"
00019 #include "zypp/base/NonCopyable.h"
00020 #include "zypp/base/PtrTypes.h"
00021 #include "zypp/solver/detail/Resolver.h"
00022 #include "zypp/Capabilities.h"
00023 #include "zypp/ResPool.h"
00024 #include "zypp/base/GzStream.h"
00025 #include "zypp/Repository.h"
00026 #include "zypp/Locale.h"
00027 
00029 namespace zypp
00030 { 
00031 
00032   namespace solver
00033   { 
00034 
00035     namespace detail
00036     { 
00037 
00038 
00039 template<class T>
00040 std::string helixXML( const T &obj ); //undefined
00041 
00042 template<>
00043 std::string helixXML( const Edition &edition );
00044 
00045 template<>
00046 std::string helixXML( const Arch &arch );
00047 
00048 template<>
00049 std::string helixXML( const Capability &cap );
00050 
00051 template<>
00052 std::string helixXML( const Capabilities &caps );
00053 
00054 template<>
00055 std::string helixXML( const CapabilitySet &caps );
00056 
00057 template<>
00058 std::string helixXML( const PoolItem &item );
00059 
00060 
00062 //
00063 //      CLASS NAME : HelixResolvable
00068 class  HelixResolvable : public base::ReferenceCounted, private base::NonCopyable{
00069 
00070   private:
00071     std::string dumpFile; // Path of the generated testcase
00072     ofgzstream *file;
00073 
00074   public:
00075     HelixResolvable (const std::string & path);
00076     ~HelixResolvable ();
00077 
00078     void addResolvable (const PoolItem item);
00079     std::string filename () { return dumpFile; }
00080 };
00081 
00082 DEFINE_PTR_TYPE(HelixResolvable);
00083 typedef std::map<Repository, HelixResolvable_Ptr> RepositoryTable;
00084 
00086 //
00087 //      CLASS NAME : HelixControl
00092 class  HelixControl {
00093 
00094   private:
00095     std::string dumpFile; // Path of the generated testcase
00096     std::ofstream *file;
00097 
00098   public:
00099     HelixControl (const std::string & controlPath,
00100                   const RepositoryTable & sourceTable,
00101                   const Arch & systemArchitecture,
00102                   const LocaleSet &languages,
00103                   const std::string & systemPath = "solver-system.xml.gz",
00104                   const bool forceResolve = false,
00105                   const bool onlyRequires = false,
00106                   const bool ignorealreadyrecommended = false);
00107     HelixControl ();
00108     ~HelixControl ();
00109 
00110     void installResolvable (const ResObject::constPtr &resObject,
00111                             const ResStatus &status);
00112     void lockResolvable (const ResObject::constPtr &resObject,
00113                          const ResStatus &status);
00114     void keepResolvable (const ResObject::constPtr &resObject,
00115                          const ResStatus &status);
00116     void deleteResolvable (const ResObject::constPtr &resObject,
00117                            const ResStatus &status);
00118     void addDependencies (const CapabilitySet &capRequire, const CapabilitySet &capConflict);
00119     void addUpgradeRepos( const std::set<Repository> & upgradeRepos_r );
00120 
00121     void distupgrade ();
00122     void verifySystem ();
00123     void update ();
00124 
00125     std::string filename () { return dumpFile; }
00126 };
00127 
00128 
00129 
00130 
00132 //
00133 //      CLASS NAME : Testcase
00137 class Testcase {
00138 
00139   private:
00140     std::string dumpPath; // Path of the generated testcase
00141 
00142   public:
00143     Testcase (const std::string & path);
00144     Testcase ();
00145     ~Testcase ();
00146 
00147     bool createTestcase (Resolver & resolver, bool dumpPool = true, bool runSolver = true);
00148     bool createTestcasePool(const ResPool &pool);
00149 };
00150 
00151 
00153     };// namespace detail
00156   };// namespace solver
00159 };// namespace zypp
00161 
00162 #endif // ZYPP_SOLVER_DETAIL_TESTCASE_H

doxygen