libzypp  11.13.5
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 
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
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