zypp::sat::LookupAttr::iterator Class Reference

Result iterator. More...

#include <LookupAttr.h>

Inheritance diagram for zypp::sat::LookupAttr::iterator:
[legend]

List of all members.

Public Member Functions

 iterator ()
 iterator (const iterator &rhs)
iteratoroperator= (const iterator &rhs)
 ~iterator ()
 iterator (detail::DIWrap &dip_r)
 C-tor taking over ownership of the passed _Dataiterator and doing it's first iteration (dataiterator_step).
::_Dataiterator * get () const
 Expert backdoor.
Moving fast forward.
void nextSkipSolvAttr ()
 On the next call to operator++ advance to the next SolvAttr.
void nextSkipSolvable ()
 On the next call to operator++ advance to the next Solvable.
void nextSkipRepo ()
 On the next call to operator++ advance to the next Repository.
void skipSolvAttr ()
 Immediately advance to the next SolvAttr.
void skipSolvable ()
 Immediately advance to the next Solvable.
void skipRepo ()
 Immediately advance to the next Repository.
void stayInThisSolvable ()
 Stop after all matches in the current Solvable are processed.
void stayInThisRepo ()
 Stop after all matches in the current Repository are processed.
Current position info.
Repository inRepo () const
 The current Repository.
Solvable inSolvable () const
 The current Solvable.
SolvAttr inSolvAttr () const
 The current SolvAttr.
bool atEnd () const
 Whether this points to the end of a query (Iterator is invalid).
Test attribute value type.
detail::IdType solvAttrType () const
 The current SolvAttr type.
bool solvAttrNumeric () const
 Whether this is a numeric attribute (incl.
bool solvAttrString () const
 Whether this is a string attribute.
bool solvAttrIdString () const
 Whether this string attribute is available as IdString.
bool solvAttrCheckSum () const
 Whether this is a CheckSum attribute.
bool solvAttrSubEntry () const
 Whether this is the entry to a sub-structure (flexarray).
Iterate sub-structures.
These are usable iff solvAttrSubEntry is true.

Note:
Unfortunately the underlying satsolver dataiterator as returned by subBegin and subFind loses some context when being created. Thus it's not possible to invoke subBegin and subFind on an iterator that was previously returned by one of those methods. The result will be an end iterator. For the same reason it is not possible for an iterator to leave the sub-structure again.
 // Lookup all "update:reference" entries for a specific solvable
 sat::LookupAttr q( sat::SolvAttr::updateReference, p->satSolvable() );
 for_( res, q.begin(), q.end() )
 {
   // List all sub values
   for_( sub, res.subBegin(), res.subEnd() )
   {
     cout << sub.asString() << endl;
   }

   // Directly access c specific value:
   sat::LookupAttr::iterator it( res.subFind( sat::SolvAttr::updateReferenceHref ) );
   if ( it != res.subEnd() )
     cout << it.asString() << endl;
 }


bool subEmpty () const
 Wheter the sub-structure is empty.
size_type subSize () const
 Ammount of attributes in the sub-structure.
iterator subBegin () const
 Iterator to the begin of a sub-structure.
iterator subEnd () const
 Iterator behind the end of a sub-structure.
iterator subFind (SolvAttr attr_r) const
 Iterator pointing to the first occurance of SolvAttr attr_r in sub-structure.
iterator subFind (const C_Str &attrname_r) const
Retrieving attribute values.
int asInt () const
 Conversion to numeric types.
unsigned asUnsigned () const
bool asBool () const
const char * c_str () const
 Conversion to string types.
std::string asString () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. If used with non-string types, this method tries to create some appropriate string representation.
IdString idStr () const
 As IdStr.
detail::IdType id () const
CheckSum asCheckSum () const
 As CheckSum.
template<class _Tp >
_Tp asType () const
 Templated return type.

Private Member Functions

template<class OtherDerived , class OtherIterator , class V , class C , class R , class D >
bool equal (const boost::iterator_adaptor< OtherDerived, OtherIterator, V, C, R, D > &rhs) const
bool dip_equal (const ::_Dataiterator &lhs, const ::_Dataiterator &rhs) const
detail::IdType dereference () const
void increment ()

Private Attributes

detail::DIWrap _dip

Friends

class boost::iterator_core_access

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &str, const LookupAttr::iterator &obj)
template<class _ResultT , class _AttrT >
std::ostream & operator<< (std::ostream &str, const ArrayAttr< _ResultT, _AttrT > &obj)


