libzypp 17.31.23
|
Find the best candidates e.g. More...
#include <PoolItemBest.h>
Classes | |
struct | Impl |
PoolItemBest implementation. More... | |
Public Types | |
typedef boost::function< bool(const PoolItem &lhs, const PoolItem &rhs)> | Predicate |
Predicate returning True if lhs is a better choice. | |
typedef Container::size_type | size_type |
typedef Container::value_type | value_type |
typedef MapKVIteratorTraits< Container >::Value_const_iterator | iterator |
typedef MapKVIteratorTraits< Container >::Key_const_iterator | ident_iterator |
Public Member Functions | |
PoolItemBest (bool preferNotLocked_r=false) | |
Default ctor. | |
PoolItemBest (sat::Solvable slv_r, bool preferNotLocked_r=false) | |
Ctor feeding a sat::Solvable. | |
PoolItemBest (const PoolItem &pi_r, bool preferNotLocked_r=false) | |
Ctor feeding a PoolItem. | |
template<class TIterator > | |
PoolItemBest (TIterator begin_r, TIterator end_r, bool preferNotLocked_r=false) | |
Ctor feeding a range of sat::Solvable or PoolItem. | |
void | add (sat::Solvable slv_r) |
Feed one sat::Solvable. | |
void | add (const PoolItem &pi_r) |
Feed one PoolItem. | |
template<class TIterator > | |
void | add (TIterator begin_r, TIterator end_r) |
Feed a range of sat::Solvable or PoolItem. | |
Iterate the collected PoolItems. | |
bool | empty () const |
Whether PoolItems were collected. | |
size_type | size () const |
Number of PoolItems collected. | |
iterator | begin () const |
Pointer to the first PoolItem. | |
iterator | end () const |
Pointer behind the last PoolItem. | |
PoolItem | find (IdString ident_r) const |
Return the collected PoolItem with sat::Solvable::ident ident_r. | |
PoolItem | find (sat::Solvable slv_r) const |
PoolItem | find (const PoolItem &pi_r) const |
Static Public Attributes | |
static constexpr bool | preferNotLocked = true |
Indicator argument for ctor: consider locked packages less than not locked packages. | |
Private Types | |
typedef std::unordered_map< IdString, PoolItem > | Container |
Related Functions | |
(Note that these are not member functions.) | |
std::ostream & | operator<< (std::ostream &str, const PoolItemBest &obj) |
Stream output. | |
for | container |
for | container |
Iterate the collected PoolItems ident strings. | |
shared_ptr< void > | _dont_use_this_use_pimpl |
Avoid need to include Impl definition when inlined ctors (due to tepmlate) are provided. | |
ident_iterator | identBegin () const |
Pointer to the first item. | |
ident_iterator | identEnd () const |
Pointer behind the last item. | |
void | _ctor_init (bool preferNotLocked_r) |
void | _ctor_init () |
bin.compat legacy | |
const Container & | container () const |
RWCOW_pointer< Impl > & | pimpl () |
Pointer to implementation. | |
const RWCOW_pointer< Impl > & | pimpl () const |
Pointer to implementation. | |
Find the best candidates e.g.
in a PoolQuery result.
The class basically maintains a map<IdString,PoolItem>
and remembers for each ident
(sat::Solvable::ident) the best PoolItem that was added.
The default Predicate to determine the best choice is the same that sorts the ui::Selectable list of available objects, thus follows the same rules the resolver will apply.
Ctor argument preferNotLocked causes locked packages to be considered less than not locked packages.
Definition at line 63 of file PoolItemBest.h.
|
private |
Definition at line 65 of file PoolItemBest.h.
typedef boost::function<bool ( const PoolItem & lhs, const PoolItem & rhs )> zypp::PoolItemBest::Predicate |
Predicate returning True
if lhs is a better choice.
Definition at line 68 of file PoolItemBest.h.
typedef Container::size_type zypp::PoolItemBest::size_type |
Definition at line 70 of file PoolItemBest.h.
typedef Container::value_type zypp::PoolItemBest::value_type |
Definition at line 71 of file PoolItemBest.h.
typedef MapKVIteratorTraits<Container>::Value_const_iterator zypp::PoolItemBest::iterator |
Definition at line 72 of file PoolItemBest.h.
typedef MapKVIteratorTraits<Container>::Key_const_iterator zypp::PoolItemBest::ident_iterator |
Definition at line 73 of file PoolItemBest.h.
|
inline |
Default ctor.
Definition at line 81 of file PoolItemBest.h.
|
inline |
Ctor feeding a sat::Solvable.
Definition at line 85 of file PoolItemBest.h.
Ctor feeding a PoolItem.
Definition at line 89 of file PoolItemBest.h.
|
inline |
Ctor feeding a range of sat::Solvable or PoolItem.
Definition at line 94 of file PoolItemBest.h.
|
inline |
Feed one sat::Solvable.
Definition at line 99 of file PoolItemBest.h.
void zypp::PoolItemBest::add | ( | const PoolItem & | pi_r | ) |
Feed one PoolItem.
Definition at line 61 of file PoolItemBest.cc.
|
inline |
Feed a range of sat::Solvable or PoolItem.
Definition at line 107 of file PoolItemBest.h.
|
inline |
Whether PoolItems were collected.
Definition at line 117 of file PoolItemBest.h.
|
inline |
Number of PoolItems collected.
Definition at line 119 of file PoolItemBest.h.
|
inline |
Pointer to the first PoolItem.
Definition at line 121 of file PoolItemBest.h.
|
inline |
Pointer behind the last PoolItem.
Definition at line 123 of file PoolItemBest.h.
Return the collected PoolItem with sat::Solvable::ident ident_r.
Definition at line 85 of file PoolItemBest.cc.
|
inline |
Definition at line 128 of file PoolItemBest.h.
Definition at line 130 of file PoolItemBest.h.
|
inline |
Pointer to the first item.
Definition at line 136 of file PoolItemBest.h.
|
inline |
Pointer behind the last item.
Definition at line 138 of file PoolItemBest.h.
|
private |
Definition at line 52 of file PoolItemBest.cc.
|
private |
bin.compat legacy
Definition at line 55 of file PoolItemBest.cc.
|
private |
Definition at line 58 of file PoolItemBest.cc.
|
inlineprivate |
Pointer to implementation.
Definition at line 149 of file PoolItemBest.h.
|
inlineprivate |
Pointer to implementation.
Definition at line 151 of file PoolItemBest.h.
|
related |
Stream output.
Definition at line 97 of file PoolItemBest.cc.
|
related |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
related |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
staticconstexpr |
Indicator argument for ctor: consider locked packages less than not locked packages.
Definition at line 77 of file PoolItemBest.h.
|
private |
Avoid need to include Impl definition when inlined ctors (due to tepmlate) are provided.
Definition at line 153 of file PoolItemBest.h.