libzypp 17.38.6
zyppng::sat::LookupAttr::iterator Class Reference

Result iterator. More...

#include <zypp/ng/sat/lookupattr.h>

Inheritance diagram for zyppng::sat::LookupAttr::iterator:

Public Member Functions

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 libsolv 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
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:
if ( it != res.subEnd() )
cout << it.asString() << endl;
}
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Definition Easy.h:27
Lightweight attribute value lookup.
Definition lookupattr.h:112
static const SolvAttr updateReferenceHref
Definition SolvAttr.h:143
static const SolvAttr updateReference
Definition SolvAttr.h:141
bool subEmpty () const
 Whether 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 (const SolvAttr &attr_r) const
 Iterator pointing to the first occurance of SolvAttr attr_r in sub-structure.
iterator subFind (const zypp::C_Str &attrname_r) const

Retrieving attribute values.

class boost::iterator_core_access
detail::DIWrap _dip
int asInt () const
 Conversion to numeric types.
unsigned asUnsigned () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
bool asBool () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
unsigned long long asUnsignedLL () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
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 IdString.
detail::IdType id () const
CheckSum asCheckSum () const
 As CheckSum.
template<class Tp>
Tp asType () const
 Templated return type.
 iterator ()
 iterator (const iterator &rhs)
iteratoroperator= (const iterator &rhs)
 ~iterator ()
 iterator (detail::DIWrap &dip_r)
 C-tor taking over ownership of the passed detail::CDataiterator and doing its first iteration (::dataiterator_step).
detail::CDataiteratorget () const
 Expert backdoor.
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 detail::CDataiterator &lhs, const detail::CDataiterator &rhs) const
detail::IdType dereference () const
void increment ()

Detailed Description

Result iterator.

Extended iterator methods valid only if not @end.

Note
Implementation: Keep iterator_adaptor base and _dip in sync!

Definition at line 348 of file lookupattr.h.

Constructor & Destructor Documentation

◆ iterator() [1/3]

zyppng::sat::LookupAttr::iterator::iterator ( )

Definition at line 670 of file lookupattr.cc.

◆ iterator() [2/3]

zyppng::sat::LookupAttr::iterator::iterator ( const iterator & rhs)

Definition at line 674 of file lookupattr.cc.

◆ ~iterator()

zyppng::sat::LookupAttr::iterator::~iterator ( )

Definition at line 689 of file lookupattr.cc.

◆ iterator() [3/3]

zyppng::sat::LookupAttr::iterator::iterator ( detail::DIWrap & dip_r)

C-tor taking over ownership of the passed detail::CDataiterator and doing its first iteration (::dataiterator_step).

Definition at line 681 of file lookupattr.cc.

Member Function Documentation

◆ nextSkipSolvAttr()

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

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

Definition at line 330 of file lookupattr.cc.

◆ nextSkipSolvable()

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

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

Definition at line 333 of file lookupattr.cc.

◆ nextSkipRepo()

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

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

Definition at line 336 of file lookupattr.cc.

◆ skipSolvAttr()

void zyppng::sat::LookupAttr::iterator::skipSolvAttr ( )
inline

Immediately advance to the next SolvAttr.

Definition at line 369 of file lookupattr.h.

◆ skipSolvable()

void zyppng::sat::LookupAttr::iterator::skipSolvable ( )
inline

Immediately advance to the next Solvable.

Definition at line 373 of file lookupattr.h.

◆ skipRepo()

void zyppng::sat::LookupAttr::iterator::skipRepo ( )
inline

Immediately advance to the next Repository.

Definition at line 377 of file lookupattr.h.

◆ stayInThisSolvable()

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

Stop after all matches in the current Solvable are processed.

Definition at line 339 of file lookupattr.cc.

◆ stayInThisRepo()

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

Stop after all matches in the current Repository are processed.

Definition at line 342 of file lookupattr.cc.

◆ inRepo()

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

The current Repository.

CLASS NAME : LookupAttr::iterator.

Definition at line 321 of file lookupattr.cc.

◆ inSolvable()

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

The current Solvable.

Definition at line 324 of file lookupattr.cc.

◆ inSolvAttr()

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

The current SolvAttr.

Definition at line 327 of file lookupattr.cc.

