backup
[platform/upstream/libzypp.git] / zypp / sat / Pool.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file       zypp/sat/Pool.h
10  *
11 */
12 #ifndef ZYPP_SAT_POOL_H
13 #define ZYPP_SAT_POOL_H
14
15 #include <iosfwd>
16
17 #include "zypp/base/PtrTypes.h"
18 #include "zypp/base/Iterator.h"
19
20 #include "zypp/AutoDispose.h"
21 #include "zypp/Pathname.h"
22
23 #include "zypp/sat/Repo.h"
24
25 ///////////////////////////////////////////////////////////////////
26 extern "C"
27 {
28 struct _Pool;
29 }
30 ///////////////////////////////////////////////////////////////////
31 namespace zypp
32 { /////////////////////////////////////////////////////////////////
33   ///////////////////////////////////////////////////////////////////
34   namespace sat
35   { /////////////////////////////////////////////////////////////////
36
37     ///////////////////////////////////////////////////////////////////
38     //
39     //  CLASS NAME : Pool
40     //
41     /** */
42     class Pool
43     {
44       public:
45         /** Default ctor */
46         Pool();
47         /** Dtor */
48         ~Pool();
49
50       public:
51         unsigned reposSize() const;
52         RepoIterator reposBegin() const;
53         RepoIterator reposEnd() const;
54
55         unsigned solvablesSize() const;
56         SolvableIterator solvablesBegin() const;
57         SolvableIterator solvablesEnd() const;
58
59         void t() const;
60
61       public:
62         Repo addRepoSolv( const Pathname & file_r );
63
64       private:
65         /** Explicitly shared sat-pool. */
66         AutoDispose< ::_Pool *> _raii;
67         /** Convenient access. */
68         ::_Pool & _pool;
69     };
70     ///////////////////////////////////////////////////////////////////
71
72     /** \relates Pool Stream output */
73     std::ostream & operator<<( std::ostream & str, const Pool & obj );
74
75     /////////////////////////////////////////////////////////////////
76   } // namespace sat
77   ///////////////////////////////////////////////////////////////////
78   /////////////////////////////////////////////////////////////////
79 } // namespace zypp
80 ///////////////////////////////////////////////////////////////////
81 #endif // ZYPP_SAT_POOL_H