24
#include "zypp/base/Tr1hash.h"
24
#include "zypp/base/Hash.h"
25
25
#include "zypp/base/NonCopyable.h"
26
26
#include "zypp/base/SerialNumber.h"
27
#include "zypp/base/SetTracker.h"
27
28
#include "zypp/sat/detail/PoolMember.h"
28
29
#include "zypp/sat/Queue.h"
29
30
#include "zypp/RepoInfo.h"
78
80
void setDirty( const char * a1 = 0, const char * a2 = 0, const char * a3 = 0 );
82
/** Invalidate locale related housekeeping data.
84
void localeSetDirty( const char * a1 = 0, const char * a2 = 0, const char * a3 = 0 );
80
86
/** Invalidate housekeeping data (e.g. whatprovides) if dependencies changed.
82
88
void depSetDirty( const char * a1 = 0, const char * a2 = 0, const char * a3 = 0 );
216
222
{ prepare(); return ::pool_whatprovides( _pool, cap_r.id() ); }
219
/** \name Requested locales. */
225
/// \name Requested locales.
226
/// The requested LocaleSets managed in _requestedLocalesTracker
227
/// are unexpanded; i.e. they contain just the pure user selection.
228
/// The resolver however uses expanded sets ('de_DE' will also
229
/// include its fallback locales 'de', (en); here in the namespace:
230
/// callback and in the Resolver itself).
221
233
void setTextLocale( const Locale & locale_r );
236
/** Start tracking changes based on this \a locales_r.
237
* Usually called on TargetInit.
239
void initRequestedLocales( const LocaleSet & locales_r );
241
/** Added since last initRequestedLocales. */
242
const LocaleSet & getAddedRequestedLocales() const
243
{ return _requestedLocalesTracker.added(); }
245
/** Removed since last initRequestedLocales. */
246
const LocaleSet & getRemovedRequestedLocales() const
247
{ return _requestedLocalesTracker.removed(); }
249
/** Current set of requested Locales. */
250
const LocaleSet & getRequestedLocales() const
251
{ return _requestedLocalesTracker.current(); }
253
bool isRequestedLocale( const Locale & locale_r ) const
254
{ return _requestedLocalesTracker.contains( locale_r ); }
256
/** User change (tracked). */
222
257
void setRequestedLocales( const LocaleSet & locales_r );
258
/** User change (tracked). */
223
259
bool addRequestedLocale( const Locale & locale_r );
260
/** User change (tracked). */
224
261
bool eraseRequestedLocale( const Locale & locale_r );
226
const LocaleSet & getRequestedLocales() const
227
{ return _requestedLocales; }
229
bool isRequestedLocale( const Locale & locale_r ) const
231
LocaleSet::const_iterator it( _requestedLocales.find( locale_r ) );
232
return it != _requestedLocales.end();
263
/** All Locales occurring in any repo. */
235
264
const LocaleSet & getAvailableLocales() const;
237
266
bool isAvailableLocale( const Locale & locale_r ) const
240
269
LocaleSet::const_iterator it( avl.find( locale_r ) );
241
270
return it != avl.end();
273
typedef base::SetTracker<IdStringSet> TrackedLocaleIds;
275
/** Expanded _requestedLocalesTracker for solver.*/
276
const TrackedLocaleIds & trackedLocaleIds() const;
246
280
/** \name Multiversion install. */
248
typedef IdStringSet MultiversionList;
250
const MultiversionList & multiversionList() const
252
if ( ! _multiversionListPtr )
253
multiversionListInit();
254
return *_multiversionListPtr;
257
bool isMultiversion( IdString ident_r ) const
259
const MultiversionList & l( multiversionList() );
260
return l.find( ident_r ) != l.end();
282
typedef SolvableSet MultiversionList;
284
const MultiversionList & multiversionList() const;
286
bool isMultiversion( const Solvable & solv_r ) const;
291
316
std::map<RepoIdType,RepoInfo> _repoinfos;
294
LocaleSet _requestedLocales;
319
base::SetTracker<LocaleSet> _requestedLocalesTracker;
320
mutable scoped_ptr<TrackedLocaleIds> _trackedLocaleIdsPtr;
295
322
mutable scoped_ptr<LocaleSet> _availableLocalesPtr;
296
mutable std::tr1::unordered_set<IdString> _locale2Solver;
299
325
void multiversionListInit() const;