libzypp  17.8.1
zypp::sat::LookupAttr::iterator Class Reference

Result iterator. More...

#include <LookupAttr.h>

Inheritance diagram for zypp::sat::LookupAttr::iterator:

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 detail::CDataiterator and doing it's first iteration (::dataiterator_step) More...
 
detail::CDataiteratorget () const
 Expert backdoor. More...
 
template<>
CheckSum asType () const
 
Moving fast forward.
void nextSkipSolvAttr ()
 On the next call to operator++ advance to the next SolvAttr. More...
 
void nextSkipSolvable ()
 On the next call to operator++ advance to the next Solvable. More...
 
void nextSkipRepo ()
 On the next call to operator++ advance to the next Repository. More...
 
void skipSolvAttr ()
 Immediately advance to the next SolvAttr. More...
 
void skipSolvable ()
 Immediately advance to the next Solvable. More...
 
void skipRepo ()
 Immediately advance to the next Repository. More...
 
void stayInThisSolvable ()
 Stop after all matches in the current Solvable are processed. More...
 
void stayInThisRepo ()
 Stop after all matches in the current Repository are processed. More...
 
Current position info.
Repository inRepo () const
 The current Repository. More...
 
Solvable inSolvable () const
 The current Solvable. More...
 
SolvAttr inSolvAttr () const
 The current SolvAttr. More...
 
bool atEnd () const
 Whether this points to the end of a query (Iterator is invalid). More...
 
Test attribute value type.
detail::IdType solvAttrType () const
 The current SolvAttr type. More...
 
