The parameterized class Queue<E> implements list-based queues. More...
#include <ogdf/basic/Queue.h>
Public Types | |
using | const_iterator = SListConstIterator< E > |
Provides a forward iterator that can read a const element in a queue. More... | |
using | const_reference = const E & |
Provides a reference to a const element stored in a queue for reading and performing const operations. More... | |
using | iterator = SListIterator< E > |
Provides a forward iterator that can read or modify any element in a queue. More... | |
using | reference = E & |
Provides a reference to an element stored in a queue. More... | |
using | value_type = E |
Represents the data type stored in a queue element. More... | |
Public Member Functions | |
Queue () | |
Constructs an empty queue. More... | |
Queue (const Queue< E > &Q) | |
Constructs a queue that is a copy of Q . More... | |
Queue (Queue< E > &&Q) | |
Constructs a queue containing the elements of Q (move semantics). More... | |
Queue (std::initializer_list< E > initList) | |
Constructs a queue and appends the elements in initList to it. More... | |
~Queue () | |
Destruction. More... | |
Access methods | |
These methods provide simple access without changing the list. | |
bool | empty () const |
Returns true iff the queue is empty. More... | |
int | size () const |
Returns the number of elements in the queue. More... | |
const_reference | top () const |
Returns a reference to the front element. More... | |
reference | top () |
Returns a reference to the front element. More... | |
const_reference | bottom () const |
Returns a reference to the back element. More... | |
reference | bottom () |
Returns a reference to the back element. More... | |
Iterators | |
These methods return forward iterators to elements in the queue. | |
iterator | begin () |
Returns an iterator to the first element of the queue. More... | |
const_iterator | begin () const |
Returns a const iterator to the first element of the queue. More... | |
const_iterator | cbegin () const |
Returns a const iterator to the first element of the queue. More... | |
iterator | end () |
Returns an iterator to one-past-last element of the queue. More... | |
const_iterator | end () const |
Returns a const iterator to one-past-last element of the queue. More... | |
const_iterator | cend () const |
Returns a const iterator to one-past-last element of the queue. More... | |
iterator | backIterator () |
Returns an iterator to the last element of the queue. More... | |
const_iterator | backIterator () const |
Returns a const iterator to the last element of the queue. More... | |
Operators | |
The following operators are provided by lists. | |
Queue< E > & | operator= (const Queue< E > &Q) |
Assignment operator. More... | |
Queue< E > & | operator= (Queue< E > &&Q) |
Assignment operator (move semantics). More... | |
const SList< E > & | getList () const |
Conversion to const SList. More... | |
Adding and removing elements | |
These method add elements to the list and remove elements from the list. | |
iterator | append (const E &x) |
Adds x at the end of queue. More... | |
template<class... Args> | |
iterator | emplace (Args &&... args) |
Adds a new element at the end of the queue. More... | |
E | pop () |
Removes front element and returns it. More... | |
void | clear () |
Makes the queue empty. More... | |
Additional Inherited Members | |
Private Member Functions inherited from ogdf::SList< E > | |
SList () | |
Constructs an empty singly linked list. More... | |
SList (const SList< E > &L) | |
Constructs a singly linked list that is a copy of L . More... | |
SList (SList< E > &&L) noexcept | |
Constructs a singly linked list containing the elements of L (move semantics). More... | |
SList (std::initializer_list< E > init) | |
Constructs a singly linked list containing the elements in init . More... | |
int | size () const |
Returns the number of elements in the list. More... | |
const SListPure< E > & | getSListPure () const |
Conversion to const SListPure. More... | |
SList< E > & | operator= (const SList< E > &L) |
Assignment operator. More... | |
SList< E > & | operator= (SList< E > &&L) |
Assignment operator (move semantics). More... | |
bool | operator== (const SList< E > &L) const |
Equality operator. More... | |
bool | operator!= (const SList< E > &L) const |
Inequality operator. More... | |
SListIterator< E > | pushFront (const E &x) |
Adds element x at the beginning of the list. More... | |
template<class... Args> | |
iterator | emplaceFront (Args &&... args) |
Adds a new element at the beginning of the list. More... | |
SListIterator< E > | pushBack (const E &x) |
Adds element x at the end of the list. More... | |
template<class... Args> | |
iterator | emplaceBack (Args &&... args) |
Adds a new element at the end of the list. More... | |
SListIterator< E > | insertAfter (const E &x, SListIterator< E > itBefore) |
Inserts element x after itBefore . More... | |
void | popFront () |
Removes the first element from the list. More... | |
E | popFrontRet () |
Removes the first element from the list and returns it. More... | |
void | delSucc (SListIterator< E > itBefore) |
Removes the succesor of itBefore . More... | |
void | clear () |
Removes all elements from the list. More... | |
void | moveFrontToFront (SList< E > &L2) |
Moves the first element of this list to the begin of list L2 . More... | |
void | moveFrontToBack (SList< E > &L2) |
Moves the first element of this list to the end of list L2 . More... | |
void | moveFrontToSucc (SList< E > &L2, SListIterator< E > itBefore) |
Moves the first element of this list to list L2 inserted after itBefore . More... | |
void | conc (SList< E > &L2) |
Appends L2 to this list and makes L2 empty. More... | |
The parameterized class Queue<E> implements list-based queues.
In contrast to QueuePure<E>, instances of Queue<E> store the number of elements contained in the queue.
E | is the element type. |
using ogdf::Queue< E >::const_iterator = SListConstIterator<E> |
using ogdf::Queue< E >::const_reference = const E& |
using ogdf::Queue< E >::iterator = SListIterator<E> |
using ogdf::Queue< E >::reference = E& |
using ogdf::Queue< E >::value_type = E |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
Returns the number of elements in the queue.
Reimplemented from ogdf::SListPure< E >.
|
inline |
|
inline |