-backup
[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/ResPool.h"
16 #include "zypp/pool/PoolImpl.h"
17
18 using std::endl;
19
20 ///////////////////////////////////////////////////////////////////
21 namespace zypp
22 { /////////////////////////////////////////////////////////////////
23
24   namespace
25   {
26     /** the empty pool used by ResPool::ResPool() */
27     pool::PoolTraits::Impl_constPtr noPool()
28     {
29       static pool::PoolTraits::Impl_constPtr _noPool( new pool::PoolImpl );
30       return _noPool;
31     }
32   }
33
34   ///////////////////////////////////////////////////////////////////
35   //
36   //    METHOD NAME : ResPool::ResPool
37   //    METHOD TYPE : Ctor
38   //
39   ResPool::ResPool()
40   : _pimpl( noPool() )
41   {}
42
43   ///////////////////////////////////////////////////////////////////
44   //
45   //    METHOD NAME : ResPool::ResPool
46   //    METHOD TYPE : Ctor
47   //
48   ResPool::ResPool( pool::PoolTraits::Impl_constPtr impl_r )
49   : _pimpl( impl_r )
50   {}
51
52   ///////////////////////////////////////////////////////////////////
53   //
54   //    METHOD NAME : ResPool::~ResPool
55   //    METHOD TYPE : Dtor
56   //
57   ResPool::~ResPool()
58   {}
59
60   ///////////////////////////////////////////////////////////////////
61   //
62   // Forward to impementation:
63   //
64   ///////////////////////////////////////////////////////////////////
65
66   bool ResPool::empty() const
67   { return _pimpl->empty(); }
68
69   ResPool::size_type ResPool::size() const
70   { return _pimpl->size(); }
71
72   ResPool::const_iterator ResPool::begin() const
73   { return _pimpl->begin(); }
74
75   ResPool::const_iterator ResPool::end() const
76   { return _pimpl->end(); }
77
78   ResPool::const_indexiterator ResPool::providesbegin(const std::string & tag_r) const
79   { return _pimpl->providesbegin(tag_r); }
80
81   ResPool::const_indexiterator ResPool::providesend(const std::string & tag_r) const
82   { return _pimpl->providesend(tag_r); }
83
84   ResPool::const_indexiterator ResPool::requiresbegin(const std::string & tag_r) const
85   { return _pimpl->requiresbegin(tag_r); }
86
87   ResPool::const_indexiterator ResPool::requiresend(const std::string & tag_r) const
88   { return _pimpl->requiresend(tag_r); }
89
90   ResPool::const_indexiterator ResPool::conflictsbegin(const std::string & tag_r) const
91   { return _pimpl->conflictsbegin(tag_r); }
92
93   ResPool::const_indexiterator ResPool::conflictsend(const std::string & tag_r) const
94   { return _pimpl->conflictsend(tag_r); }
95
96   ResPool::const_nameiterator ResPool::namebegin(const std::string & tag_r) const
97   { return _pimpl->namebegin(tag_r); }
98
99   ResPool::const_nameiterator ResPool::nameend(const std::string & tag_r) const
100   { return _pimpl->nameend(tag_r); }
101
102   /******************************************************************
103   **
104   **    FUNCTION NAME : operator<<
105   **    FUNCTION TYPE : std::ostream &
106   */
107   std::ostream & operator<<( std::ostream & str, const ResPool & obj )
108   {
109     return str << *obj._pimpl;
110   }
111
112   /////////////////////////////////////////////////////////////////
113 } // namespace zypp
114 ///////////////////////////////////////////////////////////////////