libzypp  11.13.5
Pool.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_SAT_POOL_H
13 #define ZYPP_SAT_POOL_H
14 
15 #include <iosfwd>
16 
17 #include "zypp/Pathname.h"
18 
20 #include "zypp/Repository.h"
21 #include "zypp/sat/WhatProvides.h"
22 
24 namespace zypp
25 {
26 
27  class SerialNumber;
28  class RepoInfo;
29 
31  namespace sat
32  {
33 
35  //
36  // CLASS NAME : Pool
37  //
42  class Pool : protected detail::PoolMember
43  {
44  public:
48 
49  public:
51  static Pool instance()
52  { return Pool(); }
53 
56  {}
57 
58  public:
60  size_type capacity() const;
61 
63  const SerialNumber & serial() const;
64 
66  void prepare() const;
67 
69  void prepareForSolving() const;
70 
71  public:
73  bool reposEmpty() const;
74 
76  size_type reposSize() const;
77 
80 
83 
88  Repository reposInsert( const std::string & alias_r );
89 
93  Repository reposFind( const std::string & alias_r ) const;
94 
98  void reposErase( const std::string & alias_r )
99  { reposFind( alias_r ).eraseFromPool(); }
100 
101  public:
103  static const std::string & systemRepoAlias();
104 
106  Repository findSystemRepo() const;
107 
110 
111  public:
117  Repository addRepoSolv( const Pathname & file_r, const std::string & name_r );
119  Repository addRepoSolv( const Pathname & file_r );
123  Repository addRepoSolv( const Pathname & file_r, const RepoInfo & info_r );
124 
125  public:
132  Repository addRepoHelix( const Pathname & file_r, const std::string & name_r );
134  Repository addRepoHelix( const Pathname & file_r );
138  Repository addRepoHelix( const Pathname & file_r, const RepoInfo & info_r );
139 
140  public:
142  bool solvablesEmpty() const;
143 
145  size_type solvablesSize() const;
146 
149 
152 
153  public:
156  template<class _Filter>
157  filter_iterator<_Filter,SolvableIterator> filterBegin( const _Filter & filter_r ) const
158  { return make_filter_iterator( filter_r, solvablesBegin(), solvablesEnd() ); }
159 
160  template<class _Filter>
161  filter_iterator<_Filter,SolvableIterator> filterEnd( const _Filter & filter_r ) const
162  { return make_filter_iterator( filter_r, solvablesEnd(), solvablesEnd() ); }
164 
165  public:
168  { return WhatProvides( cap_r ); }
169 
170  public:
176  void setTextLocale( const Locale & locale_r );
177 
182  void setRequestedLocales( const LocaleSet & locales_r );
183 
187  bool addRequestedLocale( const Locale & locale_r );
188 
192  bool eraseRequestedLocale( const Locale & locale_r );
193 
197  const LocaleSet & getRequestedLocales() const;
198 
200  bool isRequestedLocale( const Locale & locale_r ) const;
201 
206  const LocaleSet & getAvailableLocales() const;
207 
209  bool isAvailableLocale( const Locale & locale_r ) const;
211 
212  public:
218  typedef IdStringSet::const_iterator MultiversionIterator;
219 
220  bool multiversionEmpty() const;
221  size_t multiversionSize() const;
224 
225  bool isMultiversion( IdString ident_r ) const;
227 
228  public:
233  typedef IdStringSet::const_iterator OnSystemByUserIterator;
234 
235  bool onSystemByUserEmpty() const;
236  size_t onSystemByUserSize() const;
239 
240  bool isOnSystemByUser( IdString ident_r ) const;
242 
243  public:
245  ::_Pool * get() const;
246  private:
248  Pool() {}
249  };
251 
253  std::ostream & operator<<( std::ostream & str, const Pool & obj );
254 
256  inline bool operator==( const Pool & lhs, const Pool & rhs )
257  { return lhs.get() == rhs.get(); }
258 
260  inline bool operator!=( const Pool & lhs, const Pool & rhs )
261  { return lhs.get() != rhs.get(); }
262 
264  } // namespace sat
267 } // namespace zypp
269 #endif // ZYPP_SAT_POOL_H