libzypp  17.25.1
zypp::detail::PoolQueryIterator Class Reference

PoolQuery iterator as returned by PoolQuery::begin. More...

#include <PoolQuery.h>

Inheritance diagram for zypp::detail::PoolQueryIterator:

Public Types

typedef Matches::size_type size_type
typedef Matches::const_iterator matches_iterator

Public Member Functions

 PoolQueryIterator ()
 Default ctor is also end. More...
 PoolQueryIterator (const shared_ptr< PoolQueryMatcher > &matcher_r)
 \Ref PoolQuery ctor. More...

Private Types

typedef std::vector< sat::LookupAttr::iteratorMatches

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &str, const PoolQueryIterator &obj)
std::ostream & dumpOn (std::ostream &str, const PoolQueryIterator &obj)

Detailed inspection of attribute matches within the current Solvable.

The matches_iterator visits all attribute matches within the current Solvable, providing a sat::LookupAttr::iterator pointing to attribute.

While a matches_iterator itself becomes invalid if the PoolQueryIterator is advanced, the sat::LookupAttr::iterator it pointed to stays valid, even after the query ended.

// Setup query for "libzypp" in name or requires:
PoolQuery q;
q.addString( "libzypp" );
q.setCaseSensitive( false );
q.addAttribute( sat::SolvAttr::name );
q.addDependency( sat::SolvAttr::requires );
// Iterate the result:
for_( solvIter, q.begin(), q.end() )
sat::Solvable solvable( *solvIter );
cout << "Found matches in " << solvable << endl;
if ( verbose )
for_( attrIter, solvIter.matchesBegin(), solvIter.matchesEnd() )
sat::LookupAttr::iterator attr( *attrIter );
cout << " " << attr.inSolvAttr() << "\t\"" << attr.asString() << "\"" << endl;
Found matches in PackageKit-0.3.11-1.12.i586(@System)
solvable:requires ""
Found matches in libqdialogsolver1-1.2.6-1.1.2.i586(@System)
solvable:requires ""
solvable:requires "libzypp >= 5.25.3-0.1.2"
Found matches in libzypp-5.30.3-0.1.1.i586(@System)
solvable:name "libzypp"
Found matches in libzypp-testsuite-tools-4.2.6-8.1.i586(@System)
solvable:name "libzypp-testsuite-tools"
solvable:requires ""
class boost::iterator_core_access
shared_ptr< PoolQueryMatcher_matcher
shared_ptr< Matches_matches
bool matchesEmpty () const
 False unless this is the end iterator. More...
size_type matchesSize () const
 Number of attribute matches. More...
matches_iterator matchesBegin () const
 Begin of matches. More...
matches_iterator matchesEnd () const
 End of matches. More...
sat::Solvable dereference () const
void increment ()
const Matchesmatches () const

Detailed Description

PoolQuery iterator as returned by PoolQuery::begin.

The PoolQueryIterator visits sat::Solavables that do contain matches.

But it also provides an iterator by itself, to allow a detailed inspection of the individual attribute matches within the current Solvable.

Definition at line 509 of file PoolQuery.h.

Member Typedef Documentation

◆ Matches

Definition at line 517 of file PoolQuery.h.

◆ size_type

typedef Matches::size_type zypp::detail::PoolQueryIterator::size_type

Definition at line 519 of file PoolQuery.h.

◆ matches_iterator

typedef Matches::const_iterator zypp::detail::PoolQueryIterator::matches_iterator

Definition at line 520 of file PoolQuery.h.

Constructor & Destructor Documentation

◆ PoolQueryIterator() [1/2]

zypp::detail::PoolQueryIterator::PoolQueryIterator ( )

Default ctor is also end.

Definition at line 523 of file PoolQuery.h.

◆ PoolQueryIterator() [2/2]

zypp::detail::PoolQueryIterator::PoolQueryIterator ( const shared_ptr< PoolQueryMatcher > &  matcher_r)

\Ref PoolQuery ctor.

Definition at line 527 of file PoolQuery.h.

Member Function Documentation

◆ matchesEmpty()

bool zypp::detail::PoolQueryIterator::matchesEmpty ( ) const

False unless this is the end iterator.

Definition at line 577 of file PoolQuery.h.

◆ matchesSize()

size_type zypp::detail::PoolQueryIterator::matchesSize ( ) const

Number of attribute matches.

Definition at line 579 of file PoolQuery.h.

◆ matchesBegin()

matches_iterator zypp::detail::PoolQueryIterator::matchesBegin ( ) const

Begin of matches.

Definition at line 581 of file PoolQuery.h.

◆ matchesEnd()

matches_iterator zypp::detail::PoolQueryIterator::matchesEnd ( ) const

End of matches.

Definition at line 583 of file PoolQuery.h.

◆ dereference()

sat::Solvable zypp::detail::PoolQueryIterator::dereference ( ) const

Definition at line 589 of file PoolQuery.h.

◆ increment()

void zypp::detail::PoolQueryIterator::increment ( )

Definition at line 1779 of file

◆ matches()

const PoolQueryIterator::Matches & zypp::detail::PoolQueryIterator::matches ( ) const

Definition at line 1792 of file

Friends And Related Function Documentation

◆ boost::iterator_core_access

friend class boost::iterator_core_access

Definition at line 587 of file PoolQuery.h.

◆ operator<<()

std::ostream & operator<< ( std::ostream &  str,
const PoolQueryIterator obj 

Stream output.

Definition at line 604 of file PoolQuery.h.

◆ dumpOn()

std::ostream & dumpOn ( std::ostream &  str,
const PoolQueryIterator obj 

Detailed stream output.

Definition at line 1809 of file

Member Data Documentation

◆ _matcher

shared_ptr<PoolQueryMatcher> zypp::detail::PoolQueryIterator::_matcher

Definition at line 598 of file PoolQuery.h.

◆ _matches

shared_ptr<Matches> zypp::detail::PoolQueryIterator::_matches

Definition at line 599 of file PoolQuery.h.

The documentation for this class was generated from the following files:
sat::SolvAttr attr
const Matches & matches() const
static const SolvAttr name
Definition: SolvAttr.h:52
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Definition: Easy.h:28
static const SolvAttr requires
Definition: SolvAttr.h:63