libzypp 17.31.23
zypp::sat::Queue Class Reference

Libsolv Id queue wrapper. More...

#include <sat/Queue.h>

Inheritance diagram for zypp::sat::Queue:

Public Types

typedef unsigned size_type
 
typedef detail::IdType value_type
 
typedef const value_typeconst_iterator
 

Public Member Functions

 Queue ()
 Default ctor: empty Queue.
 
 ~Queue ()
 Dtor.
 
bool empty () const
 
size_type size () const
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator find (value_type val_r) const
 Return iterator to the 1st occurance of val_r or end.
 
bool contains (value_type val_r) const
 Return whether the Queue contais at lest one element with value val_r.
 
value_type first () const
 Return the 1st Id in the queue or 0 if empty.
 
value_type last () const
 Return the last Id in the queue or 0 if empty.
 
const value_typeat (size_type idx_r) const
 Return the Id at idx_r in the queue.
 
value_typeat (size_type idx_r)
 Return the Id at idx_r in the queue.
 
const value_typeoperator[] (size_type idx_r) const
 Return the Id at idx_r in the queue (no range check)
 
value_typeoperator[] (size_type idx_r)
 Return the Id at idx_r in the queue (no range check)
 
void clear ()
 Clear the queue.
 
void remove (value_type val_r)
 Remove all occurances of val_r from the queue.
 
void push (value_type val_r)
 Push a value to the end off the Queue.
 
void push_back (value_type val_r)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void pushUnique (value_type val_r)
 Push a value if it's not yet in the Queue.
 
value_type pop ()
 Pop and return the last Id from the queue or 0 if empty.
 
value_type pop_back ()
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void push_front (value_type val_r)
 Push a value to the beginning off the Queue.
 
value_type pop_front ()
 Pop and return the 1st Id from the queue or 0 if empty.
 
 operator detail::CQueue * ()
 libsolv backdoor
 
 operator const detail::CQueue * () const
 < libsolv backdoor
 

Private Attributes

RWCOW_pointer< detail::CQueue_pimpl
 Pointer to implementation.
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &str, const Queue &obj)
 Stream output.
 
std::ostream & dumpOn (std::ostream &str, const Queue &obj)
 Stream output assuming a Solvable queue.
 
bool operator== (const Queue &lhs, const Queue &rhs)
 
bool operator!= (const Queue &lhs, const Queue &rhs)
 

Detailed Description

Libsolv Id queue wrapper.

Todo:
template value_type to work with IString and other Id based types

Definition at line 34 of file Queue.h.

Member Typedef Documentation

◆ size_type

typedef unsigned zypp::sat::Queue::size_type

Definition at line 37 of file Queue.h.

◆ value_type

Definition at line 38 of file Queue.h.

◆ const_iterator

Definition at line 39 of file Queue.h.

Constructor & Destructor Documentation

◆ Queue()

zypp::sat::Queue::Queue ( )

Default ctor: empty Queue.

Definition at line 39 of file Queue.cc.

◆ ~Queue()

zypp::sat::Queue::~Queue ( )

Dtor.

Definition at line 43 of file Queue.cc.

Member Function Documentation

◆ empty()

bool zypp::sat::Queue::empty ( ) const

Definition at line 46 of file Queue.cc.

◆ size()

Queue::size_type zypp::sat::Queue::size ( ) const

Definition at line 49 of file Queue.cc.

◆ begin()

Queue::const_iterator zypp::sat::Queue::begin ( ) const

Definition at line 52 of file Queue.cc.

◆ end()

Queue::const_iterator zypp::sat::Queue::end ( ) const

Definition at line 55 of file Queue.cc.

◆ find()

Queue::const_iterator zypp::sat::Queue::find ( value_type  val_r) const

Return iterator to the 1st occurance of val_r or end.

Definition at line 58 of file Queue.cc.

◆ contains()

bool zypp::sat::Queue::contains ( value_type  val_r) const
inline

Return whether the Queue contais at lest one element with value val_r.

