libzypp 17.31.6
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
16
17#include <zypp/ZYppFactory.h>
18#include <zypp/ResPool.h>
19#include <zypp/pool/PoolImpl.h>
20#include <zypp/pool/PoolStats.h>
21
22using std::endl;
23
25namespace 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
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
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
'Language[_Country]' codes.
Definition: Locale.h:50
Combining sat::Solvable and ResStatus.
Definition: PoolItem.h:51
ResPool::instance().proxy();.
Definition: ResPoolProxy.h:35
A copy of the Pools initial ValidateValues of pseudo installed items.
Definition: ResPool.h:314
Global ResObject pool.
Definition: ResPool.h:61
hardLockQueries_iterator hardLockQueriesBegin() const
Definition: ResPool.cc:97
bool isAvailableLocale(const Locale &locale_r) const
Whether this Locale is in the set of available locales.
Definition: ResPool.cc:139
const pool::PoolTraits::ItemContainerT & store() const
Definition: ResPool.cc:110
bool hardLockQueriesEmpty() const
Definition: ResPool.cc:91
size_type knownRepositoriesSize() const
Definition: ResPool.cc:79
ResPool(pool::PoolTraits::Impl_Ptr impl_r)
Ctor.
Definition: ResPool.cc:48
PoolItem find(const sat::Solvable &slv_r) const
Return the corresponding PoolItem.
Definition: ResPool.cc:73
static ResPool instance()
Singleton ctor.
Definition: ResPool.cc:37
bool empty() const
Definition: ResPool.cc:67
repository_iterator knownRepositoriesBegin() const
Definition: ResPool.cc:82
bool eraseRequestedLocale(const Locale &locale_r)
Erase one Locale from the set of requested locales.
Definition: ResPool.cc:127
bool addRequestedLocale(const Locale &locale_r)
Add one Locale to the set of requested locales.
Definition: ResPool.cc:124
Repository reposFind(const std::string &alias_r) const
Find a Repository named alias_r.
Definition: ResPool.cc:88
void setHardLockQueries(const HardLockQueries &newLocks_r)
Set a new set of queries.
Definition: ResPool.cc:103
Resolver & resolver() const
The Resolver.
Definition: ResPool.cc:61
ResPoolProxy proxy() const
preliminary
Definition: ResPool.cc:58
pool::PoolTraits::size_type size_type
Definition: ResPool.h:67
const LocaleSet & getAvailableLocales() const
Get the set of available locales.
Definition: ResPool.cc:136
const_iterator end() const
Definition: ResPool.h:100
pool::PoolTraits::HardLockQueries HardLockQueries
Definition: ResPool.h:438
const LocaleSet & getRequestedLocales() const
Return the requested locales.
Definition: ResPool.cc:130
repository_iterator knownRepositoriesEnd() const
Definition: ResPool.cc:85
void setRequestedLocales(const LocaleSet &locales_r)
Set the requested locales.
Definition: ResPool.cc:121
size_type hardLockQueriesSize() const
Definition: ResPool.cc:94
const pool::PoolTraits::Id2ItemT & id2item() const
Definition: ResPool.cc:113
EstablishedStates establishedStates() const
Factory for EstablishedStates.
Definition: ResPool.cc:76
RW_pointer< pool::PoolTraits::Impl > _pimpl
Access to implementation.
Definition: ResPool.h:469
pool::PoolTraits::hardLockQueries_iterator hardLockQueries_iterator
Definition: ResPool.h:439
const SerialNumber & serial() const
The pools serial number.
Definition: ResPool.cc:64
const_iterator begin() const
Definition: ResPool.h:97
void getHardLockQueries(HardLockQueries &activeLocks_r)
Suggest a new set of queries based on the current selection.
Definition: ResPool.cc:106
size_type size() const
Definition: ResPool.cc:70
hardLockQueries_iterator hardLockQueriesEnd() const
Definition: ResPool.cc:100
bool isRequestedLocale(const Locale &locale_r) const
Whether this Locale is in the set of requested locales.
Definition: ResPool.cc:133
Dependency resolver interface.
Definition: Resolver.h:45
Simple serial number provider.
Definition: SerialNumber.h:45
bool addRequestedLocale(const Locale &locale_r)
Add one Locale to the set of requested locales.
Definition: Pool.cc:239
const LocaleSet & getAvailableLocales() const
Get the set of available locales.
Definition: Pool.cc:255
bool isRequestedLocale(const Locale &locale_r) const
Whether this Locale is in the set of requested locales.
Definition: Pool.cc:248
bool eraseRequestedLocale(const Locale &locale_r)
Erase one Locale from the set of requested locales.
Definition: Pool.cc:242
static Pool instance()
Singleton ctor.
Definition: Pool.h:55
bool isAvailableLocale(const Locale &locale_r) const
Whether this Locale is in the set of available locales.
Definition: Pool.cc:258
void setRequestedLocales(const LocaleSet &locales_r)
Set the requested locales.
Definition: Pool.cc:236
const LocaleSet & getRequestedLocales() const
Return the requested locales.
Definition: Pool.cc:245
A Solvable object within the sat Pool.
Definition: Solvable.h:54
String related utilities and Regular expression matching.
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
std::unordered_set< Locale > LocaleSet
Definition: Locale.h:27
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
Definition: SerialNumber.cc:52
shared_ptr< PoolImpl > Impl_Ptr
Definition: PoolTraits.h:92
std::vector< PoolItem > ItemContainerT
pure items
Definition: PoolTraits.h:71
std::unordered_multimap< sat::detail::IdType, PoolItem > Id2ItemT
ident index
Definition: PoolTraits.h:79