1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/pool/PoolTraits.h
12 #ifndef ZYPP_POOL_POOLTRAITS_H
13 #define ZYPP_POOL_POOLTRAITS_H
20 #include "zypp/base/Iterator.h"
21 #include "zypp/base/Tr1hash.h"
23 #include "zypp/PoolItem.h"
24 #include "zypp/pool/ByIdent.h"
25 #include "zypp/sat/Pool.h"
27 ///////////////////////////////////////////////////////////////////
29 { /////////////////////////////////////////////////////////////////
33 ///////////////////////////////////////////////////////////////////
35 { /////////////////////////////////////////////////////////////////
39 /** Pool internal filter skiping invalid/unwanted PoolItems. */
42 bool operator()( const PoolItem & pi ) const
46 /** In CXX0X std::_Select2nd does no longer derive from std::unary_function
48 template<typename _Pair>
49 struct P_Select2nd : public std::unary_function<_Pair, typename _Pair::second_type>
51 typename _Pair::second_type&
52 operator()(_Pair& __x) const
53 { return __x.second; }
55 const typename _Pair::second_type&
56 operator()(const _Pair& __x) const
57 { return __x.second; }
60 ///////////////////////////////////////////////////////////////////
62 // CLASS NAME : PoolTraits
68 typedef sat::detail::SolvableIdType SolvableIdType;
71 typedef std::vector<PoolItem> ItemContainerT;
72 typedef ItemContainerT::const_iterator item_iterator;
73 typedef filter_iterator<ByPoolItem,ItemContainerT::const_iterator>
75 typedef ItemContainerT::size_type size_type;
78 typedef std::tr1::unordered_multimap<sat::detail::IdType, PoolItem>
80 typedef P_Select2nd<Id2ItemT::value_type> Id2ItemValueSelector;
81 typedef transform_iterator<Id2ItemValueSelector, Id2ItemT::const_iterator>
84 /** list of known Repositories */
85 typedef sat::Pool::RepositoryIterator repository_iterator;
87 /** hard locks from etc/zypp/locks */
88 typedef std::list<PoolQuery> HardLockQueries;
89 typedef HardLockQueries::const_iterator hardLockQueries_iterator;
91 typedef PoolImpl Impl;
92 typedef shared_ptr<PoolImpl> Impl_Ptr;
93 typedef shared_ptr<const PoolImpl> Impl_constPtr;
95 ///////////////////////////////////////////////////////////////////
97 /////////////////////////////////////////////////////////////////
99 ///////////////////////////////////////////////////////////////////
100 /////////////////////////////////////////////////////////////////
102 ///////////////////////////////////////////////////////////////////
103 #endif // ZYPP_POOL_POOLTRAITS_H