bool solvAttrNumeric () const
 Whether this is a numeric attribute (incl. More...
 
bool solvAttrString () const
 Whether this is a string attribute. More...
 
bool solvAttrIdString () const
 Whether this string attribute is available as IdString. More...
 
bool solvAttrCheckSum () const
 Whether this is a CheckSum attribute. More...
 
bool solvAttrSubEntry () const
 Whether this is the entry to a sub-structure (flexarray). More...
 
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
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
 Whether the sub-structure is empty. More...
 
size_type subSize () const
 Ammount of attributes in the sub-structure. More...
 
iterator subBegin () const
 Iterator to the begin of a sub-structure. More...
 
iterator subEnd () const
 Iterator behind the end of a sub-structure. More...
 
iterator subFind (SolvAttr attr_r) const
 Iterator pointing to the first occurance of SolvAttr attr_r in sub-structure. More...
 
iterator subFind (const C_Str &attrname_r) const
 
Retrieving attribute values.
int asInt () const
 Conversion to numeric types. More...
 
unsigned asUnsigned () const
 
bool asBool () const
 
unsigned long long asUnsignedLL () const
 
const char * c_str () const
 Conversion to string types. More...
 
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. More...
 
IdString idStr () const
 As IdStr. More...
 
detail::IdType id () const
 
CheckSum asCheckSum () const
 As CheckSum. More...
 
template<class Tp >
Tp asType () const
 Templated return type. More...
 
Helpers and forward declarations from LookupAttrTools.h
template<>
int asType () const
 
template<>
unsigned asType () const
 
template<>
unsigned long long asType () const
 
template<>
bool asType () const
 
template<>
const char * asType () const
 
template<>
IdString asType () const
 
template<>
CheckSum asType () const
 

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 detail::CDataiterator &lhs, const detail::CDataiterator &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 TResult , class TAttr >
std::ostream & operator<< (std::ostream &str, const ArrayAttr< TResult, TAttr > &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 350 of file LookupAttr.h.

Constructor & Destructor Documentation

◆ iterator() [1/3]

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

Definition at line 718 of file LookupAttr.cc.

◆ iterator() [2/3]

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

Definition at line 722 of file LookupAttr.cc.

◆ ~iterator()

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

Definition at line 737 of file LookupAttr.cc.

◆ iterator() [3/3]

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

C-tor taking over ownership of the passed detail::CDataiterator and doing it's first iteration (::dataiterator_step)

Definition at line 729 of file LookupAttr.cc.

Member Function Documentation

◆ nextSkipSolvAttr()

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

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

Definition at line 360 of file LookupAttr.cc.

◆ nextSkipSolvable()

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

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

Definition at line 363 of file LookupAttr.cc.

◆ nextSkipRepo()

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

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

Definition at line 366 of file LookupAttr.cc.

◆ skipSolvAttr()

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

Immediately advance to the next SolvAttr.

Definition at line 371 of file LookupAttr.h.

◆ skipSolvable()

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

Immediately advance to the next Solvable.

Definition at line 375 of file LookupAttr.h.

◆ skipRepo()

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

Immediately advance to the next Repository.

Definition at line 379 of file LookupAttr.h.

◆ stayInThisSolvable()

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

Stop after all matches in the current Solvable are processed.

Definition at line 369 of file LookupAttr.cc.

◆ stayInThisRepo()

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

Stop after all matches in the current Repository are processed.

Definition at line 372 of file LookupAttr.cc.

◆ inRepo()

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

The current Repository.

Definition at line 351 of file LookupAttr.cc.

◆ inSolvable()

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

The current Solvable.

Definition at line 354 of file LookupAttr.cc.

◆ inSolvAttr()

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

The current SolvAttr.

Definition at line 357 of file LookupAttr.cc.

◆ atEnd()

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

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

Definition at line 401 of file LookupAttr.h.

◆ solvAttrType()

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

The current SolvAttr type.

Definition at line 379 of file LookupAttr.cc.

◆ solvAttrNumeric()

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

Whether this is a numeric attribute (incl.

boolean).

Definition at line 382 of file LookupAttr.cc.

◆ solvAttrString()

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

Whether this is a string attribute.

Definition at line 394 of file LookupAttr.cc.

◆ solvAttrIdString()

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

Whether this string attribute is available as IdString.

Definition at line 409 of file LookupAttr.cc.

◆ solvAttrCheckSum()

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

Whether this is a CheckSum attribute.

Definition at line 422 of file LookupAttr.cc.

◆ solvAttrSubEntry()

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.

◆ subEmpty()

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

Whether the sub-structure is empty.

Definition at line 459 of file LookupAttr.cc.

◆ subSize()

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.

◆ subBegin()

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.

◆ subEnd()

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.

◆ subFind() [1/2]

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.

◆ subFind() [2/2]

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

Definition at line 508 of file LookupAttr.cc.

◆ asInt()

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

Conversion to numeric types.

Definition at line 543 of file LookupAttr.cc.

◆ 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 558 of file LookupAttr.cc.

◆ asBool()

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 576 of file LookupAttr.cc.

◆ asUnsignedLL()

unsigned long long zypp::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 561 of file LookupAttr.cc.

◆ c_str()

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

Conversion to string types.

Definition at line 580 of file LookupAttr.cc.

◆ 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 610 of file LookupAttr.cc.

◆ idStr()

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 664 of file LookupAttr.cc.

◆ 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 516 of file LookupAttr.h.

◆ asCheckSum()

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

As CheckSum.

Definition at line 680 of file LookupAttr.cc.

◆ asType() [1/9]

template<class Tp >
Tp zypp::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 528 of file LookupAttr.h.

◆ operator=()

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

Definition at line 740 of file LookupAttr.cc.

◆ equal()

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
inlineprivate

Definition at line 554 of file LookupAttr.h.

◆ dip_equal()

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

Definition at line 752 of file LookupAttr.cc.

◆ dereference()

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

Definition at line 759 of file LookupAttr.cc.

◆ increment()

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

Definition at line 765 of file LookupAttr.cc.

◆ get()

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

Expert backdoor.

Definition at line 568 of file LookupAttr.h.

◆ asType() [2/9]

template<>
CheckSum zypp::sat::LookupAttr::iterator::asType ( ) const

Definition at line 797 of file LookupAttr.cc.

◆ asType() [3/9]

template<>
int zypp::sat::LookupAttr::iterator::asType ( ) const
inline

Definition at line 582 of file LookupAttr.h.

◆ asType() [4/9]

template<>
unsigned zypp::sat::LookupAttr::iterator::asType ( ) const
inline

Definition at line 583 of file LookupAttr.h.

◆ asType() [5/9]

template<>
unsigned long long zypp::sat::LookupAttr::iterator::asType ( ) const
inline

Definition at line 584 of file LookupAttr.h.

◆ asType() [6/9]

template<>
bool zypp::sat::LookupAttr::iterator::asType ( ) const
inline

Definition at line 585 of file LookupAttr.h.

◆ asType() [7/9]

template<>
const char* zypp::sat::LookupAttr::iterator::asType ( ) const
inline

Definition at line 586 of file LookupAttr.h.

◆ asType() [8/9]

template<>
IdString zypp::sat::LookupAttr::iterator::asType ( ) const
inline

Definition at line 588 of file LookupAttr.h.

◆ asType() [9/9]

template<>
CheckSum zypp::sat::LookupAttr::iterator::asType ( ) const

Friends And Related Function Documentation

◆ boost::iterator_core_access

friend class boost::iterator_core_access
friend

Definition at line 551 of file LookupAttr.h.

◆ operator<<() [1/2]

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

Stream output.

Definition at line 781 of file LookupAttr.cc.

◆ operator<<() [2/2]

template<class TResult , class TAttr >
std::ostream & operator<< ( std::ostream &  str,
const ArrayAttr< TResult, TAttr > &  obj 
)
related

Stream output.

Definition at line 214 of file LookupAttrTools.h.

Member Data Documentation

◆ _dip

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

Definition at line 571 of file LookupAttr.h.


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