libzypp  17.24.1
ResPool.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/base/SerialNumber.h>
16 
17 #include <zypp/ZYppFactory.h>
18 #include <zypp/ResPool.h>
19 #include <zypp/pool/PoolImpl.h>
20 #include <zypp/pool/PoolStats.h>
21 
22 using std::endl;
23 
25 namespace zypp
26 {
27 
29  // class ResPool
31 
33  //
34  // METHOD NAME : ResPool::instance
35  // METHOD TYPE : ResPool
36  //
38  {
40  return _val;
41  }
42 
44  //
45  // METHOD NAME : ResPool::ResPool
46  // METHOD TYPE : Ctor
47  //
49  : _pimpl( impl_r )
50  {}
51 
53  //
54  // Forward to impementation:
55  //
57 
59  { return _pimpl->proxy( *this ); }
60 
62  { return *getZYpp()->resolver(); }
63 
64  const SerialNumber & ResPool::serial() const
65  { return _pimpl->serial(); }
66 
67  bool ResPool::empty() const
68  { return _pimpl->empty(); }
69 
71  { return _pimpl->size(); }
72 
73  PoolItem ResPool::find( const sat::Solvable & slv_r ) const
74  { return _pimpl->find( slv_r ); }
75 
77  { return _pimpl->establishedStates(); }
78 
80  { return _pimpl->knownRepositoriesSize(); }
81 
83  { return _pimpl->knownRepositoriesBegin(); }
84 
86  { return _pimpl->knownRepositoriesEnd(); }
87 
88  Repository ResPool::reposFind( const std::string & alias_r ) const
89  { return _pimpl->reposFind( alias_r ); }
90 
92  { return _pimpl->hardLockQueries().empty(); }
93 
95  { return _pimpl->hardLockQueries().size(); }
96 
98  { return _pimpl->hardLockQueries().begin(); }
99 
101  { return _pimpl->hardLockQueries().end(); }
102 
103  void ResPool::setHardLockQueries( const HardLockQueries & newLocks_r )
104  { _pimpl->setHardLockQueries( newLocks_r ); }
105 
107  { _pimpl->getHardLockQueries( activeLocks_r ); }
108 
109 
111  { return _pimpl->store(); }
112 
114  { return _pimpl->id2item(); }
115 
117  //
118  // Forward to sat::Pool:
119  //
121  void ResPool::setRequestedLocales( const LocaleSet & locales_r )
122  { sat::Pool::instance().setRequestedLocales( locales_r ); }
123 
124  bool ResPool::addRequestedLocale( const Locale & locale_r )
125  { return sat::Pool::instance().addRequestedLocale( locale_r ); }
126 
127  bool ResPool::eraseRequestedLocale( const Locale & locale_r )
128  { return sat::Pool::instance().eraseRequestedLocale( locale_r ); }
129 
132 
133  bool ResPool::isRequestedLocale( const Locale & locale_r ) const
134  { return sat::Pool::instance().isRequestedLocale( locale_r ); }
135 
138 
139  bool ResPool::isAvailableLocale( const Locale & locale_r ) const
140  { return sat::Pool::instance().isAvailableLocale( locale_r ); }
141 
142  /******************************************************************
143  **
144  ** FUNCTION NAME : operator<<
145  ** FUNCTION TYPE : std::ostream &
146  */
147  std::ostream & operator<<( std::ostream & str, const ResPool & obj )
148  {
149  return dumpPoolStats( str << "ResPool " << sat::Pool::instance() << endl << " ",
150  obj.begin(), obj.end() );
151  }
152 
154 } // namespace zypp
ResPool.h
zypp::sat::Pool::instance
static Pool instance()
Singleton ctor.
Definition: Pool.h:55
zypp::ResPool::isRequestedLocale
bool isRequestedLocale(const Locale &locale_r) const
Whether this Locale is in the set of requested locales.
Definition: ResPool.cc:133
zypp::PoolItem
Combining sat::Solvable and ResStatus.
Definition: PoolItem.h:50
zypp::ResPool::store
const pool::PoolTraits::ItemContainerT & store() const
Definition: ResPool.cc:110
zypp::sat::Solvable
A Solvable object within the sat Pool.
Definition: Solvable.h:53
ZYppFactory.h
zypp::sat::Pool::isAvailableLocale
bool isAvailableLocale(const Locale &locale_r) const
Whether this Locale is in the set of available locales.
Definition: Pool.cc:258
PoolStats.h
zypp::sat::Pool::getAvailableLocales
const LocaleSet & getAvailableLocales() const
Get the set of available locales.
Definition: Pool.cc:255
zypp::ResPool::hardLockQueriesEmpty
bool hardLockQueriesEmpty() const
Definition: ResPool.cc:91
zypp::ResPool::setRequestedLocales
void setRequestedLocales(const LocaleSet &locales_r)
Set the requested locales.
Definition: ResPool.cc:121
zypp::detail::RepositoryIterator
Definition: Repository.h:445
zypp::ResPool::proxy
ResPoolProxy proxy() const
preliminary
Definition: ResPool.cc:58
PoolImpl.h
zypp::ResPool::instance
static ResPool instance()
Singleton ctor.
Definition: ResPool.cc:37
zypp::ResPool::end
const_iterator end() const
Definition: ResPool.h:100
zypp::ResPool::knownRepositoriesBegin
repository_iterator knownRepositoriesBegin() const
Definition: ResPool.cc:82
zypp::ResPool::size_type
pool::PoolTraits::size_type size_type
Definition: ResPool.h:67
zypp::ResPool::setHardLockQueries
void setHardLockQueries(const HardLockQueries &newLocks_r)
Set a new set of queries.
Definition: ResPool.cc:103
zypp::ResPool::hardLockQueries_iterator
pool::PoolTraits::hardLockQueries_iterator hardLockQueries_iterator
Definition: ResPool.h:439
zypp::pool::PoolImpl
Definition: PoolImpl.h:167
zypp::pool::PoolTraits::Impl_Ptr
shared_ptr< PoolImpl > Impl_Ptr
Definition: PoolTraits.h:92
zypp::ResPool::hardLockQueriesBegin
hardLockQueries_iterator hardLockQueriesBegin() const
Definition: ResPool.cc:97
zypp::ResPool::HardLockQueries
pool::PoolTraits::HardLockQueries HardLockQueries
Definition: ResPool.h:438
zypp::ResPool::reposFind
Repository reposFind(const std::string &alias_r) const
Find a Repository named alias_r.
Definition: ResPool.cc:88
zypp::sat::Pool::addRequestedLocale
bool addRequestedLocale(const Locale &locale_r)
Add one Locale to the set of requested locales.
Definition: Pool.cc:239
zypp::Resolver
Dependency resolver interface.
Definition: Resolver.h:44
zypp::ResPool::serial
const SerialNumber & serial() const
The pools serial number.
Definition: ResPool.cc:64
zypp::ResPool::begin
const_iterator begin() const
Definition: ResPool.h:97
zypp::ResPool::isAvailableLocale
bool isAvailableLocale(const Locale &locale_r) const
Whether this Locale is in the set of available locales.
Definition: ResPool.cc:139
zypp::ResPool::id2item
const pool::PoolTraits::Id2ItemT & id2item() const
Definition: ResPool.cc:113
zypp::sat::Pool::eraseRequestedLocale
bool eraseRequestedLocale(const Locale &locale_r)
Erase one Locale from the set of requested locales.
Definition: Pool.cc:242
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
zypp::ResPool::_pimpl
RW_pointer< pool::PoolTraits::Impl > _pimpl
Access to implementation.
Definition: ResPool.h:469
zypp::pool::PoolTraits::ItemContainerT
std::vector< PoolItem > ItemContainerT
pure items
Definition: PoolTraits.h:71
zypp::ResPool::find
PoolItem find(const sat::Solvable &slv_r) const
Return the corresponding PoolItem.
Definition: ResPool.cc:73
zypp::ResPool::establishedStates
EstablishedStates establishedStates() const
Factory for EstablishedStates.
Definition: ResPool.cc:76
SerialNumber.h
zypp::ResPool::size
size_type size() const
Definition: ResPool.cc:70
zypp::ResPool::addRequestedLocale
bool addRequestedLocale(const Locale &locale_r)
Add one Locale to the set of requested locales.
Definition: ResPool.cc:124
zypp::sat::Pool::isRequestedLocale
bool isRequestedLocale(const Locale &locale_r) const
Whether this Locale is in the set of requested locales.
Definition: Pool.cc:248
zypp::ResPool
Global ResObject pool.
Definition: ResPool.h:60
zypp::ResPool::knownRepositoriesSize
size_type knownRepositoriesSize() const
Definition: ResPool.cc:79
zypp::operator<<
std::ostream & operator<<(std::ostream &str, const Exception &obj)
Definition: Exception.cc:147
zypp::ResPool::hardLockQueriesEnd
hardLockQueries_iterator hardLockQueriesEnd() const
Definition: ResPool.cc:100
zypp::SerialNumber
Simple serial number provider.
Definition: SerialNumber.h:44
zypp::ResPoolProxy
ResPool::instance().proxy();.
Definition: ResPoolProxy.h:34
zypp::ResPool::eraseRequestedLocale
bool eraseRequestedLocale(const Locale &locale_r)
Erase one Locale from the set of requested locales.
Definition: ResPool.cc:127
zypp::LocaleSet
std::unordered_set< Locale > LocaleSet
Definition: Locale.h:27
zypp::ResPool::ResPool
ResPool(pool::PoolTraits::Impl_Ptr impl_r)
Ctor.
Definition: ResPool.cc:48
zypp::ResPool::resolver
Resolver & resolver() const
The Resolver.
Definition: ResPool.cc:61
zypp::ResPool::getAvailableLocales
const LocaleSet & getAvailableLocales() const
Get the set of available locales.
Definition: ResPool.cc:136
zypp::ResPool::hardLockQueriesSize
size_type hardLockQueriesSize() const
Definition: ResPool.cc:94
zypp::sat::Pool::setRequestedLocales
void setRequestedLocales(const LocaleSet &locales_r)
Set the requested locales.
Definition: Pool.cc:236
zypp::ResPool::getHardLockQueries
void getHardLockQueries(HardLockQueries &activeLocks_r)
Suggest a new set of queries based on the current selection.
Definition: ResPool.cc:106
str
String related utilities and Regular expression matching.
zypp::ResPool::getRequestedLocales
const LocaleSet & getRequestedLocales() const
Return the requested locales.
Definition: ResPool.cc:130
zypp::ResPool::empty
bool empty() const
Definition: ResPool.cc:67
zypp::Repository
Definition: Repository.h:39
zypp::Locale
'Language[_Country]' codes.
Definition: Locale.h:49
zypp::ResPool::EstablishedStates
A copy of the Pools initial ValidateValues of pseudo installed items.
Definition: ResPool.h:313
zypp::pool::PoolTraits::Id2ItemT
std::unordered_multimap< sat::detail::IdType, PoolItem > Id2ItemT
ident index
Definition: PoolTraits.h:79
zypp::ResPool::knownRepositoriesEnd
repository_iterator knownRepositoriesEnd() const
Definition: ResPool.cc:85
zypp::sat::Pool::getRequestedLocales
const LocaleSet & getRequestedLocales() const
Return the requested locales.
Definition: Pool.cc:245