00001 00002 #ifndef ZYPP_REPOSITORY_H 00003 #define ZYPP_REPOSITORY_H 00004 00005 #include <iosfwd> 00006 #include <string> 00007 00008 #include "zypp/base/PtrTypes.h" 00009 #include "zypp/base/SafeBool.h" 00010 //#include "zypp/ResStore.h" 00011 #include "zypp/RepoInfo.h" 00012 #include "zypp/repo/PackageDelta.h" 00013 00014 namespace zypp 00015 { 00016 class ResStore; 00017 00018 namespace repo 00019 { 00020 DEFINE_PTR_TYPE(RepositoryImpl); 00021 class RepositoryImpl; 00022 } 00023 00024 class Repository : private base::SafeBool<Repository> 00025 { 00026 public: 00027 typedef repo::RepositoryImpl Impl; 00028 typedef repo::RepositoryImpl_Ptr Impl_Ptr; 00029 00030 public: 00031 00036 Repository(); 00037 00043 explicit 00044 Repository( const Impl_Ptr & impl_r ); 00045 00049 static const Repository noRepository; 00050 00054 using base::SafeBool<Repository>::operator bool_type; 00055 00056 public: 00057 typedef unsigned long NumericId; 00058 00060 NumericId numericId() const; 00061 00065 const ResStore & resolvables() const; 00066 00070 const RepoInfo & info() const; 00071 00075 const std::list<packagedelta::PatchRpm> & patchRpms() const; 00076 00080 const std::list<packagedelta::DeltaRpm> & deltaRpms() const; 00081 00082 private: 00083 friend base::SafeBool<Repository>::operator bool_type() const; 00085 bool boolTest() const 00086 { return _pimpl != noRepository._pimpl; } 00087 00088 private: 00090 RW_pointer<Impl,rw_pointer::Intrusive<Impl> > _pimpl; 00091 }; 00092 00094 std::ostream & operator<<( std::ostream & str, const Repository & obj ); 00096 bool operator==( const Repository & lhs, const Repository & rhs ); 00098 inline bool operator!=( const Repository & lhs, const Repository & rhs ) 00099 { return !( lhs == rhs ); } 00101 bool operator<( const Repository & lhs, const Repository & rhs ); 00102 00103 } 00104 00105 #endif 00106 00107
1.5.3