16#include <solv/queue.h>
48 { ::queue_init(
_pimpl.get() ); }
51 { ::queue_free(
_pimpl.get() ); }
54 {
return(
_pimpl->count == 0 ); }
60 {
return _pimpl->elements; }
67 auto it = ranges::find( *
this, val_r );
68 return it !=
end() ? it :
end();
85#define M_RANGE_CKECK(IDX,LOC) if ( IDX >= size_type(_pimpl->count) ) throw std::out_of_range( "zypp::sat::Queue::" LOC )
94 {
return _pimpl->elements[idx_r]; }
97 {
return _pimpl->elements[idx_r]; }
100 { ::queue_empty( *
this ); }
109 { ::queue_push(
_pimpl.get(), val_r ); }
112 { ::queue_pushunique(
_pimpl.get(), val_r ); }
115 { return ::queue_pop(
_pimpl.get() ); }
118 { ::queue_unshift(
_pimpl.get(), val_r ); }
121 { return ::queue_shift(
_pimpl.get() ); }
130 return( l == r || ( l->count == r->count && ::memcmp( l->elements, r->elements, l->count *
sizeof( *l->elements ) ) == 0 ) );
#define M_RANGE_CKECK(IDX, LOC)
const_iterator find(value_type val_r) const
Return iterator to the 1st occurance of val_r or end.
value_type pop_front()
Pop and return the 1st Id from the queue or 0 if empty.
void remove(value_type val_r)
Remove all occurances of val_r from the queue.
value_type first() const
Return the 1st Id in the queue or 0 if empty.
void push_front(value_type val_r)
Push a value to the beginning off the Queue.
value_type last() const
Return the last Id in the queue or 0 if empty.
const_iterator end() const
Queue()
Default ctor: empty Queue.
const_iterator begin() const
value_type pop()
Pop and return the last Id from the queue or 0 if empty.
void clear()
Clear the queue.
const value_type & operator[](size_type idx_r) const
Return the Id at idx_r in the queue (no range check).
const value_type & at(size_type idx_r) const
Return the Id at idx_r in the queue.
void push(value_type val_r)
Push a value to the end off the Queue.
void pushUnique(value_type val_r)
Push a value if it's not yet in the Queue.
Libsolv Id queue wrapper.
const value_type * const_iterator
const_iterator find(value_type val_r) const
Return iterator to the 1st occurance of val_r or end.
detail::IdType value_type
const_iterator end() const
const_iterator begin() const
zypp::RWCOW_pointer< zypp::sat::detail::CQueue > _pimpl
Pointer to implementation.
::s_Queue CQueue
Wrapped libsolv C data type exposed as backdoor.
bool operator==(const FileConflicts &lhs, const FileConflicts &rhs)
relates: FileConflicts
Easy-to use interface to the ZYPP dependency resolver.
sat::detail::CQueue * rwcowClone< sat::detail::CQueue >(const sat::detail::CQueue *rhs)
relates: Queue Clone function for RWCOW_pointer
CLASS NAME : detail::DIWrap.
zypp::sat::detail::CQueue CQueue
This file contains private API, this might break at any time between releases.
Namespace routing for C++20 ranges and C++23 ranges::to<T>() backport.