185 template<
class ... Args>
230 Queue(std::initializer_list<E> initList) :
SList<E>(initList) { }
351 template<
class ... Args>
385 ostream &operator<<(ostream &os, const QueuePure<E> &Q)
387 print(os,Q);
return os;
391 ostream &operator<<(ostream &os, const Queue<E> &Q)
393 print(os,Q);
return os;
Declaration of singly linked lists and iterators.
int size() const
Returns the number of elements in the queue.
const_iterator begin() const
Returns a const iterator to the first element of the queue.
const_iterator cbegin() const
Returns a const iterator to the first element of the list.
const_iterator cend() const
Returns a const iterator to one-past-last element of the queue.
The parameterized class Queue<E> implements list-based queues.
iterator append(const E &x)
Adds x at the end of queue.
const_iterator crbegin() const
Returns a const iterator to the last element of the queue.
const_reference back() const
Returns a reference to the last element.
bool empty() const
Returns true iff the list is empty.
const_iterator rbegin() const
Returns a const iterator to the last element of the queue.
Queue< E > & operator=(const Queue< E > &Q)
Assignment operator.
iterator append(const E &x)
Adds x at the end of queue.
int size() const
Returns the number of elements in the list.
const_reference bottom() const
Returns a reference to the back element.
QueuePure()
Constructs an empty queue.
Queue(std::initializer_list< E > initList)
Constructs a queue and appends the elements in initList to it.
const_iterator end() const
Returns a const iterator to one-past-last element of the queue.
const_iterator crbegin() const
Returns a const iterator to the last element of the list.
const_iterator rbegin() const
Returns a const iterator to the last element of the queue.
Implementation of list-based queues.
E & reference
Provides a reference to an element stored in a queue.
void clear()
Makes the queue empty.
Encapsulates a pointer to an ogdf::SList element.
const E & const_reference
Provides a reference to a const element stored in a queue for reading and performing const operations...
QueuePure(std::initializer_list< E > initList)
Constructs a queue and appends the elements in initList to it.
E value_type
Represents the data type stored in a queue element.
E pop()
Removes front element and returns it.
iterator emplaceBack(Args &&... args)
Adds a new element at the end of the list.
reference top()
Returns a reference to the front element.
const E & const_reference
Provides a reference to a const element stored in a queue for reading and performing const operations...
Singly linked lists (maintaining the length of the list).
iterator rbegin()
Returns an iterator to the last element of the queue.
Queue()
Constructs an empty queue.
QueuePure< E > & operator=(const QueuePure< E > &Q)
Assignment operator.
iterator begin()
Returns an iterator to the first element of the queue.
iterator begin()
Returns an iterator to the first element of the list.
bool empty() const
Returns true iff the queue is empty.
SList< E > & operator=(const SList< E > &L)
Assignment operator.
iterator pushBack(const E &x)
Adds element x at the end of the list.
Queue(const Queue< E > &Q)
Constructs a queue that is a copy of Q.
iterator emplace(Args &&... args)
Adds a new element at the end of the queue.
Queue< E > & operator=(Queue< E > &&Q)
Assignment operator (move semantics).
iterator emplaceBack(Args &&... args)
Adds a new element at the end of the list.
const_iterator begin() const
Returns a const iterator to the first element of the queue.
const SList< E > & getList() const
Conversion to const SList.
iterator rbegin()
Returns an iterator to the last element of the queue.
void popFront()
Removes the first element from the list.
bool empty() const
Returns true iff the queue is empty.
const_reference front() const
Returns a reference to the first element.
#define OGDF_NEW_DELETE
Makes the class use OGDF's memory allocator.
const_iterator end() const
Returns a const iterator to one-past-last element of the queue.
const T & move(const T &v)
reference bottom()
Returns a reference to the back element.
const_iterator cbegin() const
Returns a const iterator to the first element of the queue.
reference bottom()
Returns a reference to the back element.
const_reference top() const
Returns a reference to the front element.
SListIterator< E > pushBack(const E &x)
Adds element x at the end of the list.
E value_type
Represents the data type stored in a queue element.
const_reference bottom() const
Returns a reference to the back element.
const_iterator crbegin() const
Returns a const iterator to the last element of the queue.
const_iterator cend() const
Returns a const iterator to one-past-last element of the list.
SListPure< E > & operator=(const SListPure< E > &L)
Assignment operator.
void clear()
Removes all elements from the list.
iterator emplace(Args &&... args)
Adds a new element at the end of the queue.
const SListPure< E > & getListPure() const
Conversion to const SListPure.
QueuePure(const QueuePure< E > &Q)
Constructs a queue that is a copy of Q.
const_iterator cend() const
Returns a const iterator to one-past-last element of the queue.
The namespace for all OGDF objects.
QueuePure(QueuePure< E > &&Q)
Constructs a queue containing the elements of Q (move semantics).
void clear()
Removes all elements from the list.
E pop()
Removes front element and returns it.
iterator rbegin()
Returns an iterator to the last element of the list.
iterator end()
Returns an iterator to one-past-last element of the queue.
iterator end()
Returns an iterator to one-past-last element of the queue.
E & reference
Provides a reference to an element stored in a queue.
void print(ostream &os, const Array< E, INDEX > &a, char delim=' ')
Prints array a to output stream os using delimiter delim.
QueuePure< E > & operator=(QueuePure< E > &&Q)
Assignment operator (move semantics).
iterator begin()
Returns an iterator to the first element of the queue.
reference top()
Returns a reference to the front element.
void clear()
Makes the queue empty.
void popFront()
Removes the first element from the list.
iterator end()
Returns an iterator to one-past-last element of the list.
const_iterator cbegin() const
Returns a const iterator to the first element of the queue.
Queue(Queue< E > &&Q)
Constructs a queue containing the elements of Q (move semantics).
const_reference top() const
Returns a reference to the front element.