libzypp  17.23.8
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 
20 using std::endl;
21 
23 namespace zypp
24 {
25  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
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
68 } // namespace zypp
zypp::PoolItem
Combining sat::Solvable and ResStatus.
Definition: PoolItem.h:50
zypp::sat::Solvable
A Solvable object within the sat Pool.
Definition: Solvable.h:53
zypp::sat::solvitermixin_detail::UnifyByIdent::operator()
bool operator()(const Solvable &solv_r) const
Definition: SolvIterMixin.cc:31
zypp::sat::SolvableType::satSolvable
Solvable satSolvable() const
Return the corresponding sat::Solvable.
Definition: SolvableType.h:57
zypp::ResPool::proxy
ResPoolProxy proxy() const
preliminary
Definition: ResPool.cc:58
zypp::sat::solvitermixin_detail::UnifyByIdent::_uset
shared_ptr< Uset > _uset
Definition: SolvIterMixin.h:51
zypp::ResPool::instance
static ResPool instance()
Singleton ctor.
Definition: ResPool.cc:37
zypp::ui::asSelectable::operator()
Selectable_Ptr operator()(const sat::Solvable &solv_r) const
Definition: SolvIterMixin.cc:59
zypp::ResPoolProxy::lookup
ui::Selectable::Ptr lookup(const pool::ByIdent &ident_r) const
Definition: ResPoolProxy.cc:275
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
zypp::pool::ByIdent
Main filter selecting PoolItems by name and kind.
Definition: ByIdent.h:26
SolvIterMixin.h
PoolTraits.h
zypp::sat::asSolvable::operator()
Solvable operator()(const Solvable &solv_r) const
Definition: Solvable.h:532
zypp::pool::ByIdent::get
sat::detail::IdType get() const
Definition: ByIdent.h:88
ResPoolProxy.h
Solvable.h