libzypp  11.13.5
PoolTraits.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_POOL_POOLTRAITS_H
13 #define ZYPP_POOL_POOLTRAITS_H
14 
15 #include <set>
16 #include <map>
17 #include <list>
18 #include <vector>
19 
20 #include "zypp/base/Iterator.h"
21 #include "zypp/base/Tr1hash.h"
22 
23 #include "zypp/PoolItem.h"
24 #include "zypp/pool/ByIdent.h"
25 #include "zypp/sat/Pool.h"
26 
28 namespace zypp
29 {
30 
31  class PoolQuery;
32 
34  namespace pool
35  {
36 
37  class PoolImpl;
38 
40  struct ByPoolItem
41  {
42  bool operator()( const PoolItem & pi ) const
43  { return pi; }
44  };
45 
48  template<typename _Pair>
49  struct P_Select2nd : public std::unary_function<_Pair, typename _Pair::second_type>
50  {
51  typename _Pair::second_type&
52  operator()(_Pair& __x) const
53  { return __x.second; }
54 
55  const typename _Pair::second_type&
56  operator()(const _Pair& __x) const
57  { return __x.second; }
58  };
59 
61  //
62  // CLASS NAME : PoolTraits
63  //
65  struct PoolTraits
66  {
67  public:
69 
71  typedef std::vector<PoolItem> ItemContainerT;
72  typedef ItemContainerT::const_iterator item_iterator;
73  typedef filter_iterator<ByPoolItem,ItemContainerT::const_iterator>
76 
78  typedef std::tr1::unordered_multimap<sat::detail::IdType, PoolItem>
81  typedef transform_iterator<Id2ItemValueSelector, Id2ItemT::const_iterator>
83 
86 
88  typedef std::tr1::unordered_set<IdString> AutoSoftLocks;
89  typedef AutoSoftLocks::const_iterator autoSoftLocks_iterator;
90 
92  typedef std::list<PoolQuery> HardLockQueries;
93  typedef HardLockQueries::const_iterator hardLockQueries_iterator;
94 
95  typedef PoolImpl Impl;
96  typedef shared_ptr<PoolImpl> Impl_Ptr;
97  typedef shared_ptr<const PoolImpl> Impl_constPtr;
98  };
100 
102  } // namespace pool
105 } // namespace zypp
107 #endif // ZYPP_POOL_POOLTRAITS_H