- removed superfluous filter_iterator wrapping pool index iterators (byName/byCapabil...
authorMichael Andres <ma@suse.de>
Wed, 3 May 2006 13:37:52 +0000 (13:37 +0000)
committerMichael Andres <ma@suse.de>
Wed, 3 May 2006 13:37:52 +0000 (13:37 +0000)
zypp/ResPool.cc
zypp/ResPool.h
zypp/pool/PoolTraits.h

index e77190b..ca8cd0e 100644 (file)
@@ -76,16 +76,16 @@ namespace zypp
   { return _pimpl->end(); }
 
   ResPool::byName_iterator ResPool::byNameBegin( const std::string & name_r ) const
-  { return make_filter_iterator( ByName( name_r ), _pimpl->_namehash.begin( name_r ), _pimpl->_namehash.end( name_r ) ); }
+  { return _pimpl->_namehash.begin( name_r ); }
 
   ResPool::byName_iterator ResPool::byNameEnd( const std::string & name_r ) const
-  { return make_filter_iterator( ByName( name_r ), _pimpl->_namehash.end( name_r ), _pimpl->_namehash.end( name_r ) ); }
+  { return _pimpl->_namehash.end( name_r ); }
 
   ResPool::byCapabilityIndex_iterator ResPool::byCapabilityIndexBegin( const std::string & index_r, Dep depType_r ) const
-  { return make_filter_iterator( ByCapabilityIndex(), _pimpl->_caphash.begin( index_r, depType_r ), _pimpl->_caphash.end( index_r, depType_r ) ); }
+  { return _pimpl->_caphash.begin( index_r, depType_r ); }
 
   ResPool::byCapabilityIndex_iterator ResPool::byCapabilityIndexEnd( const std::string & index_r, Dep depType_r ) const
-  { return make_filter_iterator( ByCapabilityIndex(), _pimpl->_caphash.end( index_r, depType_r ), _pimpl->_caphash.end( index_r, depType_r ) ); }
+  { return _pimpl->_caphash.end( index_r, depType_r ); }
 
   /******************************************************************
   **
index 1c3c9ba..68bfdef 100644 (file)
@@ -40,10 +40,11 @@ namespace zypp
 
   public:
     /** \ref zypp::pool::PoolItem */
-    typedef pool::PoolTraits::Item                 Item;
-    typedef pool::PoolTraits::size_type                    size_type;
-    typedef pool::PoolTraits::const_iterator       const_iterator;
-    typedef pool::PoolTraits::const_capitemiterator const_capitemiterator;
+    typedef pool::PoolTraits::Item                      Item;
+    typedef pool::PoolTraits::size_type                         size_type;
+    typedef pool::PoolTraits::const_iterator            const_iterator;
+    typedef pool::PoolTraits::byName_iterator            byName_iterator;
+    typedef pool::PoolTraits::byCapabilityIndex_iterator byCapabilityIndex_iterator;
 
   public:
     /** Default ctor: empty pool */
@@ -92,9 +93,6 @@ namespace zypp
   public:
     /** \name Iterate through all ResObjects with a certain name (all kinds). */
     //@{
-    typedef resfilter::ByName ByName;
-    typedef filter_iterator<ByName,const_iterator> byName_iterator;
-
     byName_iterator byNameBegin( const std::string & name_r ) const;
 
     byName_iterator byNameEnd( const std::string & name_r ) const;
@@ -105,9 +103,6 @@ namespace zypp
     *  one Capability with index \a index_r in dependency \a depType_r.
    */
    //@{
-   typedef resfilter::ByCapabilityIndex ByCapabilityIndex;
-   typedef filter_iterator<ByCapabilityIndex,const_capitemiterator> byCapabilityIndex_iterator;
-
    byCapabilityIndex_iterator byCapabilityIndexBegin( const std::string & index_r, Dep depType_r ) const;
 
    byCapabilityIndex_iterator byCapabilityIndexEnd( const std::string & index_r, Dep depType_r ) const;
index 3e1406d..a85b9aa 100644 (file)
@@ -70,20 +70,21 @@ namespace zypp
       typedef ItemContainerT::const_iterator           const_iterator;
       typedef ItemContainerT::size_type                        size_type;
 
-      /** hashed by name */
-                                                       // use same iterators as above
-       // internal organization
+      // internal organization
       typedef std::map<std::string,ItemContainerT>     NameItemContainerT;
+      /** hashed by name */
+      typedef ItemContainerT::const_iterator            byName_iterator;
 
-      /** hashed by capability index */
+      // internal organization
       typedef std::list<CapAndItem>                    CapItemContainerT;      // (why,who) pairs
+      typedef std::map<std::string,CapItemContainerT>  CapItemStoreT;          // capability.index -> (why,who) pairs
+      typedef std::map<Dep,CapItemStoreT>              DepCapItemContainerT;   // Dep -> (capability.index -> (why,who) pairs)
+
       typedef CapItemContainerT::iterator              capitemiterator;
       typedef CapItemContainerT::const_iterator                const_capitemiterator;
       typedef CapItemContainerT::size_type             capitemsize_type;
-
-       // internal organization
-      typedef std::map<std::string,CapItemContainerT>  CapItemStoreT;          // capability.index -> (why,who) pairs
-      typedef std::map<Dep,CapItemStoreT>              DepCapItemContainerT;   // Dep -> (capability.index -> (why,who) pairs)
+      /** hashed by capability index */
+      typedef const_capitemiterator                     byCapabilityIndex_iterator;
 
       typedef PoolImpl                   Impl;
       typedef shared_ptr<PoolImpl>       Impl_Ptr;