pass initial status (installed/uninstalled) all way through
[platform/upstream/libzypp.git] / zypp / ZYpp.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file       zypp/ZYpp.h
10  *
11 */
12 #ifndef ZYPP_ZYPP_H
13 #define ZYPP_ZYPP_H
14
15 #include <iosfwd>
16
17 #include "zypp/base/ReferenceCounted.h"
18 #include "zypp/base/NonCopyable.h"
19 #include "zypp/base/PtrTypes.h"
20 #include "zypp/Target.h"
21
22 ///////////////////////////////////////////////////////////////////
23 namespace zypp
24 { /////////////////////////////////////////////////////////////////
25
26   namespace zypp_detail
27   {
28     class ZYppImpl;
29   }
30
31   class ZYppFactory;
32   class ResPool;
33   class ResStore;
34
35   ///////////////////////////////////////////////////////////////////
36   //
37   //    CLASS NAME : ZYpp
38   //
39   /** */
40   class ZYpp : public base::ReferenceCounted, private base::NonCopyable
41   {
42   public:
43
44     typedef intrusive_ptr<ZYpp>       Ptr;
45     typedef intrusive_ptr<const ZYpp> constPtr;
46
47   public:
48     /**  */
49     ResPool pool() const;
50     
51     void addResolvables (const ResStore& store, bool installed = false);
52
53     void removeResolvables (const ResStore& store);
54
55     /**
56      * \throws Exception
57      */
58     Target_Ptr target() const;
59
60     /**
61      * \throws Exception
62      */
63     void initTarget(const Pathname & root);
64
65     /**
66      * \throws Exception
67      */
68     void finishTarget();
69
70   protected:
71     /** Dtor */
72     virtual ~ZYpp();
73     /** Stream output */
74     virtual std::ostream & dumpOn( std::ostream & str ) const;
75   private:
76     /** Factory */
77     friend class ZYppFactory;
78     /** */
79     typedef zypp_detail::ZYppImpl Impl;
80     typedef shared_ptr<Impl>      Impl_Ptr;
81     /** Factory ctor */
82     explicit
83     ZYpp( const Impl_Ptr & impl_r );
84   private:
85     /** Pointer to implementation */
86     RW_pointer<Impl> _pimpl;
87   };
88   ///////////////////////////////////////////////////////////////////
89
90   /////////////////////////////////////////////////////////////////
91 } // namespace zypp
92 ///////////////////////////////////////////////////////////////////
93 #endif // ZYPP_ZYPP_H