pass initial status (installed/uninstalled) all way through
[platform/upstream/libzypp.git] / zypp / pool / PoolTraits.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file       zypp/pool/PoolTraits.h
10  *
11 */
12 #ifndef ZYPP_POOL_POOLTRAITS_H
13 #define ZYPP_POOL_POOLTRAITS_H
14
15 #include <set>
16
17 #include "zypp/PoolItem.h"
18
19 ///////////////////////////////////////////////////////////////////
20 namespace zypp
21 { /////////////////////////////////////////////////////////////////
22   ///////////////////////////////////////////////////////////////////
23   namespace pool
24   { /////////////////////////////////////////////////////////////////
25
26     class PoolImpl;
27
28     /**  */
29     struct PoolImplInserter
30     {
31       void operator()( ResObject::constPtr ptr_r, bool installed = false );
32
33       PoolImplInserter( PoolImpl & poolImpl_r )
34       : _poolImpl( poolImpl_r )
35       {}
36       PoolImpl & _poolImpl;
37     };
38
39     /**  */
40     struct PoolImplDeleter
41     {
42       void operator()( ResObject::constPtr ptr_r );
43
44       PoolImplDeleter( PoolImpl & poolImpl_r )
45       : _poolImpl( poolImpl_r )
46       {}
47       PoolImpl & _poolImpl;
48     };
49
50     ///////////////////////////////////////////////////////////////////
51     //
52     //  CLASS NAME : PoolTraits
53     //
54     /** */
55     struct PoolTraits
56     {
57     public:
58       /** */
59       typedef PoolItem                   Item;
60       typedef std::set<Item>             ContainerT;
61       typedef ContainerT::size_type      size_type;
62       typedef ContainerT::iterator       iterator;
63       typedef ContainerT::const_iterator const_iterator;
64
65       typedef PoolImpl                   Impl;
66       typedef shared_ptr<PoolImpl>       Impl_Ptr;
67       typedef shared_ptr<const PoolImpl> Impl_constPtr;
68       typedef PoolImplInserter           Inserter;
69       typedef PoolImplDeleter            Deleter;
70     };
71     ///////////////////////////////////////////////////////////////////
72
73     /////////////////////////////////////////////////////////////////
74   } // namespace pool
75   ///////////////////////////////////////////////////////////////////
76   /////////////////////////////////////////////////////////////////
77 } // namespace zypp
78 ///////////////////////////////////////////////////////////////////
79 #endif // ZYPP_POOL_POOLTRAITS_H