[zypp-commit] r11624 - in /trunk/libzypp/zypp: PoolQuery.cc sat/LookupAttr.cc sat/LookupAttr.h
Author: mlandres
Date: Fri Nov 7 15:58:05 2008
New Revision: 11624
URL: http://svn.opensuse.org/viewcvs/zypp?rev=11624&view=rev
Log:
Remove obsolete repo chaining in LookupAttr::iterator.
Modified:
trunk/libzypp/zypp/PoolQuery.cc
trunk/libzypp/zypp/sat/LookupAttr.cc
trunk/libzypp/zypp/sat/LookupAttr.h
Modified: trunk/libzypp/zypp/PoolQuery.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/PoolQuery.cc?rev=11624&r1=11623&r2=11624&view=diff
==============================================================================
--- trunk/libzypp/zypp/PoolQuery.cc (original)
+++ trunk/libzypp/zypp/PoolQuery.cc Fri Nov 7 15:58:05 2008
@@ -545,7 +545,7 @@
, _edition(pqimpl->_edition)
, _op(pqimpl->_op)
{
- this->base_reference() = LookupAttr::iterator(dip_r, true); //!\todo pass chain_repos
+ this->base_reference() = LookupAttr::iterator(dip_r);
_has_next = (*base_reference() != sat::detail::noId);
}
Modified: trunk/libzypp/zypp/sat/LookupAttr.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/LookupAttr.cc?rev=11624&r1=11623&r2=11624&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/LookupAttr.cc (original)
+++ trunk/libzypp/zypp/sat/LookupAttr.cc Fri Nov 7 15:58:05 2008
@@ -24,9 +24,24 @@
using std::endl;
#if 0
-#undef XXX
-#define XXX MIL
-#warning Remove dummy debug output defines
+# undef XXX
+# define XXX MIL
+# define XXD DBG
+# define XXM MIL
+# define XXW WAR
+# define XXE ERR
+# define XXS SEC
+# define XXI INT
+# define XXU USR
+# warning Remove dummy debug output defines
+#else
+# define XXD XXX
+# define XXM XXX
+# define XXW XXX
+# define XXE XXX
+# define XXS XXX
+# define XXI XXX
+# define XXU XXX
#endif
///////////////////////////////////////////////////////////////////
@@ -41,32 +56,27 @@
if ( _attr == SolvAttr::noAttr )
return iterator();
-#warning Need to call dataiterator_free
+#warning Need to call dataiterator_free, use Autodispose instead of scoped_ptr
scoped_ptr< ::_Dataiterator> dip( new ::Dataiterator );
// needed while LookupAttr::iterator::dip_equal does ::memcmp:
::memset( dip.get(), 0, sizeof(::_Dataiterator) );
- bool chain = false;
if ( _solv )
{
- ::dataiterator_init( dip.get(), sat::Pool::instance().get(), _solv.repository().id(), _solv.id(), _attr.id(), 0, 0 );
- XXX << "Solv " << _solv << endl;
+ ::dataiterator_init( dip.get(), sat::Pool::instance().get(), _solv.repository().id(), _solv.id(), _attr.id(), 0, 0 );
}
else if ( _repo )
{
- ::dataiterator_init( dip.get(), sat::Pool::instance().get(), _repo.id(), 0, _attr.id(), 0, 0 );
- XXX << "Repo " << _repo << endl;
+ ::dataiterator_init( dip.get(), sat::Pool::instance().get(), _repo.id(), 0, _attr.id(), 0, 0 );
}
else if ( ! sat::Pool::instance().reposEmpty() )
{
- ::dataiterator_init( dip.get(), sat::Pool::instance().get(), sat::Pool::instance().reposBegin()->id(), 0, _attr.id(), 0, 0 );
- chain = true;
- XXX << "ALL " << endl;
+ ::dataiterator_init( dip.get(), sat::Pool::instance().get(), 0, 0, _attr.id(), 0, 0 );
}
else
return iterator();
- return iterator( dip, chain ); // iterator takes over ownership!
+ return iterator( dip ); // iterator takes over ownership!
}
LookupAttr::iterator LookupAttr::end() const
@@ -112,9 +122,9 @@
// CLASS NAME : LookupAttr::iterator
//
///////////////////////////////////////////////////////////////////
+
std::ostream & operator<<( std::ostream & str, const ::_Dataiterator * obj )
{
-
str << "::_Dataiterator(";
if ( ! obj )
{
@@ -122,23 +132,21 @@
}
else
{
- str << '|' << obj->pool;
- str << '|' << Repository(obj->repo);
- str << '|' << obj->key;
- str << '|' << obj->keyname;
- str << '|' << obj->repodataid;
- str << '|' << obj->solvid;
- str << '|' << obj->repoid;
+ str << "|" << obj->pool;
+ str << "|" << Repository(obj->repo);
+ str << "|" << obj->key;
+ str << "|" << obj->keyname;
+ str << "|" << obj->repodataid;
+ str << "|" << Solvable(obj->solvid);
+ str << "|" << obj->repoid;
}
return str << ")";
}
-
std::ostream & operator<<( std::ostream & str, const scoped_ptr< ::_Dataiterator> & obj )
{
return str << obj.get();
}
-
///////////////////////////////////////////////////////////////////
// position and moving
///////////////////////////////////////////////////////////////////
@@ -365,7 +373,6 @@
LookupAttr::iterator::iterator( const iterator & rhs )
: iterator_adaptor_( cloneFrom( rhs.base() ) )
, _dip( base() )
- , _chainRepos(rhs._chainRepos)
{}
LookupAttr::iterator & LookupAttr::iterator::operator=( const iterator & rhs )
@@ -374,19 +381,15 @@
{
_dip.reset( cloneFrom( rhs.base() ) );
base_reference() = _dip.get();
- _chainRepos = rhs._chainRepos;
}
return *this;
}
- LookupAttr::iterator::iterator( scoped_ptr< ::_Dataiterator> & dip_r, bool chain_r )
+ LookupAttr::iterator::iterator( scoped_ptr< ::_Dataiterator> & dip_r )
: iterator_adaptor_( dip_r.get() )
- , _chainRepos( chain_r )
{
_dip.swap( dip_r ); // take ownership!
- XXX << _dip << endl;
increment();
- XXX << *this << endl;
}
///////////////////////////////////////////////////////////////////
@@ -416,21 +419,8 @@
{
if ( _dip && ! ::dataiterator_step( _dip.get() ) )
{
- bool haveNext = false;
- if ( _chainRepos )
- {
- Repository nextRepo( inRepo().nextInPool() );
- if ( nextRepo )
- {
- ::dataiterator_jump_to_repo( _dip.get(), nextRepo.get() );
- haveNext = ::dataiterator_step( _dip.get() );
- }
- }
- if ( ! haveNext )
- {
- _dip.reset();
- base_reference() = 0;
- }
+ _dip.reset();
+ base_reference() = 0;
}
}
@@ -446,7 +436,7 @@
str << obj.inRepo();
str << '<' << obj.inSolvAttr()
- << ">(" << obj.solvAttrType() << ") = " << obj.asString();
+ << ">(" << IdString(obj.solvAttrType()) << ") = " << obj.asString();
return str;
}
Modified: trunk/libzypp/zypp/sat/LookupAttr.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/LookupAttr.h?rev=11624&r1=11623&r2=11624&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/LookupAttr.h (original)
+++ trunk/libzypp/zypp/sat/LookupAttr.h Fri Nov 7 15:58:05 2008
@@ -300,7 +300,7 @@
* C-tor taking over ownership of the passed scoped _Dataiterator*
* and doing it's first iteration (::dataiterator_step)
*/
- iterator( scoped_ptr< ::_Dataiterator> & dip_r, bool chain_r );
+ iterator( scoped_ptr< ::_Dataiterator> & dip_r );
private:
friend class boost::iterator_core_access;
@@ -326,7 +326,6 @@
{ return _dip.get(); }
private:
scoped_ptr< ::_Dataiterator> _dip;
- DefaultIntegral
participants (1)
-
mlandres@svn.opensuse.org