Remove obsolete ResStatus bits.
[platform/upstream/libzypp.git] / zypp / ResPool.cc
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file       zypp/ResPool.cc
10  *
11 */
12 #include <iostream>
13 //#include "zypp/base/Logger.h"
14
15 #include "zypp/base/SerialNumber.h"
16
17 #include "zypp/ResPool.h"
18 #include "zypp/pool/PoolImpl.h"
19 #include "zypp/pool/PoolStats.h"
20
21 using std::endl;
22
23 ///////////////////////////////////////////////////////////////////
24 namespace zypp
25 { /////////////////////////////////////////////////////////////////
26
27   ///////////////////////////////////////////////////////////////////
28   //
29   //    METHOD NAME : ResPool::instance
30   //    METHOD TYPE : ResPool
31   //
32   ResPool ResPool::instance()
33   {
34     static ResPool _val( pool::PoolTraits::Impl_Ptr( new pool::PoolImpl ) );
35     return _val;
36   }
37
38   ///////////////////////////////////////////////////////////////////
39   //
40   //    METHOD NAME : ResPool::ResPool
41   //    METHOD TYPE : Ctor
42   //
43   ResPool::ResPool( pool::PoolTraits::Impl_Ptr impl_r )
44   : _pimpl( impl_r )
45   {}
46
47   ///////////////////////////////////////////////////////////////////
48   //
49   // Forward to impementation:
50   //
51   ///////////////////////////////////////////////////////////////////
52
53   ResPoolProxy ResPool::proxy() const
54   { return _pimpl->proxy( *this ); }
55
56   const SerialNumber & ResPool::serial() const
57   { return _pimpl->serial(); }
58
59   bool ResPool::empty() const
60   { return _pimpl->empty(); }
61
62   ResPool::size_type ResPool::size() const
63   { return _pimpl->size(); }
64
65
66   PoolItem ResPool::find( const sat::Solvable & slv_r ) const
67   { return _pimpl->find( slv_r ); }
68
69
70   ResPool::size_type ResPool::knownRepositoriesSize() const
71   { return _pimpl->knownRepositoriesSize(); }
72
73   ResPool::repository_iterator ResPool::knownRepositoriesBegin() const
74   { return _pimpl->knownRepositoriesBegin(); }
75
76   ResPool::repository_iterator ResPool::knownRepositoriesEnd() const
77   { return _pimpl->knownRepositoriesEnd(); }
78
79   Repository ResPool::reposFind( const std::string & alias_r ) const
80   { return _pimpl->reposFind( alias_r ); }
81
82   bool ResPool::autoSoftLocksEmpty() const
83   { return _pimpl->autoSoftLocks().empty(); }
84
85   ResPool::size_type ResPool::autoSoftLocksSize() const
86   { return _pimpl->autoSoftLocks().size(); }
87
88   ResPool::autoSoftLocks_iterator ResPool::autoSoftLocksBegin() const
89   { return _pimpl->autoSoftLocks().begin(); }
90
91   ResPool::autoSoftLocks_iterator ResPool::autoSoftLocksEnd() const
92   { return _pimpl->autoSoftLocks().end(); }
93
94   void ResPool::setAutoSoftLocks( const AutoSoftLocks & newLocks_r )
95   { _pimpl->setAutoSoftLocks( newLocks_r ); }
96
97   void ResPool::getActiveSoftLocks( AutoSoftLocks & activeLocks_r )
98   { _pimpl->getActiveSoftLocks( activeLocks_r ); }
99
100
101   bool ResPool::hardLockQueriesEmpty() const
102   { return _pimpl->hardLockQueries().empty(); }
103
104   ResPool::size_type ResPool::hardLockQueriesSize() const
105   { return _pimpl->hardLockQueries().size(); }
106
107   ResPool::hardLockQueries_iterator ResPool::hardLockQueriesBegin() const
108   { return _pimpl->hardLockQueries().begin(); }
109
110   ResPool::hardLockQueries_iterator ResPool::hardLockQueriesEnd() const
111   { return _pimpl->hardLockQueries().end(); }
112
113   void ResPool::setHardLockQueries( const HardLockQueries & newLocks_r )
114   { _pimpl->setHardLockQueries( newLocks_r ); }
115
116   void ResPool::getHardLockQueries( HardLockQueries & activeLocks_r )
117   { _pimpl->getHardLockQueries( activeLocks_r ); }
118
119
120   const pool::PoolTraits::ItemContainerT & ResPool::store() const
121   { return _pimpl->store(); }
122
123   const pool::PoolTraits::Id2ItemT & ResPool::id2item() const
124   { return _pimpl->id2item(); }
125
126   ///////////////////////////////////////////////////////////////////
127   //
128   // Forward to sat::Pool:
129   //
130   ///////////////////////////////////////////////////////////////////
131   void ResPool::setRequestedLocales( const LocaleSet & locales_r )
132   { sat::Pool::instance().setRequestedLocales( locales_r ); }
133
134   bool ResPool::addRequestedLocale( const Locale & locale_r )
135   { return sat::Pool::instance().addRequestedLocale( locale_r ); }
136
137   bool ResPool::eraseRequestedLocale( const Locale & locale_r )
138   { return sat::Pool::instance().eraseRequestedLocale( locale_r ); }
139
140   const LocaleSet & ResPool::getRequestedLocales() const
141   { return sat::Pool::instance().getRequestedLocales(); }
142
143   bool ResPool::isRequestedLocale( const Locale & locale_r ) const
144   { return sat::Pool::instance().isRequestedLocale( locale_r ); }
145
146   const LocaleSet & ResPool::getAvailableLocales() const
147   { return sat::Pool::instance().getAvailableLocales(); }
148
149   bool ResPool::isAvailableLocale( const Locale & locale_r ) const
150   { return sat::Pool::instance().isAvailableLocale( locale_r ); }
151
152   /******************************************************************
153   **
154   **    FUNCTION NAME : operator<<
155   **    FUNCTION TYPE : std::ostream &
156   */
157   std::ostream & operator<<( std::ostream & str, const ResPool & obj )
158   {
159     return dumpPoolStats( str << "ResPool " << sat::Pool::instance() << endl << "  ",
160                           obj.begin(), obj.end() );
161   }
162
163   /////////////////////////////////////////////////////////////////
164 } // namespace zypp
165 ///////////////////////////////////////////////////////////////////