libzypp: zypp/sat/SolvIterMixin.cc Source File

libzypp 17.36.6

SolvIterMixin.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12//#include <iostream>
13//#include <zypp/base/Logger.h>
14
15#include <zypp/sat/SolvIterMixin.h>
16#include <zypp/sat/Solvable.h>
17#include <zypp/ResPoolProxy.h>
18#include <zypp/pool/PoolTraits.h>
19
20using std::endl;
21
23namespace zypp
24{
26 namespace sat
27 {
28
29 namespace solvitermixin_detail
30 {
31 bool UnifyByIdent::operator()( const Solvable & solv_r ) const
32 {
33 // Need to use pool::ByIdent because packages and srcpackages have the same id.
34 return( solv_r && _uset->insert( pool::ByIdent( solv_r ).get() ).second );
35 }
36 }
37
39 // asSolvable
41 Solvable asSolvable::operator()( const PoolItem & pi_r ) const
42 {
43 return pi_r.satSolvable();
44 }
45
46 Solvable asSolvable::operator()( const ResObject_constPtr & res_r ) const
47 {
48 return res_r ? res_r->satSolvable() : Solvable();
49 }
50
52 } // namespace sat
54
56 namespace ui
57 {
58
59 Selectable_Ptr asSelectable::operator()( const sat::Solvable & sov_r ) const
60 {
61 return ResPool::instance().proxy().lookup( sov_r );
62 }
63
65 } // namespace ui
66
68} // namespace zypp
PoolTraits.h
ResPoolProxy.h
SolvIterMixin.h
Solvable.h
zypp::PoolItem
Combining sat::Solvable and ResStatus.
Definition PoolItem.h:51
zypp::ResPoolProxy::lookup
ui::Selectable::Ptr lookup(const pool::ByIdent &ident_r) const
Definition ResPoolProxy.cc:276
zypp::ResPool::instance
static ResPool instance()
Singleton ctor.
Definition ResPool.cc:38
zypp::ResPool::proxy
ResPoolProxy proxy() const
preliminary
Definition ResPool.cc:59
zypp::pool::ByIdent
Main filter selecting PoolItems by name and kind.
Definition ByIdent.h:29
zypp::pool::ByIdent::get
sat::detail::IdType get() const
Definition ByIdent.h:90
zypp::sat::Solvable
A Solvable object within the sat Pool.
Definition Solvable.h:54
zypp::sat::solvitermixin_detail
Definition SolvIterMixin.cc:30
zypp::sat
Definition Resolver.h:28
zypp::ui
Definition SolvIterMixin.cc:57
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition Application.cc:20
zypp::sat::SolvableType::satSolvable
Solvable satSolvable() const
Return the corresponding sat::Solvable.
Definition SolvableType.h:57
zypp::sat::asSolvable::operator()
Solvable operator()(const Solvable &solv_r) const
Definition Solvable.h:582
zypp::sat::solvitermixin_detail::UnifyByIdent::_uset
shared_ptr< Uset > _uset
Definition SolvIterMixin.h:51
zypp::sat::solvitermixin_detail::UnifyByIdent::operator()
bool operator()(const Solvable &solv_r) const
Definition SolvIterMixin.cc:31
zypp::ui::asSelectable::operator()
Selectable_Ptr operator()(const sat::Solvable &solv_r) const
Definition SolvIterMixin.cc:59