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 ) ) );
93 friend std::ostream &
operator<<( std::ostream & str,
const Impl & obj );
94 friend std::ostream &
dumpOn( std::ostream & str,
const Impl & obj );
96 typedef std::tr1::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(); }
232 return dumpRange( str << obj <<
" 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 ); }
330 {
return str << *obj.
_pimpl; }
transform_iterator< Id2ItemValueSelector, Id2ItemT::const_iterator > byIdent_iterator
Impl(ResPool pool_r, const pool::PoolImpl &poolImpl_r)
bool operator()(const ui::Selectable::Ptr &selp) const
ui::Selectable::Ptr lookup(const pool::ByIdent &ident_r) const
void restoreState() const
void restoreState(const ResKind &kind_r) const
const_iterator begin() const
std::ostream & dumpOn(std::ostream &str, const ResPoolProxy::Impl &obj)
void saveState(ResPool pool_r)
void restoreState() const
byKind_iterator byKindBegin(const ResKind &kind_r) const
MapKVIteratorTraits< _Map >::Value_const_iterator make_map_value_end(const _Map &map_r)
Convenience to create the value iterator from container::end()
friend std::ostream & operator<<(std::ostream &str, const Impl &obj)
intrusive_ptr< Selectable > Ptr
size_type knownRepositoriesSize() const
const_iterator byKindBegin(const ResKind &kind_r) const
int invokeOnEach(_Iterator begin_r, _Iterator end_r, _Filter filter_r, _Function fnc_r)
Iterate through [begin_r,end_r) and invoke fnc_r on each item that passes filter_r.
PoolTraits::Id2ItemT Id2ItemT
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
size_type size(const ResKind &kind_r) const
bool empty(const ResKind &kind_r) const
const_iterator end() const
filter_iterator< _Filter, typename _Container::const_iterator > make_filter_begin(_Filter f, const _Container &c)
Convenience to create filter_iterator from container::begin().
byKind_iterator byKindEnd(const ResKind &kind_r) const
ResPool::instance().proxy();.
const_iterator end() const
ResPoolProxy implementation.
SelectableIndex _selIndex
void saveState(const ResKind &kind_r) const
ResPoolProxy::const_iterator const_iterator
MapKVIteratorTraits< _Map >::Value_const_iterator make_map_value_begin(const _Map &map_r)
Convenience to create the value iterator from container::begin()
std::ostream & dumpRange(std::ostream &str, _Iterator begin, _Iterator 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).
repository_iterator knownRepositoriesEnd() const
std::ostream & operator<<(std::ostream &str, const Exception &obj)
P_Select2nd< Id2ItemT::value_type > Id2ItemValueSelector
repository_iterator knownRepositoriesEnd() const
size_type knownRepositoriesSize() const
const_iterator byKindEnd(const ResKind &kind_r) const
MapKVIteratorTraits< _Map >::Value_const_iterator make_map_value_lower_bound(const _Map &map_r, const typename _Map::key_type &key_r)
Convenience to create the value iterator from container::lower_bound()
RW_pointer< Impl > _pimpl
Pointer to implementation.
friend std::ostream & dumpOn(std::ostream &str, const Impl &obj)
std::ostream & dumpOn(std::ostream &str, const Capability &obj)
void restoreState(ResPool pool_r)
ui::Selectable::Ptr lookup(const pool::ByIdent &ident_r) const
void saveState(ResPool pool_r, const ResKind &kind_r)
shared_ptr< Impl > Impl_Ptr
void restoreState() const
const_iterator begin() const
sat::detail::IdType get() const
const_iterator byKindEnd() const
const_iterator end() const
bool diffState(ResPool pool_r, const ResKind &kind_r) const
repository_iterator knownRepositoriesBegin() const
repository_iterator knownRepositoriesBegin() const
size_type knownRepositoriesSize() const
SelectablePool::size_type size_type
repository_iterator knownRepositoriesBegin() const
void restoreState(ResPool pool_r, const ResKind &kind_r)
std::multimap< ResKind, ui::Selectable::Ptr > SelectablePool
const SerialNumber & serial() const
The pools serial number.
MapKVIteratorTraits< _Map >::Value_const_iterator make_map_value_upper_bound(const _Map &map_r, const typename _Map::key_type &key_r)
Convenience to create the value iterator from container::upper_bound()
ResPoolProxy()
Default ctor: no pool Nonempty proxies are provided by ResPool.
filter_iterator< _Filter, typename _Container::const_iterator > make_filter_end(_Filter f, const _Container &c)
Convenience to create filter_iterator from container::end().
repository_iterator knownRepositoriesEnd() const
const Id2ItemT & id2item() const
static shared_ptr< Impl > nullimpl()
Offer default Impl.
const_iterator byKindBegin() const
const_iterator begin() const
MapKVIteratorTraits< SelectablePool >::Value_const_iterator const_iterator
bool diffState(ResPool pool_r) const
bool diffState(const ResKind &kind_r) const
std::tr1::unordered_map< sat::detail::IdType, ui::Selectable::Ptr > SelectableIndex
std::ostream & operator<<(std::ostream &str, const ResPoolProxy::Impl &obj)
Main filter selecting PoolItems by name and kind.