Detailed Description

Result iterator.

Extended iterator methods valid only if not .

Note:
Implementation: Keep iterator_adaptor base and _dip in sync!

Definition at line 357 of file LookupAttr.h.


Constructor & Destructor Documentation

zypp::sat::LookupAttr::iterator::iterator (  ) 

Definition at line 690 of file LookupAttr.cc.

Referenced by subBegin(), and subEnd().

zypp::sat::LookupAttr::iterator::iterator ( const iterator rhs  ) 

Definition at line 694 of file LookupAttr.cc.

References _dip, and zypp::sat::detail::DIWrap::get().

zypp::sat::LookupAttr::iterator::~iterator (  ) 

Definition at line 709 of file LookupAttr.cc.

zypp::sat::LookupAttr::iterator::iterator ( detail::DIWrap dip_r  ) 

C-tor taking over ownership of the passed _Dataiterator and doing it's first iteration (dataiterator_step).

Definition at line 701 of file LookupAttr.cc.

References _dip, zypp::sat::detail::DIWrap::get(), increment(), and zypp::sat::detail::DIWrap::swap().


Member Function Documentation

void zypp::sat::LookupAttr::iterator::nextSkipSolvAttr (  ) 

On the next call to operator++ advance to the next SolvAttr.

Definition at line 359 of file LookupAttr.cc.

References _dip, and zypp::sat::detail::DIWrap::get().

Referenced by skipSolvAttr().

void zypp::sat::LookupAttr::iterator::nextSkipSolvable (  ) 

On the next call to operator++ advance to the next Solvable.

Definition at line 362 of file LookupAttr.cc.

References _dip, and zypp::sat::detail::DIWrap::get().

Referenced by zypp::detail::PoolQueryMatcher::advance(), zypp::detail::PoolQueryMatcher::isAMatch(), and skipSolvable().

void zypp::sat::LookupAttr::iterator::nextSkipRepo (  ) 

On the next call to operator++ advance to the next Repository.

Definition at line 365 of file LookupAttr.cc.

References _dip, and zypp::sat::detail::DIWrap::get().

Referenced by zypp::detail::PoolQueryMatcher::isAMatch(), and skipRepo().

void zypp::sat::LookupAttr::iterator::skipSolvAttr (  )  [inline]

Immediately advance to the next SolvAttr.

Definition at line 378 of file LookupAttr.h.

References increment(), and nextSkipSolvAttr().

void zypp::sat::LookupAttr::iterator::skipSolvable (  )  [inline]

Immediately advance to the next Solvable.

Definition at line 382 of file LookupAttr.h.

References increment(), and nextSkipSolvable().

void zypp::sat::LookupAttr::iterator::skipRepo (  )  [inline]

Immediately advance to the next Repository.

Definition at line 386 of file LookupAttr.h.

References increment(), and nextSkipRepo().

void zypp::sat::LookupAttr::iterator::stayInThisSolvable (  ) 

Stop after all matches in the current Solvable are processed.

Definition at line 368 of file LookupAttr.cc.

References _dip, and zypp::sat::detail::DIWrap::get().

Referenced by zypp::detail::PoolQueryMatcher::matchDetail().

void zypp::sat::LookupAttr::iterator::stayInThisRepo (  ) 

Stop after all matches in the current Repository are processed.

Definition at line 371 of file LookupAttr.cc.

References _dip, and zypp::sat::detail::DIWrap::get().

Repository zypp::sat::LookupAttr::iterator::inRepo (  )  const

Solvable zypp::sat::LookupAttr::iterator::inSolvable (  )  const

