- public access to resolver
[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 #include "zypp/Resolver.h"
22
23 ///////////////////////////////////////////////////////////////////
24 namespace zypp
25 { /////////////////////////////////////////////////////////////////
26
27   namespace zypp_detail
28   {
29     class ZYppImpl;
30   }
31
32   class ZYppFactory;
33   class ResPool;
34   class SourceFeed_Ref;
35   class ResStore;
36
37   ///////////////////////////////////////////////////////////////////
38   //
39   //    CLASS NAME : ZYpp
40   //
41   /** */
42   class ZYpp : public base::ReferenceCounted, private base::NonCopyable
43   {
44   public:
45
46     typedef intrusive_ptr<ZYpp>       Ptr;
47     typedef intrusive_ptr<const ZYpp> constPtr;
48
49   public:
50
51     /**  */
52     SourceFeed_Ref sourceFeed() const;
53
54     /**  */
55     ResPool pool() const;
56
57     void addResolvables (const ResStore& store, bool installed = false);
58
59     void removeResolvables (const ResStore& store);
60
61     /**
62      * \throws Exception
63      */
64     Target_Ptr target() const;
65
66     /**
67      * \throws Exception
68      */
69     void initTarget(const Pathname & root);
70
71     /**
72      * \throws Exception
73      */
74     void finishTarget();
75     
76     /**
77      *
78      */
79     Resolver_Ptr resolver() const;
80
81   protected:
82     /** Dtor */
83     virtual ~ZYpp();
84     /** Stream output */
85     virtual std::ostream & dumpOn( std::ostream & str ) const;
86   private:
87     /** Factory */
88     friend class ZYppFactory;
89     /** */
90     typedef zypp_detail::ZYppImpl Impl;
91     typedef shared_ptr<Impl>      Impl_Ptr;
92     /** Factory ctor */
93     explicit
94     ZYpp( const Impl_Ptr & impl_r );
95   private:
96     /** Pointer to implementation */
97     RW_pointer<Impl> _pimpl;
98   };
99   ///////////////////////////////////////////////////////////////////
100
101   /////////////////////////////////////////////////////////////////
102 } // namespace zypp
103 ///////////////////////////////////////////////////////////////////
104 #endif // ZYPP_ZYPP_H