ResPool.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #ifndef ZYPP_RESPOOL_H
00013 #define ZYPP_RESPOOL_H
00014 
00015 #include <iosfwd>
00016 
00017 #include "zypp/pool/PoolTraits.h"
00018 #include "zypp/base/Iterator.h"
00019 #include "zypp/ResFilters.h"
00020 
00022 namespace zypp
00023 { 
00024 
00025   class SerialNumber;
00026 
00028   //
00029   //    CLASS NAME : ResPool
00030   //
00039   class ResPool
00040   {
00041     friend std::ostream & operator<<( std::ostream & str, const ResPool & obj );
00042 
00043   public:
00045     typedef pool::PoolTraits::Item                       Item;
00046     typedef pool::PoolTraits::size_type                  size_type;
00047     typedef pool::PoolTraits::const_iterator             const_iterator;
00048     typedef pool::PoolTraits::byName_iterator            byName_iterator;
00049     typedef pool::PoolTraits::byCapabilityIndex_iterator byCapabilityIndex_iterator;
00050     typedef pool::PoolTraits::AdditionalCapSet           AdditionalCapSet;
00051     typedef pool::PoolTraits::repository_iterator        repository_iterator;
00052 
00053   public:
00055     ResPool();
00057     ~ResPool();
00058 
00059   public:
00064     const SerialNumber & serial() const;
00065 
00067     bool empty() const;
00069     size_type size() const;
00070 
00071   public:
00072 
00076     const_iterator begin() const;
00078     const_iterator end() const;
00080 
00081   public:
00084     typedef zypp::resfilter::ByKind ByKind;
00085     typedef filter_iterator<ByKind,const_iterator> byKind_iterator;
00086 
00087     byKind_iterator byKindBegin( const ResObject::Kind & kind_r ) const
00088     { return make_filter_begin( ByKind(kind_r), *this ); }
00089 
00090     template<class _Res>
00091       byKind_iterator byKindBegin() const
00092       { return make_filter_begin( resfilter::byKind<_Res>(), *this ); }
00093 
00094 
00095     byKind_iterator byKindEnd( const ResObject::Kind & kind_r ) const
00096     { return make_filter_end( ByKind(kind_r), *this ); }
00097 
00098     template<class _Res>
00099       byKind_iterator byKindEnd() const
00100       { return make_filter_end( resfilter::byKind<_Res>(), *this ); }
00102 
00103   public:
00106     byName_iterator byNameBegin( const std::string & name_r ) const;
00107 
00108     byName_iterator byNameEnd( const std::string & name_r ) const;
00110 
00111  public:
00116    byCapabilityIndex_iterator byCapabilityIndexBegin( const std::string & index_r, Dep depType_r ) const;
00117 
00118    byCapabilityIndex_iterator byCapabilityIndexEnd( const std::string & index_r, Dep depType_r ) const;
00120 
00121  public:
00125    size_type knownRepositoriesSize() const;
00126 
00127    repository_iterator knownRepositoriesBegin() const;
00128 
00129    repository_iterator knownRepositoriesEnd() const;
00131 
00132  public:
00157    void setAdditionalRequire( const AdditionalCapSet & capset ) const;
00158    AdditionalCapSet & additionalRequire() const;
00159 
00174    void setAdditionalConflict( const AdditionalCapSet & capset ) const;
00175    AdditionalCapSet & additionaConflict() const;
00176 
00192    void setAdditionalProvide( const AdditionalCapSet & capset ) const;
00193    AdditionalCapSet & additionaProvide() const;
00194 
00195   private:
00197     friend class ResPoolManager;
00199     ResPool( pool::PoolTraits::Impl_constPtr impl_r );
00200   private:
00202     pool::PoolTraits::Impl_constPtr _pimpl;
00203   };
00205 
00207   typedef ResPool ResPool_Ref;
00208 
00210 
00212   std::ostream & operator<<( std::ostream & str, const ResPool & obj );
00213 
00215 } // namespace zypp
00217 #endif // ZYPP_RESPOOL_H

Generated on Tue Sep 25 19:23:06 2007 for libzypp by  doxygen 1.5.3