SolvAttr zypp::sat::LookupAttr::iterator::inSolvAttr (  )  const

The current SolvAttr.

Definition at line 356 of file LookupAttr.cc.

References _dip, and zypp::sat::SolvAttr::noAttr.

Referenced by zypp::packagedelta::DeltaRpm::DeltaRpm(), zypp::sat::operator<<(), and subFind().

bool zypp::sat::LookupAttr::iterator::atEnd (  )  const [inline]

Whether this points to the end of a query (Iterator is invalid).

Definition at line 408 of file LookupAttr.h.

References _dip.

detail::IdType zypp::sat::LookupAttr::iterator::solvAttrType (  )  const

bool zypp::sat::LookupAttr::iterator::solvAttrNumeric (  )  const

Whether this is a numeric attribute (incl.

boolean).

Definition at line 381 of file LookupAttr.cc.

References solvAttrType().

bool zypp::sat::LookupAttr::iterator::solvAttrString (  )  const

Whether this is a string attribute.

Definition at line 394 of file LookupAttr.cc.

References solvAttrType().

bool zypp::sat::LookupAttr::iterator::solvAttrIdString (  )  const

Whether this string attribute is available as IdString.

Definition at line 409 of file LookupAttr.cc.

References solvAttrType().

bool zypp::sat::LookupAttr::iterator::solvAttrCheckSum (  )  const

Whether this is a CheckSum attribute.

Definition at line 422 of file LookupAttr.cc.

References solvAttrType().

bool zypp::sat::LookupAttr::iterator::solvAttrSubEntry (  )  const

Whether this is the entry to a sub-structure (flexarray).

This is the entry to a sequence of attributes. To acces them use subBegin and subEnd.

Definition at line 452 of file LookupAttr.cc.

References _dip.

Referenced by zypp::sat::operator<<().

bool zypp::sat::LookupAttr::iterator::subEmpty (  )  const

Wheter the sub-structure is empty.

Definition at line 459 of file LookupAttr.cc.

References subBegin(), and subEnd().

LookupAttr::size_type zypp::sat::LookupAttr::iterator::subSize (  )  const

Ammount of attributes in the sub-structure.

Note:
This is not a cheap call. It runs the query.

Definition at line 462 of file LookupAttr.cc.

References for_, subBegin(), and subEnd().

LookupAttr::iterator zypp::sat::LookupAttr::iterator::subBegin (  )  const

Iterator to the begin of a sub-structure.

See also:
solvAttrSubEntry

Definition at line 470 of file LookupAttr.cc.

References _dip, zypp::sat::detail::DIWrap::get(), iterator(), and subEnd().

Referenced by asString(), zypp::packagedelta::DeltaRpm::DeltaRpm(), subEmpty(), subFind(), and subSize().

LookupAttr::iterator zypp::sat::LookupAttr::iterator::subEnd (  )  const

Iterator behind the end of a sub-structure.

See also:
solvAttrSubEntry

Definition at line 492 of file LookupAttr.cc.

References iterator().

Referenced by asString(), zypp::packagedelta::DeltaRpm::DeltaRpm(), subBegin(), subEmpty(), subFind(), and subSize().

LookupAttr::iterator zypp::sat::LookupAttr::iterator::subFind ( SolvAttr  attr_r  )  const

Iterator pointing to the first occurance of SolvAttr attr_r in sub-structure.

If sat::SolvAttr::allAttr is passed, subBegin is returned.

See also:
solvAttrSubEntry

Definition at line 497 of file LookupAttr.cc.

References zypp::sat::SolvAttr::allAttr, inSolvAttr(), subBegin(), and subEnd().

Referenced by subFind().

LookupAttr::iterator zypp::sat::LookupAttr::iterator::subFind ( const C_Str attrname_r  )  const

Definition at line 508 of file LookupAttr.cc.

References _dip, asString(), zypp::C_Str::empty(), inSolvAttr(), subBegin(), and subFind().

int zypp::sat::LookupAttr::iterator::asInt (  )  const

Conversion to numeric types.

