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/CapSet.h" 00023 00025 namespace zypp 00026 { 00027 00028 namespace solver 00029 { 00030 00031 namespace detail 00032 { 00033 00034 00035 template<class T> 00036 std::string helixXML( const T &obj ); //undefined 00037 00038 template<> 00039 std::string helixXML( const Edition &edition ); 00040 00041 template<> 00042 std::string helixXML( const Arch &arch ); 00043 00044 template<> 00045 std::string helixXML( const Capability &cap ); 00046 00047 template<> 00048 std::string helixXML( const CapSet &caps ); 00049 00050 template<> 00051 std::string helixXML( const Dependencies &dep ); 00052 00053 template<> 00054 std::string helixXML( const Resolvable::constPtr &resolvable ); 00055 00056 00058 // 00059 // CLASS NAME : HelixResolvable 00064 class HelixResolvable : public base::ReferenceCounted, private base::NonCopyable{ 00065 00066 private: 00067 std::string dumpFile; // Path of the generated testcase 00068 std::ofstream *file; 00069 00070 public: 00071 HelixResolvable (const std::string & path); 00072 ~HelixResolvable (); 00073 00074 void addResolvable (const Resolvable::constPtr &resolvable); 00075 std::string filename () { return dumpFile; } 00076 }; 00077 00078 DEFINE_PTR_TYPE(HelixResolvable); 00079 typedef std::map<Repository, HelixResolvable_Ptr> RepositoryTable; 00080 00082 // 00083 // CLASS NAME : HelixControl 00088 class HelixControl { 00089 00090 private: 00091 std::string dumpFile; // Path of the generated testcase 00092 std::ofstream *file; 00093 00094 public: 00095 HelixControl (const std::string & controlPath, 00096 const RepositoryTable & sourceTable, 00097 const Arch & systemArchitecture, 00098 const PoolItemList &languages, 00099 const std::string & systemPath = "solver-system.xml"); 00100 HelixControl (); 00101 ~HelixControl (); 00102 00103 void installResolvable (const ResObject::constPtr &resObject); 00104 void lockResolvable (const ResObject::constPtr &resObject); 00105 void deleteResolvable (const ResObject::constPtr &resObject); 00106 void addDependencies (const CapSet &capRequire, const CapSet &capConflict); 00107 std::string filename () { return dumpFile; } 00108 }; 00109 00110 00111 00112 00114 // 00115 // CLASS NAME : Testcase 00119 class Testcase { 00120 00121 private: 00122 std::string dumpPath; // Path of the generated testcase 00123 00124 public: 00125 Testcase (const std::string & path); 00126 Testcase (); 00127 ~Testcase (); 00128 00129 bool createTestcase (Resolver & resolver); 00130 00131 }; 00132 00133 00135 };// namespace detail 00138 };// namespace solver 00141 };// namespace zypp 00143 00144 #endif // ZYPP_SOLVER_DETAIL_TESTCASE_H
1.5.3