libzypp
12.16.5
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
PoolItemBest.cc
Go to the documentation of this file.
1
/*---------------------------------------------------------------------\
2
| ____ _ __ __ ___ |
3
| |__ / \ / / . \ . \ |
4
| / / \ V /| _/ _/ |
5
| / /__ | | | | | | |
6
| /_____||_| |_| |_| |
7
| |
8
\---------------------------------------------------------------------*/
12
#include <iostream>
13
#include "
zypp/base/LogTools.h
"
14
15
#include "
zypp/PoolItemBest.h
"
16
#include "
zypp/ui/SelectableTraits.h
"
17
18
using
std::endl;
19
21
namespace
zypp
22
{
23
25
//
26
// CLASS NAME : PoolItemBest::Impl
27
//
29
struct
PoolItemBest::Impl
30
{
31
Container
_container
;
32
33
private
:
34
friend
Impl
* rwcowClone<Impl>(
const
Impl
* rhs );
36
Impl
*
clone
()
const
37
{
return
new
Impl
( *
this
); }
38
};
40
42
//
43
// CLASS NAME : PoolItemBest
44
//
46
47
void
PoolItemBest::_ctor_init
()
48
{
_dont_use_this_use_pimpl
.reset(
new
RWCOW_pointer<Impl>
(
new
Impl
) ); }
49
50
const
PoolItemBest::Container
&
PoolItemBest::container
()
const
51
{
return
pimpl
()->
_container
; }
52
53
void
PoolItemBest::add
(
const
PoolItem
& pi_r )
54
{
55
Container
&
container
(
pimpl
()->_container );
56
PoolItem
& ccand( container[pi_r.
satSolvable
().
ident
()] );
57
if
( ! ccand ||
ui::SelectableTraits::AVOrder
()( pi_r, ccand ) )
58
ccand = pi_r;
59
}
60
61
PoolItem
PoolItemBest::find
(
IdString
ident_r )
const
62
{
63
const
Container
&
container
(
pimpl
()->_container );
64
Container::const_iterator it( container.find( ident_r ) );
65
return
it != container.end() ? it->second :
PoolItem
();
66
}
67
68
/******************************************************************
69
**
70
** FUNCTION NAME : operator<<
71
** FUNCTION TYPE : std::ostream &
72
*/
73
std::ostream &
operator<<
( std::ostream & str,
const
PoolItemBest
& obj )
74
{
75
return
dumpRange
( str <<
"("
<< obj.
size
() <<
") "
, obj.
begin
(), obj.
end
() );
76
}
77
79
}
// namespace zypp
zypp
PoolItemBest.cc
Generated by
1.8.2