libzypp  13.10.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 
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
ui::Selectable::Ptr lookup(const pool::ByIdent &ident_r) const
A Solvable object within the sat Pool.
Definition: Solvable.h:55
bool operator()(const Solvable &solv_r) const
Selectable_Ptr operator()(const sat::Solvable &solv_r) const
ResPoolProxy proxy() const
preliminary
Definition: ResPool.cc:54
Solvable operator()(Solvable solv_r) const
Definition: Solvable.h:402
sat::detail::IdType get() const
Definition: ByIdent.h:88
sat::Solvable satSolvable() const
Return the corresponding sat::Solvable.
Definition: PoolItem.h:114
Reference to a PoolItem connecting ResObject and ResStatus.
Definition: PoolItem.h:50
Main filter selecting PoolItems by name and kind.
Definition: ByIdent.h:26
static ResPool instance()
Singleton ctor.
Definition: ResPool.cc:33