merge REFACTORING-10_3 back to trunk
[platform/upstream/libzypp.git] / zypp / Repository.cc
1 #include <cassert>
2 #include <iostream>
3
4 #include "zypp/Repository.h"
5 #include "zypp/repo/RepositoryImpl.h"
6
7 using namespace std;
8
9 ///////////////////////////////////////////////////////////////////
10 namespace zypp
11 { /////////////////////////////////////////////////////////////////
12
13   const Repository Repository::noRepository;
14
15   ///////////////////////////////////////////////////////////////////
16   //
17   //    METHOD NAME : Repository::Repository
18   //    METHOD TYPE : Ctor
19   //
20   Repository::Repository()
21   : _pimpl( Impl::nullimpl() )
22   {}
23
24   ///////////////////////////////////////////////////////////////////
25   //
26   //    METHOD NAME : Repository::Repository
27   //    METHOD TYPE : Ctor
28   //
29   Repository::Repository( const Impl_Ptr & impl_r )
30   : _pimpl( impl_r )
31   {
32     assert( impl_r );
33   }
34
35   ///////////////////////////////////////////////////////////////////
36   //
37   //    Forward to RepositoryImpl:
38   //
39   ///////////////////////////////////////////////////////////////////
40
41   Repository::NumericId Repository::numericId() const
42   { return _pimpl->numericId(); }
43
44   const ResStore & Repository::resolvables() const
45   {
46     return _pimpl->resolvables();
47   }
48
49   const RepoInfo & Repository::info() const
50   {
51     return _pimpl->info();
52   }
53
54   const std::list<packagedelta::PatchRpm> &
55   Repository::patchRpms() const
56   {
57     return _pimpl->patchRpms();
58   }
59
60   const std::list<packagedelta::DeltaRpm> &
61   Repository::deltaRpms() const
62   {
63     return _pimpl->deltaRpms();
64   }
65
66   std::ostream & operator<<( std::ostream & str, const Repository & obj )
67   {
68     return str << "[" << obj.info().alias() << "]";
69   }
70
71   bool operator==( const Repository & lhs, const Repository & rhs )
72   {
73     return (lhs.info().alias() == rhs.info().alias());
74   }
75
76   bool operator<( const Repository & lhs, const Repository & rhs )
77   {
78     return (lhs.info().alias() < rhs.info().alias());
79   }
80 }
81