Imported Upstream version 16.3.2
[platform/upstream/libzypp.git] / zypp / solver / detail / Testcase.h
index 7f1da3b..e0b99a0 100644 (file)
 
 #ifndef ZYPP_SOLVER_DETAIL_TESTCASE_H
 #define ZYPP_SOLVER_DETAIL_TESTCASE_H
+#ifndef ZYPP_USE_RESOLVER_INTERNALS
+#error Do not directly include this file!
+#else
 
-#include <iosfwd>
 #include <string>
-#include "zypp/base/ReferenceCounted.h"
-#include "zypp/base/NonCopyable.h"
-#include "zypp/base/PtrTypes.h"
-#include "zypp/solver/detail/Resolver.h"
-#include "zypp/Capabilities.h"
-#include "zypp/ResPool.h"
-#include "zypp/base/GzStream.h"
-#include "zypp/sat/Repo.h"
 
 /////////////////////////////////////////////////////////////////////////
 namespace zypp
@@ -34,115 +28,28 @@ namespace zypp
     namespace detail
     { ///////////////////////////////////////////////////////////////////
 
+      class Resolver;
 
-template<class T>
-std::string helixXML( const T &obj ); //undefined
+      ///////////////////////////////////////////////////////////////////
+      //
+      //       CLASS NAME : Testcase
+      /**
+       * Generating a testcase of the current pool and solver state.
+       **/
+      class Testcase
+      {
+       private:
+         std::string dumpPath; // Path of the generated testcase
 
-template<> 
-std::string helixXML( const Edition &edition );
+       public:
+         Testcase();
+         Testcase( const std::string & path );
+         ~Testcase();
 
-template<> 
-std::string helixXML( const Arch &arch );
+         bool createTestcase( Resolver & resolver, bool dumpPool = true, bool runSolver = true );
+      };
 
-template<> 
-std::string helixXML( const Capability &cap );
-
-template<> 
-std::string helixXML( const Capabilities &caps );
-
-template<> 
-std::string helixXML( const CapabilitySet &caps );
-
-template<> 
-std::string helixXML( const Dependencies &dep );
-       
-template<> 
-std::string helixXML( const PoolItem &item );
-
-
-///////////////////////////////////////////////////////////////////
-//
-//     CLASS NAME : HelixResolvable
-/**
- * Creates a file in helix format which includes all available
- * or installed packages,patches,selections.....
- **/
-class  HelixResolvable : public base::ReferenceCounted, private base::NonCopyable{
-
-  private:
-    std::string dumpFile; // Path of the generated testcase
-    ofgzstream *file;    
-
-  public:
-    HelixResolvable (const std::string & path);
-    ~HelixResolvable ();
-
-    void addResolvable (const PoolItem item);
-    std::string filename () { return dumpFile; }
-};
-
-DEFINE_PTR_TYPE(HelixResolvable);
-typedef std::map<sat::Repo, HelixResolvable_Ptr> RepositoryTable;
-
-///////////////////////////////////////////////////////////////////
-//
-//     CLASS NAME : HelixControl
-/**
- * Creates a file in helix format which contains all controll
- * action of a testcase ( file is known as *-test.xml)
- **/
-class  HelixControl {
-
-  private:
-    std::string dumpFile; // Path of the generated testcase
-    std::ofstream *file;
-
-  public:
-    HelixControl (const std::string & controlPath,
-                 const RepositoryTable & sourceTable,
-                 const Arch & systemArchitecture,
-                 const PoolItemList &languages,                  
-                 const std::string & systemPath = "solver-system.xml");
-    HelixControl ();    
-    ~HelixControl ();
-
-    void installResolvable (const ResObject::constPtr &resObject,
-                           const ResStatus &status);
-    void lockResolvable (const ResObject::constPtr &resObject,
-                        const ResStatus &status);
-    void keepResolvable (const ResObject::constPtr &resObject,
-                        const ResStatus &status);        
-    void deleteResolvable (const ResObject::constPtr &resObject,
-                          const ResStatus &status);
-    void addDependencies (const CapabilitySet &capRequire, const CapabilitySet &capConflict);
-    std::string filename () { return dumpFile; }
-};
-       
-
-
-       
-///////////////////////////////////////////////////////////////////
-//
-//     CLASS NAME : Testcase
-/**
- * Generating a testcase of the current pool and solver state
- **/
-class Testcase {
-
-  private:
-    std::string dumpPath; // Path of the generated testcase
-
-  public:
-    Testcase (const std::string & path);
-    Testcase ();    
-    ~Testcase ();
-
-    bool createTestcase (Resolver & resolver, bool dumpPool = true, bool runSolver = true);
-    bool createTestcasePool(const ResPool &pool);    
-};
-
-
-///////////////////////////////////////////////////////////////////
+      ///////////////////////////////////////////////////////////////////
     };// namespace detail
     /////////////////////////////////////////////////////////////////////
     /////////////////////////////////////////////////////////////////////
@@ -151,5 +58,5 @@ class Testcase {
   ///////////////////////////////////////////////////////////////////////
 };// namespace zypp
 /////////////////////////////////////////////////////////////////////////
-
+#endif // ZYPP_USE_RESOLVER_INTERNALS
 #endif // ZYPP_SOLVER_DETAIL_TESTCASE_H