2 #ifndef ZYPP_REPOSITORY_H
3 #define ZYPP_REPOSITORY_H
8 #include "zypp/base/PtrTypes.h"
9 #include "zypp/base/SafeBool.h"
10 //#include "zypp/ResStore.h"
11 #include "zypp/RepoInfo.h"
12 #include "zypp/repo/PackageDelta.h"
20 DEFINE_PTR_TYPE(RepositoryImpl);
24 class Repository : private base::SafeBool<Repository>
27 typedef repo::RepositoryImpl Impl;
28 typedef repo::RepositoryImpl_Ptr Impl_Ptr;
33 * \short Default ctor: noRepository.
34 * \see RepoManager::createFromCache.
38 /** \short Factory ctor taking a RepositoryImpl.
39 * This is quite low level. You usually want to use RepoManager to
40 * manage the repositories.
44 Repository( const Impl_Ptr & impl_r );
47 * A dummy Repository (Id \c 0) providing nothing, doing nothing.
49 static const Repository noRepository;
51 /** Validate Repository in a boolean context.
52 * \c FALSE iff == noRepository.
54 using base::SafeBool<Repository>::operator bool_type;
57 typedef unsigned long NumericId;
59 /** Runtime unique numeric Repository Id. */
60 NumericId numericId() const;
63 * \short Get the resolvables for repo
65 const ResStore & resolvables() const;
68 * \short Repository info used to create this repository
70 const RepoInfo & info() const;
73 * \short Patch RPMs the repository provides
75 const std::list<packagedelta::PatchRpm> & patchRpms() const;
78 * \short Delta RPMs the repository provides
80 const std::list<packagedelta::DeltaRpm> & deltaRpms() const;
83 friend base::SafeBool<Repository>::operator bool_type() const;
84 /** \ref SafeBool test. */
86 { return _pimpl != noRepository._pimpl; }
89 /** Pointer to implementation */
90 RW_pointer<Impl,rw_pointer::Intrusive<Impl> > _pimpl;
93 /** \relates Repository */
94 std::ostream & operator<<( std::ostream & str, const Repository & obj );
95 /** \relates Repository */
96 bool operator==( const Repository & lhs, const Repository & rhs );
97 /** \relates Repository */
98 inline bool operator!=( const Repository & lhs, const Repository & rhs )
99 { return !( lhs == rhs ); }
100 /** \relates Repository */
101 bool operator<( const Repository & lhs, const Repository & rhs );