Definition at line 543 of file LookupAttr.cc.

References _dip, and solvAttrType().

Referenced by asBool(), asString(), and asUnsigned().

unsigned zypp::sat::LookupAttr::iterator::asUnsigned (  )  const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 559 of file LookupAttr.cc.

References asInt().

bool zypp::sat::LookupAttr::iterator::asBool (  )  const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 562 of file LookupAttr.cc.

References asInt().

const char * zypp::sat::LookupAttr::iterator::c_str (  )  const

Conversion to string types.

Definition at line 566 of file LookupAttr.cc.

References _dip, and solvAttrType().

Referenced by asString().

std::string zypp::sat::LookupAttr::iterator::asString (  )  const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. If used with non-string types, this method tries to create some appropriate string representation.

Definition at line 593 of file LookupAttr.cc.

References _dip, asCheckSum(), asInt(), zypp::CheckSum::asString(), c_str(), for_, zypp::str::numstring(), solvAttrType(), subBegin(), and subEnd().

Referenced by zypp::sat::operator<<(), and subFind().

IdString zypp::sat::LookupAttr::iterator::idStr (  )  const

As IdStr.

This is only done for poolized string types. Large strings like summary or descriptions are not available via IdStr, only via c_str and asString.

Definition at line 648 of file LookupAttr.cc.

References _dip, and solvAttrType().

Referenced by id().

detail::IdType zypp::sat::LookupAttr::iterator::id (  )  const [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 521 of file LookupAttr.h.

References zypp::IdString::id(), and idStr().

CheckSum zypp::sat::LookupAttr::iterator::asCheckSum (  )  const

CheckSum zypp::sat::LookupAttr::iterator::asType< CheckSum > (  )  const [inline]

Templated return type.

Per default assumes an Id based type, so try to construct it from the Id.

Should be specialized for supported types above.

Definition at line 533 of file LookupAttr.h.

Referenced by zypp::sat::LookupAttr::transformIterator< _ResultT, _AttrT >::dereference().

LookupAttr::iterator & zypp::sat::LookupAttr::iterator::operator= ( const iterator rhs  ) 

Definition at line 712 of file LookupAttr.cc.

References _dip, and zypp::sat::detail::DIWrap::get().

template<class OtherDerived , class OtherIterator , class V , class C , class R , class D >
bool zypp::sat::LookupAttr::iterator::equal ( const boost::iterator_adaptor< OtherDerived, OtherIterator, V, C, R, D > &  rhs  )  const [inline, private]

Definition at line 559 of file LookupAttr.h.

References dip_equal().

bool zypp::sat::LookupAttr::iterator::dip_equal ( const ::_Dataiterator &  lhs,
const ::_Dataiterator &  rhs 
) const [private]

Definition at line 724 of file LookupAttr.cc.

Referenced by equal().

detail::IdType zypp::sat::LookupAttr::iterator::dereference (  )  const [private]

Definition at line 731 of file LookupAttr.cc.

References _dip, and zypp::sat::detail::noId().

void zypp::sat::LookupAttr::iterator::increment (  )  [private]

::_Dataiterator* zypp::sat::LookupAttr::iterator::get (  )  const [inline]

Expert backdoor.

Definition at line 573 of file LookupAttr.h.

References _dip, and zypp::sat::detail::DIWrap::get().

Referenced by zypp::sat::operator<<().


Friends And Related Function Documentation

friend class boost::iterator_core_access [friend]

Definition at line 556 of file LookupAttr.h.

std::ostream & operator<< ( std::ostream &  str,
const LookupAttr::iterator obj 
) [related]

Stream output.

Definition at line 746 of file LookupAttr.cc.

template<class _ResultT , class _AttrT >
std::ostream & operator<< ( std::ostream &  str,
const ArrayAttr< _ResultT, _AttrT > &  obj 
) [related]

Stream output.

Definition at line 214 of file LookupAttrTools.h.

References zypp::sat::dumpOn().


Member Data Documentation


The documentation for this class was generated from the following files:

doxygen