Author: mlandres Date: Tue Nov 27 11:50:59 2007 New Revision: 7933 URL: http://svn.opensuse.org/viewcvs/zypp?rev=7933&view=rev Log: added ResPool::find( const sat::Solvable & ) Modified: trunk/libzypp/zypp/ResPool.cc trunk/libzypp/zypp/ResPool.h trunk/libzypp/zypp/pool/PoolImpl.cc trunk/libzypp/zypp/pool/PoolImpl.h Modified: trunk/libzypp/zypp/ResPool.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ResPool.cc?rev=7933&... ============================================================================== --- trunk/libzypp/zypp/ResPool.cc (original) +++ trunk/libzypp/zypp/ResPool.cc Tue Nov 27 11:50:59 2007 @@ -73,6 +73,9 @@ bool ResPool::empty() const { return _pimpl->empty(); } + PoolItem ResPool::find( const sat::Solvable & slv_r ) const + { return _pimpl->find( slv_r ); } + ResPool::size_type ResPool::size() const { return _pimpl->size(); } Modified: trunk/libzypp/zypp/ResPool.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ResPool.h?rev=7933&a... ============================================================================== --- trunk/libzypp/zypp/ResPool.h (original) +++ trunk/libzypp/zypp/ResPool.h Tue Nov 27 11:50:59 2007 @@ -21,6 +21,13 @@ /////////////////////////////////////////////////////////////////// namespace zypp { ///////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////// + namespace sat + { ///////////////////////////////////////////////////////////////// + class Solvable; + ///////////////////////////////////////////////////////////////// + } // namespace sat + /////////////////////////////////////////////////////////////////// class SerialNumber; @@ -65,9 +72,17 @@ /** Wheter in sync with sat-pool. */ bool satSynced() const; + /** Sync with sat-pool. */ void satSync() const; + /** Return the corresponding \ref PoolItem. + * Pool and sat pool should be in sync. Returns an empty + * \ref PoolItem if there is no corresponding \ref PoolItem. + * \see \ref PoolItem::satSolvable. + */ + PoolItem find( const sat::Solvable & slv_r ) const; + public: /** */ bool empty() const; Modified: trunk/libzypp/zypp/pool/PoolImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/pool/PoolImpl.cc?rev... ============================================================================== --- trunk/libzypp/zypp/pool/PoolImpl.cc (original) +++ trunk/libzypp/zypp/pool/PoolImpl.cc Tue Nov 27 11:50:59 2007 @@ -266,6 +266,24 @@ //MIL << "Pool: " << _serial << ": In sync with sat-pool " << _satSyncRequired << endl; } + /////////////////////////////////////////////////////////////////// + // + // METHOD NAME : PoolImpl::satSync + // METHOD TYPE : void + // + PoolItem PoolImpl::find( const sat::Solvable & slv_r ) const + { + if ( slv_r ) + { + for_( it, begin(), end() ) + { + if ( (*it).satSolvable() == slv_r ) + return *it; + } + } + return PoolItem(); + } + /****************************************************************** ** ** FUNCTION NAME : operator<< Modified: trunk/libzypp/zypp/pool/PoolImpl.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/pool/PoolImpl.h?rev=... ============================================================================== --- trunk/libzypp/zypp/pool/PoolImpl.h (original) +++ trunk/libzypp/zypp/pool/PoolImpl.h Tue Nov 27 11:50:59 2007 @@ -334,6 +334,13 @@ /** Sync with sat-pool. */ void satSync() const; + /** Return the corresponding \ref PoolItem. + * Pool and sat pool should be in sync. Returns an empty + * \ref PoolItem if there is no corresponding \ref PoolItem. + * \see \ref PoolItem::satSolvable. + */ + PoolItem find( const sat::Solvable & slv_r ) const; + private: /** Serial number. */ SerialNumber _serial; -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org