Definition at line 57 of file Queue.h.

◆ first()

Queue::value_type zypp::sat::Queue::first ( ) const

Return the 1st Id in the queue or 0 if empty.

Definition at line 66 of file Queue.cc.

◆ last()

Queue::value_type zypp::sat::Queue::last ( ) const

Return the last Id in the queue or 0 if empty.

Definition at line 73 of file Queue.cc.

◆ at() [1/2]

const Queue::value_type & zypp::sat::Queue::at ( size_type  idx_r) const

Return the Id at idx_r in the queue.

Exceptions
std::out_of_rangeif idx_r is out of range

Definition at line 82 of file Queue.cc.

◆ at() [2/2]

Queue::value_type & zypp::sat::Queue::at ( size_type  idx_r)

Return the Id at idx_r in the queue.

Exceptions
std::out_of_rangeif idx_r is out of range

Definition at line 85 of file Queue.cc.

◆ operator[]() [1/2]

const Queue::value_type & zypp::sat::Queue::operator[] ( size_type  idx_r) const

Return the Id at idx_r in the queue (no range check)

Definition at line 88 of file Queue.cc.

◆ operator[]() [2/2]

Queue::value_type & zypp::sat::Queue::operator[] ( size_type  idx_r)

Return the Id at idx_r in the queue (no range check)

Definition at line 91 of file Queue.cc.

◆ clear()

void zypp::sat::Queue::clear ( )

Clear the queue.

Definition at line 94 of file Queue.cc.

◆ remove()

void zypp::sat::Queue::remove ( value_type  val_r)

Remove all occurances of val_r from the queue.

Definition at line 97 of file Queue.cc.

◆ push()

void zypp::sat::Queue::push ( value_type  val_r)

Push a value to the end off the Queue.

Definition at line 103 of file Queue.cc.

◆ push_back()

void zypp::sat::Queue::push_back ( value_type  val_r)
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 91 of file Queue.h.

◆ pushUnique()

void zypp::sat::Queue::pushUnique ( value_type  val_r)

Push a value if it's not yet in the Queue.

Definition at line 106 of file Queue.cc.

◆ pop()

Queue::value_type zypp::sat::Queue::pop ( )

Pop and return the last Id from the queue or 0 if empty.

Definition at line 109 of file Queue.cc.

◆ pop_back()

value_type zypp::sat::Queue::pop_back ( )
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 100 of file Queue.h.

◆ push_front()

void zypp::sat::Queue::push_front ( value_type  val_r)

Push a value to the beginning off the Queue.

Definition at line 112 of file Queue.cc.

◆ pop_front()

Queue::value_type zypp::sat::Queue::pop_front ( )

Pop and return the 1st Id from the queue or 0 if empty.

Definition at line 115 of file Queue.cc.

◆ operator detail::CQueue *()

zypp::sat::Queue::operator detail::CQueue * ( )

libsolv backdoor

Definition at line 118 of file Queue.cc.

◆ operator const detail::CQueue *()

zypp::sat::Queue::operator const detail::CQueue * ( ) const
inline

< libsolv backdoor

Definition at line 111 of file Queue.h.

Friends And Related Function Documentation

◆ operator<<()

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

Stream output.

Definition at line 121 of file Queue.cc.

◆ dumpOn()

std::ostream & dumpOn ( std::ostream &  str,
const Queue obj 
)
related

Stream output assuming a Solvable queue.

Definition at line 124 of file Queue.cc.

◆ operator==()

bool operator== ( const Queue lhs,
const Queue rhs 
)
related

Definition at line 136 of file Queue.cc.

◆ operator!=()

bool operator!= ( const Queue lhs,
const Queue rhs 
)
related

Definition at line 127 of file Queue.h.

Member Data Documentation

◆ _pimpl

RWCOW_pointer<detail::CQueue> zypp::sat::Queue::_pimpl
private

Pointer to implementation.

Definition at line 114 of file Queue.h.


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