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 
00026   //
00027   //    CLASS NAME : ResPool
00028   //
00037   class ResPool
00038   {
00039     friend std::ostream & operator<<( std::ostream & str, const ResPool & obj );
00040 
00041   public:
00043     typedef pool::PoolTraits::Item                       Item;
00044     typedef pool::PoolTraits::size_type                  size_type;
00045     typedef pool::PoolTraits::const_iterator             const_iterator;
00046     typedef pool::PoolTraits::byName_iterator            byName_iterator;
00047     typedef pool::PoolTraits::byCapabilityIndex_iterator byCapabilityIndex_iterator;
00048     typedef pool::PoolTraits::AdditionalCapSet           AdditionalCapSet;
00049 
00050   public:
00052     ResPool();
00054     ~ResPool();
00055 
00056   public:
00058     bool empty() const;
00060     size_type size() const;
00061 
00062   public:
00063 
00067     const_iterator begin() const;
00069     const_iterator end() const;
00071 
00072   public:
00075     typedef resfilter::ByKind ByKind;
00076     typedef filter_iterator<ByKind,const_iterator> byKind_iterator;
00077 
00078     byKind_iterator byKindBegin( const ResObject::Kind & kind_r ) const
00079     { return make_filter_begin( ByKind(kind_r), *this ); }
00080 
00081     template<class _Res>
00082       byKind_iterator byKindBegin() const
00083       { return make_filter_begin( resfilter::byKind<_Res>(), *this ); }
00084 
00085 
00086     byKind_iterator byKindEnd( const ResObject::Kind & kind_r ) const
00087     { return make_filter_end( ByKind(kind_r), *this ); }
00088 
00089     template<class _Res>
00090       byKind_iterator byKindEnd() const
00091       { return make_filter_end( resfilter::byKind<_Res>(), *this ); }
00093 
00094   public:
00097     byName_iterator byNameBegin( const std::string & name_r ) const;
00098 
00099     byName_iterator byNameEnd( const std::string & name_r ) const;
00101 
00102  public:
00107    byCapabilityIndex_iterator byCapabilityIndexBegin( const std::string & index_r, Dep depType_r ) const;
00108 
00109    byCapabilityIndex_iterator byCapabilityIndexEnd( const std::string & index_r, Dep depType_r ) const;
00111 
00112  public:
00137    void setAdditionalRequire( const AdditionalCapSet & capset ) const;
00138    AdditionalCapSet & additionalRequire() const;
00139 
00154    void setAdditionalConflict( const AdditionalCapSet & capset ) const;
00155    AdditionalCapSet & additionaConflict() const;
00156       
00172    void setAdditionalProvide( const AdditionalCapSet & capset ) const;
00173    AdditionalCapSet & additionaProvide() const;                  
00174 
00175   private:
00177     friend class ResPoolManager;
00179     ResPool( pool::PoolTraits::Impl_constPtr impl_r );
00180   private:
00182     pool::PoolTraits::Impl_constPtr _pimpl;
00183   };
00185 
00187   typedef ResPool ResPool_Ref;
00188 
00190 
00192   std::ostream & operator<<( std::ostream & str, const ResPool & obj );
00193 
00195 } // namespace zypp
00197 #endif // ZYPP_RESPOOL_H

Generated on Tue Nov 28 16:49:30 2006 for zypp by  doxygen 1.5.0