libzypp 17.37.10

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/Hash.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 bool(pi); }
44 };
45
48 template<typename TPair>
49 struct P_Select2nd
50 {
51 typename TPair::second_type&
52 operator()(TPair& __x) const
53 { return __x.second; }
54
55 const typename TPair::second_type&
56 operator()(const TPair& __x) const
57 { return __x.second; }
58 };
59
61 //
62 // CLASS NAME : PoolTraits
63 //
65 struct PoolTraits
66 {
67 public:
68 using SolvableIdType = sat::detail::SolvableIdType;
69
71 using ItemContainerT = std::vector<PoolItem>;
72 using item_iterator = ItemContainerT::const_iterator;
73 using const_iterator = filter_iterator<ByPoolItem, ItemContainerT::const_iterator>;
74 using size_type = ItemContainerT::size_type;
75
77 using Id2ItemT = std::unordered_multimap<sat::detail::IdType, PoolItem>;
78 using Id2ItemValueSelector = P_Select2nd<Id2ItemT::value_type>;
79 using byIdent_iterator = transform_iterator<Id2ItemValueSelector, Id2ItemT::const_iterator>;
80
82 using repository_iterator = sat::Pool::RepositoryIterator;
83
85 using HardLockQueries = std::list<PoolQuery>;
86 using hardLockQueries_iterator = HardLockQueries::const_iterator;
87
88 using Impl = PoolImpl;
89 using Impl_Ptr = shared_ptr<PoolImpl>;
90 using Impl_constPtr = shared_ptr<const PoolImpl>;
91 };
92
93
95 } // namespace pool
98} // namespace zypp
100#endif // ZYPP_POOL_POOLTRAITS_H
ByIdent.h
PoolItem.h
Pool.h
bool
filter_iterator
An iterator over the subset of elements of some sequence which satisfy a given predicate.
shared_ptr
transform_iterator
An iterator over elements which are the result of applying some functional transformation to the elem...
zypp::PoolItem
Combining sat::Solvable and ResStatus.
Definition PoolItem.h:51
zypp::PoolQuery
Meta-data query API.
Definition PoolQuery.h:91
zypp::pool::PoolImpl
Definition PoolImpl.h:169
zypp::sat::Pool::RepositoryIterator
zypp::detail::RepositoryIterator RepositoryIterator
Definition Pool.h:50
zypp::pool
Definition ByIdent.h:24
zypp::sat::detail::SolvableIdType
unsigned int SolvableIdType
Id type to connect Solvable and sat-solvable.
Definition PoolMember.h:125
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition Application.cc:20
zypp::pool::ByPoolItem
Pool internal filter skiping invalid/unwanted PoolItems.
Definition PoolTraits.h:41
zypp::pool::ByPoolItem::operator()
bool operator()(const PoolItem &pi) const
Definition PoolTraits.h:42
zypp::pool::P_Select2nd
std::_Select2nd
Definition PoolTraits.h:50
zypp::pool::P_Select2nd::operator()
const TPair::second_type & operator()(const TPair &__x) const
Definition PoolTraits.h:56
zypp::pool::P_Select2nd::operator()
TPair::second_type & operator()(TPair &__x) const
Definition PoolTraits.h:52
zypp::pool::PoolTraits
Definition PoolTraits.h:66
zypp::pool::PoolTraits::const_iterator
filter_iterator< ByPoolItem, ItemContainerT::const_iterator > const_iterator
Definition PoolTraits.h:73
zypp::pool::PoolTraits::item_iterator
ItemContainerT::const_iterator item_iterator
Definition PoolTraits.h:72
zypp::pool::PoolTraits::Impl_Ptr
shared_ptr< PoolImpl > Impl_Ptr
Definition PoolTraits.h:89
zypp::pool::PoolTraits::Impl_constPtr
shared_ptr< const PoolImpl > Impl_constPtr
Definition PoolTraits.h:90
zypp::pool::PoolTraits::repository_iterator
sat::Pool::RepositoryIterator repository_iterator
list of known Repositories
Definition PoolTraits.h:82
zypp::pool::PoolTraits::Id2ItemT
std::unordered_multimap< sat::detail::IdType, PoolItem > Id2ItemT
ident index
Definition PoolTraits.h:77
zypp::pool::PoolTraits::size_type
ItemContainerT::size_type size_type
Definition PoolTraits.h:74
zypp::pool::PoolTraits::hardLockQueries_iterator
HardLockQueries::const_iterator hardLockQueries_iterator
Definition PoolTraits.h:86
zypp::pool::PoolTraits::ItemContainerT
std::vector< PoolItem > ItemContainerT
pure items
Definition PoolTraits.h:71
zypp::pool::PoolTraits::Id2ItemValueSelector
P_Select2nd< Id2ItemT::value_type > Id2ItemValueSelector
Definition PoolTraits.h:78
zypp::pool::PoolTraits::SolvableIdType
sat::detail::SolvableIdType SolvableIdType
Definition PoolTraits.h:68
zypp::pool::PoolTraits::Impl
PoolImpl Impl
Definition PoolTraits.h:88
zypp::pool::PoolTraits::HardLockQueries
std::list< PoolQuery > HardLockQueries
hard locks from etc/zypp/locks
Definition PoolTraits.h:85
zypp::pool::PoolTraits::byIdent_iterator
transform_iterator< Id2ItemValueSelector, Id2ItemT::const_iterator > byIdent_iterator
Definition PoolTraits.h:79
Hash.h
Iterator.h