◆ atEnd()

bool zyppng::sat::LookupAttr::iterator::atEnd ( ) const
inline

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

Definition at line 399 of file lookupattr.h.

◆ solvAttrType()

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

The current SolvAttr type.

Definition at line 345 of file lookupattr.cc.

◆ solvAttrNumeric()

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

Whether this is a numeric attribute (incl.

boolean).

Definition at line 348 of file lookupattr.cc.

◆ solvAttrString()

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

Whether this is a string attribute.

Definition at line 360 of file lookupattr.cc.

◆ solvAttrIdString()

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

Whether this string attribute is available as IdString.

Definition at line 375 of file lookupattr.cc.

◆ solvAttrCheckSum()

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

Whether this is a CheckSum attribute.

Definition at line 388 of file lookupattr.cc.

◆ solvAttrSubEntry()

bool zyppng::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 416 of file lookupattr.cc.

◆ subEmpty()

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

Whether the sub-structure is empty.

Definition at line 419 of file lookupattr.cc.

◆ subSize()

LookupAttr::size_type zyppng::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 422 of file lookupattr.cc.

◆ subBegin()

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

Iterator to the begin of a sub-structure.

See also
solvAttrSubEntry

Definition at line 430 of file lookupattr.cc.

◆ subEnd()

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

Iterator behind the end of a sub-structure.

See also
solvAttrSubEntry

Definition at line 452 of file lookupattr.cc.

◆ subFind() [1/2]

LookupAttr::iterator zyppng::sat::LookupAttr::iterator::subFind ( const 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 457 of file lookupattr.cc.

◆ subFind() [2/2]

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

Definition at line 468 of file lookupattr.cc.

◆ asInt()

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

Conversion to numeric types.

Definition at line 499 of file lookupattr.cc.

◆ asUnsigned()

unsigned zyppng::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 514 of file lookupattr.cc.

◆ asBool()

bool zyppng::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 532 of file lookupattr.cc.

◆ asUnsignedLL()

unsigned long long zyppng::sat::LookupAttr::iterator::asUnsignedLL ( ) 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 517 of file lookupattr.cc.

◆ c_str()

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

Conversion to string types.

Definition at line 536 of file lookupattr.cc.

◆ asString()

std::string zyppng::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 566 of file lookupattr.cc.

◆ idStr()

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

As IdString.

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

Definition at line 620 of file lookupattr.cc.

◆ id()

detail::IdType zyppng::sat::LookupAttr::iterator::id ( ) const
inline

Definition at line 515 of file lookupattr.h.

◆ asCheckSum()

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

As CheckSum.

Definition at line 636 of file lookupattr.cc.

◆ asType()

template<class Tp>
Tp zyppng::sat::LookupAttr::iterator::asType ( ) 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 527 of file lookupattr.h.

◆ operator=()

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

Definition at line 692 of file lookupattr.cc.

◆ equal()

template<class OtherDerived, class OtherIterator, class V, class C, class R, class D>
bool zyppng::sat::LookupAttr::iterator::equal ( const boost::iterator_adaptor< OtherDerived, OtherIterator, V, C, R, D > & rhs) const
inlineprivate

Definition at line 550 of file lookupattr.h.

◆ dip_equal()

bool zyppng::sat::LookupAttr::iterator::dip_equal ( const detail::CDataiterator & lhs,
const detail::CDataiterator & rhs ) const
private

Definition at line 702 of file lookupattr.cc.

◆ dereference()

detail::IdType zyppng::sat::LookupAttr::iterator::dereference ( ) const
private

Definition at line 709 of file lookupattr.cc.

◆ increment()

void zyppng::sat::LookupAttr::iterator::increment ( )
private

Definition at line 715 of file lookupattr.cc.

◆ get()

detail::CDataiterator * zyppng::sat::LookupAttr::iterator::get ( ) const
inline

Expert backdoor.

Definition at line 564 of file lookupattr.h.

◆ boost::iterator_core_access

friend class boost::iterator_core_access
friend

Definition at line 547 of file lookupattr.h.

Member Data Documentation

◆ _dip

detail::DIWrap zyppng::sat::LookupAttr::iterator::_dip
private

Definition at line 567 of file lookupattr.h.


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