libzypp 17.37.10

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