libzypp: zypp/ResPool.cc Source File

libzypp 17.25.10

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 //
37 ResPool ResPool::instance()
38 {
39 static ResPool _val( pool::PoolTraits::Impl_Ptr( new pool::PoolImpl ) );
40 return _val;
41 }
42
44 //
45 // METHOD NAME : ResPool::ResPool
46 // METHOD TYPE : Ctor
47 //
48 ResPool::ResPool( pool::PoolTraits::Impl_Ptr impl_r )
49 : _pimpl( impl_r )
50 {}
51
53 //
54 // Forward to impementation:
55 //
57
58 ResPoolProxy ResPool::proxy() const
59 { return _pimpl->proxy( *this ); }
60
61 Resolver & ResPool::resolver() const
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
70 ResPool::size_type ResPool::size() const
71 { return _pimpl->size(); }
72
73 PoolItem ResPool::find( const sat::Solvable & slv_r ) const
74 { return _pimpl->find( slv_r ); }
75
76 ResPool::EstablishedStates ResPool::establishedStates() const
77 { return _pimpl->establishedStates(); }
78
79 ResPool::size_type ResPool::knownRepositoriesSize() const
80 { return _pimpl->knownRepositoriesSize(); }
81
82 ResPool::repository_iterator ResPool::knownRepositoriesBegin() const
83 { return _pimpl->knownRepositoriesBegin(); }
84
85 ResPool::repository_iterator ResPool::knownRepositoriesEnd() const
86 { return _pimpl->knownRepositoriesEnd(); }
87
88 Repository ResPool::reposFind( const std::string & alias_r ) const
89 { return _pimpl->reposFind( alias_r ); }
90
91 bool ResPool::hardLockQueriesEmpty() const
92 { return _pimpl->hardLockQueries().empty(); }
93
94 ResPool::size_type ResPool::hardLockQueriesSize() const
95 { return _pimpl->hardLockQueries().size(); }
96
97 ResPool::hardLockQueries_iterator ResPool::hardLockQueriesBegin() const
98 { return _pimpl->hardLockQueries().begin(); }
99
100 ResPool::hardLockQueries_iterator ResPool::hardLockQueriesEnd() const
101 { return _pimpl->hardLockQueries().end(); }
102
103 void ResPool::setHardLockQueries( const HardLockQueries & newLocks_r )
104 { _pimpl->setHardLockQueries( newLocks_r ); }
105
106 void ResPool::getHardLockQueries( HardLockQueries & activeLocks_r )
107 { _pimpl->getHardLockQueries( activeLocks_r ); }
108
109
110 const pool::PoolTraits::ItemContainerT & ResPool::store() const
111 { return _pimpl->store(); }
112
113 const pool::PoolTraits::Id2ItemT & ResPool::id2item() const
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
130 const LocaleSet & ResPool::getRequestedLocales() const
131 { return sat::Pool::instance().getRequestedLocales(); }
132
133 bool ResPool::isRequestedLocale( const Locale & locale_r ) const
134 { return sat::Pool::instance().isRequestedLocale( locale_r ); }
135
136 const LocaleSet & ResPool::getAvailableLocales() const
137 { return sat::Pool::instance().getAvailableLocales(); }
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
PoolStats.h
ResPool.h
SerialNumber.h
ZYppFactory.h
zypp::Locale
'Language[_Country]' codes.
Definition: Locale.h:50
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:35
zypp::ResPool::EstablishedStates
A copy of the Pools initial ValidateValues of pseudo installed items.
Definition: ResPool.h:314
zypp::ResPool
Global ResObject pool.
Definition: ResPool.h:61
zypp::ResPool::hardLockQueriesBegin
hardLockQueries_iterator hardLockQueriesBegin() const
Definition: ResPool.cc: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::store
const pool::PoolTraits::ItemContainerT & store() const
Definition: ResPool.cc:110
zypp::ResPool::hardLockQueriesEmpty
bool hardLockQueriesEmpty() const
Definition: ResPool.cc:91
zypp::ResPool::knownRepositoriesSize
size_type knownRepositoriesSize() const
Definition: ResPool.cc:79
zypp::ResPool::ResPool
ResPool(pool::PoolTraits::Impl_Ptr impl_r)
Ctor.
Definition: ResPool.cc:48
zypp::ResPool::find
PoolItem find(const sat::Solvable &slv_r) const
Return the corresponding PoolItem.
Definition: ResPool.cc:73
zypp::ResPool::instance
static ResPool instance()
Singleton ctor.
Definition: ResPool.cc:37
zypp::ResPool::empty
bool empty() const
Definition: ResPool.cc:67
zypp::ResPool::knownRepositoriesBegin
repository_iterator knownRepositoriesBegin() const
Definition: ResPool.cc:82
zypp::ResPool::eraseRequestedLocale
bool eraseRequestedLocale(const Locale &locale_r)
Erase one Locale from the set of requested locales.
Definition: ResPool.cc:127
zypp::ResPool::addRequestedLocale
bool addRequestedLocale(const Locale &locale_r)
Add one Locale to the set of requested locales.
Definition: ResPool.cc:124
zypp::ResPool::reposFind
Repository reposFind(const std::string &alias_r) const
Find a Repository named alias_r.
Definition: ResPool.cc:88
zypp::ResPool::setHardLockQueries
void setHardLockQueries(const HardLockQueries &newLocks_r)
Set a new set of queries.
Definition: ResPool.cc:103
zypp::ResPool::resolver
Resolver & resolver() const
The Resolver.
Definition: ResPool.cc:61
zypp::ResPool::proxy
ResPoolProxy proxy() const
preliminary
Definition: ResPool.cc:58
zypp::ResPool::size_type
pool::PoolTraits::size_type size_type
Definition: ResPool.h:67
zypp::ResPool::getAvailableLocales
const LocaleSet & getAvailableLocales() const
Get the set of available locales.
Definition: ResPool.cc:136
zypp::ResPool::end
const_iterator end() const
Definition: ResPool.h:100
zypp::ResPool::HardLockQueries
pool::PoolTraits::HardLockQueries HardLockQueries
Definition: ResPool.h:438
zypp::ResPool::getRequestedLocales
const LocaleSet & getRequestedLocales() const
Return the requested locales.
Definition: ResPool.cc:130
zypp::ResPool::knownRepositoriesEnd
repository_iterator knownRepositoriesEnd() const
Definition: ResPool.cc:85
zypp::ResPool::setRequestedLocales
void setRequestedLocales(const LocaleSet &locales_r)
Set the requested locales.
Definition: ResPool.cc:121
zypp::ResPool::hardLockQueriesSize
size_type hardLockQueriesSize() const
Definition: ResPool.cc:94
zypp::ResPool::id2item
const pool::PoolTraits::Id2ItemT & id2item() const
Definition: ResPool.cc:113
zypp::ResPool::establishedStates
EstablishedStates establishedStates() const
Factory for EstablishedStates.
Definition: ResPool.cc:76
zypp::ResPool::_pimpl
RW_pointer< pool::PoolTraits::Impl > _pimpl
Access to implementation.
Definition: ResPool.h:469
zypp::ResPool::hardLockQueries_iterator
pool::PoolTraits::hardLockQueries_iterator hardLockQueries_iterator
Definition: ResPool.h:439
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::getHardLockQueries
void getHardLockQueries(HardLockQueries &activeLocks_r)
Suggest a new set of queries based on the current selection.
Definition: ResPool.cc:106
zypp::ResPool::size
size_type size() const
Definition: ResPool.cc:70
zypp::ResPool::hardLockQueriesEnd
hardLockQueries_iterator hardLockQueriesEnd() const
Definition: ResPool.cc:100
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::Resolver
Dependency resolver interface.
Definition: Resolver.h:45
zypp::SerialNumber
Simple serial number provider.
Definition: SerialNumber.h:45
zypp::detail::RepositoryIterator
Definition: Repository.h:460
zypp::pool::PoolImpl
Definition: PoolImpl.h:168
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
str
String related utilities and Regular expression matching.
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
zypp::operator<<
std::ostream & operator<<(std::ostream &str, const Exception &obj)
Definition: Exception.cc:147
zypp::LocaleSet
std::unordered_set< Locale > LocaleSet
Definition: Locale.h:27
PoolImpl.h
zypp::pool::PoolTraits::Impl_Ptr
shared_ptr< PoolImpl > Impl_Ptr
Definition: PoolTraits.h:92
zypp::pool::PoolTraits::ItemContainerT
std::vector< PoolItem > ItemContainerT
pure items
Definition: PoolTraits.h:71
zypp::pool::PoolTraits::Id2ItemT
std::unordered_multimap< sat::detail::IdType, PoolItem > Id2ItemT
ident index
Definition: PoolTraits.h:79