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::const_capitemiterator const_capitemiterator;
00047 
00048   public:
00050     ResPool();
00052     ~ResPool();
00053 
00054   public:
00056     bool empty() const;
00058     size_type size() const;
00059 
00060   public:
00061 
00065     const_iterator begin() const;
00067     const_iterator end() const;
00069 
00070   public:
00073     typedef resfilter::ByKind ByKind;
00074     typedef filter_iterator<ByKind,const_iterator> byKind_iterator;
00075 
00076     byKind_iterator byKindBegin( const ResObject::Kind & kind_r ) const
00077     { return make_filter_begin( ByKind(kind_r), *this ); }
00078 
00079     template<class _Res>
00080       byKind_iterator byKindBegin() const
00081       { return make_filter_begin( resfilter::byKind<_Res>(), *this ); }
00082 
00083 
00084     byKind_iterator byKindEnd( const ResObject::Kind & kind_r ) const
00085     { return make_filter_end( ByKind(kind_r), *this ); }
00086 
00087     template<class _Res>
00088       byKind_iterator byKindEnd() const
00089       { return make_filter_end( resfilter::byKind<_Res>(), *this ); }
00091 
00092   public:
00095     typedef resfilter::ByName ByName;
00096     typedef filter_iterator<ByName,const_iterator> byName_iterator;
00097 
00098     byName_iterator byNameBegin( const std::string & name_r ) const;
00099 
00100     byName_iterator byNameEnd( const std::string & name_r ) const;
00102 
00103  public:
00108    typedef resfilter::ByCapabilityIndex ByCapabilityIndex;
00109    typedef filter_iterator<ByCapabilityIndex,const_capitemiterator> byCapabilityIndex_iterator;
00110 
00111    byCapabilityIndex_iterator byCapabilityIndexBegin( const std::string & index_r, Dep depType_r ) const;
00112 
00113    byCapabilityIndex_iterator byCapabilityIndexEnd( const std::string & index_r, Dep depType_r ) const;
00115 
00116   private:
00118     friend class ResPoolManager;
00120     ResPool( pool::PoolTraits::Impl_constPtr impl_r );
00121   private:
00123     pool::PoolTraits::Impl_constPtr _pimpl;
00124   };
00126 
00128   typedef ResPool ResPool_Ref;
00129 
00131 
00133   std::ostream & operator<<( std::ostream & str, const ResPool & obj );
00134 
00136 } // namespace zypp
00138 #endif // ZYPP_RESPOOL_H

Generated on Thu May 4 16:03:24 2006 for zypp by  doxygen 1.4.6