13#include <zypp/base/LogTools.h>
15#include <zypp/base/Iterator.h>
20#include <zypp/pool/PoolImpl.h>
34 std::for_each( pool_r.
begin(), pool_r.
end(),
46 std::for_each( pool_r.
begin(), pool_r.
end(),
74 pool::PoolImpl::Id2ItemT::const_iterator end_r )
78 sat::Solvable solv( begin->satSolvable() );
80 return new ui::Selectable(
ui::Selectable::Impl_Ptr(
new ui::Selectable::Impl( solv.kind(), solv.name(), begin, end ) ) );
96 typedef std::unordered_map<sat::detail::IdType,ui::Selectable::Ptr>
SelectableIndex;
108 if ( ! id2item.empty() )
111 pool::PoolImpl::Id2ItemT::const_iterator cbegin = id2item.begin();
113 for_( it, id2item.begin(), id2item.end() )
115 if ( it->first != cbegin->first )
119 _selPool.insert( SelectablePool::value_type( p->kind(), p ) );
127 _selPool.insert( SelectablePool::value_type( p->kind(), p ) );
135 SelectableIndex::const_iterator it(
_selIndex.find( ident_r.
get() ) );
156 {
return(
_selPool.count( kind_r ) == 0 ); }
159 {
return _selPool.count( kind_r ); }
206 static shared_ptr<Impl> _nullimpl(
new Impl );
216 <<
"solv/" << obj.
size()<<
"sel]";
224 {
return selp->toModify(); }
249 : _pimpl(
Impl::nullimpl() )
258 : _pimpl( new
Impl( pool_r, poolImpl_r ) )
276 {
return _pimpl->lookup( ident_r ); }
279 {
return _pimpl->empty(); }
282 {
return _pimpl->size(); }
285 {
return _pimpl->begin(); }
291 {
return _pimpl->empty( kind_r ); }
294 {
return _pimpl->size( kind_r ); }
297 {
return _pimpl->byKindBegin( kind_r ); }
300 {
return _pimpl->byKindEnd( kind_r ); }
303 {
return _pimpl->knownRepositoriesSize(); }
306 {
return _pimpl->knownRepositoriesBegin(); }
309 {
return _pimpl->knownRepositoriesEnd(); }
315 {
_pimpl->saveState( kind_r ); }
318 {
_pimpl->restoreState(); }
321 {
_pimpl->restoreState( kind_r ); }
324 {
return _pimpl->diffState(); }
327 {
return _pimpl->diffState( kind_r ); }
void restoreState() const
ResPool::instance().proxy();.
MapKVIteratorTraits< SelectablePool >::Value_const_iterator const_iterator
const_iterator byKindEnd() const
size_type knownRepositoriesSize() const
const_iterator begin() const
const_iterator end() const
std::multimap< ResKind, ui::Selectable::Ptr > SelectablePool
ResPoolProxy()
Default ctor: no pool Nonempty proxies are provided by ResPool.
RW_pointer< Impl > _pimpl
Pointer to implementation.
void restoreState() const
repository_iterator knownRepositoriesBegin() const
SelectablePool::size_type size_type
ui::Selectable::Ptr lookup(const pool::ByIdent &ident_r) const
repository_iterator knownRepositoriesEnd() const
const_iterator byKindBegin() const
size_type knownRepositoriesSize() const
repository_iterator knownRepositoriesBegin() const
const_iterator end() const
byKind_iterator byKindEnd(const ResKind &kind_r) const
repository_iterator knownRepositoriesEnd() const
const SerialNumber & serial() const
The pools serial number.
byKind_iterator byKindBegin(const ResKind &kind_r) const
const_iterator begin() const
Main filter selecting PoolItems by name and kind.
sat::detail::IdType get() const
PoolTraits::Id2ItemT Id2ItemT
const Id2ItemT & id2item() const
intrusive_ptr< Selectable > Ptr
shared_ptr< Impl > Impl_Ptr
String related utilities and Regular expression matching.
Easy-to use interface to the ZYPP dependency resolver.
std::ostream & dumpRange(std::ostream &str, TIterator begin, TIterator end, const std::string &intro="{", const std::string &pfx="\n ", const std::string &sep="\n ", const std::string &sfx="\n", const std::string &extro="}")
Print range defined by iterators (multiline style).
MapKVIteratorTraits< TMap >::Value_const_iterator make_map_value_lower_bound(const TMap &map_r, const typename TMap::key_type &key_r)
Convenience to create the value iterator from container::lower_bound()
MapKVIteratorTraits< TMap >::Value_const_iterator make_map_value_begin(const TMap &map_r)
Convenience to create the value iterator from container::begin()
std::ostream & dumpOn(std::ostream &str, const Capability &obj)
filter_iterator< TFilter, typename TContainer::const_iterator > make_filter_begin(TFilter f, const TContainer &c)
Convenience to create filter_iterator from container::begin().
MapKVIteratorTraits< TMap >::Value_const_iterator make_map_value_end(const TMap &map_r)
Convenience to create the value iterator from container::end()
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
MapKVIteratorTraits< TMap >::Value_const_iterator make_map_value_upper_bound(const TMap &map_r, const typename TMap::key_type &key_r)
Convenience to create the value iterator from container::upper_bound()
filter_iterator< TFilter, typename TContainer::const_iterator > make_filter_end(TFilter f, const TContainer &c)
Convenience to create filter_iterator from container::end().
int invokeOnEach(TIterator begin_r, TIterator end_r, TFilter filter_r, TFunction fnc_r)
Iterate through [begin_r,end_r) and invoke fnc_r on each item that passes filter_r.
void restoreState(ResPool pool_r)
void saveState(ResPool pool_r)
void saveState(ResPool pool_r, const ResKind &kind_r)
void restoreState(ResPool pool_r, const ResKind &kind_r)
bool diffState(ResPool pool_r) const
bool diffState(ResPool pool_r, const ResKind &kind_r) const
ResPoolProxy implementation.
void restoreState(const ResKind &kind_r) const
bool diffState(const ResKind &kind_r) const
std::ostream & operator<<(std::ostream &str, const ResPoolProxy::Impl &obj)
Stream output.
repository_iterator knownRepositoriesEnd() const
repository_iterator knownRepositoriesBegin() const
const_iterator begin() const
static shared_ptr< Impl > nullimpl()
Offer default Impl.
std::ostream & dumpOn(std::ostream &str, const ResPoolProxy::Impl &obj)
Verbose stream output.
void restoreState() const
SelectableIndex _selIndex
bool empty(const ResKind &kind_r) const
friend std::ostream & operator<<(std::ostream &str, const Impl &obj)
void saveState(const ResKind &kind_r) const
size_type size(const ResKind &kind_r) const
ui::Selectable::Ptr lookup(const pool::ByIdent &ident_r) const
std::unordered_map< sat::detail::IdType, ui::Selectable::Ptr > SelectableIndex
size_type knownRepositoriesSize() const
const_iterator end() const
const_iterator byKindEnd(const ResKind &kind_r) const
const_iterator byKindBegin(const ResKind &kind_r) const
friend std::ostream & dumpOn(std::ostream &str, const Impl &obj)
ResPoolProxy::const_iterator const_iterator
Impl(ResPool pool_r, const pool::PoolImpl &poolImpl_r)
bool operator()(const ui::Selectable::Ptr &selp) const
transform_iterator< Id2ItemValueSelector, Id2ItemT::const_iterator > byIdent_iterator
P_Select2nd< Id2ItemT::value_type > Id2ItemValueSelector
#define for_(IT, BEG, END)
Convenient for-loops using iterator.