The parameterized class BoundedQueue implements queues with bounded size. More...
#include <ogdf/basic/BoundedQueue.h>
Public Member Functions | |
| BoundedQueue () | |
| Pointer to first element of total array. More... | |
| BoundedQueue (INDEX n) | |
Constructs an empty bounded queue for at most n elements. More... | |
| BoundedQueue (const BoundedQueue< E > &Q) | |
Constructs a bounded queue that is a copy of Q. More... | |
| BoundedQueue (BoundedQueue< E > &&Q) | |
Constructs a bounded queue containing the elements of Q (move semantics). More... | |
| ~BoundedQueue () | |
| Destruction. More... | |
| void | append (const E &x) |
Adds x at the end of queue. More... | |
| const E & | bottom () const |
| Returns back element. More... | |
| E & | bottom () |
| Returns back element. More... | |
| INDEX | capacity () const |
| Returns the capacity of the bounded queue. More... | |
| void | clear () |
| Makes the queue empty. More... | |
| bool | empty () |
| Returns true iff the queue is empty. More... | |
| bool | full () |
| Returns true iff the queue is full. More... | |
| void | init () |
| Reinitializes the bounded queue to a non-valid bounded queue. More... | |
| void | init (INDEX n) |
Reinitializes the bounded queue to a bounded queue for at most n elements. More... | |
| BoundedQueue< E > & | operator= (const BoundedQueue< E > &Q) |
| Assignment operator. More... | |
| BoundedQueue< E > & | operator= (BoundedQueue< E > &&Q) |
| Assignment operator (move semantics). More... | |
| E | pop () |
| Removes front element and returns it. More... | |
| void | print (ostream &os, char delim=' ') const |
Prints the queue to output stream os with the seperator delim. More... | |
| INDEX | size () const |
| Returns current size of the queue. More... | |
| const E & | top () const |
| Returns front element. More... | |
| E & | top () |
| Returns front element. More... | |
Private Member Functions | |
| void | copy (const BoundedQueue< E > &Q) |
Private Attributes | |
| E * | m_pEnd |
| Pointer to first element of current sequence. More... | |
| E * | m_pFirst |
| Pointer to one past last element of total array. More... | |
| E * | m_pStart |
| E * | m_pStop |
| Pointer to one past last element of current sequence. More... | |
The parameterized class BoundedQueue implements queues with bounded size.
| E | is the element type. |
| INDEX | is the index type. The default index type is int, other possible types are short and long long (on 64-bit systems). |
Definition at line 46 of file BoundedQueue.h.
|
inline |
Pointer to first element of total array.
Creates a non-valid bounded queue. Needs to be reinitialized first.
Definition at line 55 of file BoundedQueue.h.
|
inlineexplicit |
Constructs an empty bounded queue for at most n elements.
Definition at line 60 of file BoundedQueue.h.
|
inline |
Constructs a bounded queue that is a copy of Q.
Definition at line 69 of file BoundedQueue.h.
|
inline |
Constructs a bounded queue containing the elements of Q (move semantics).
The queue Q is non valid afterwards, i.e., its capacity is zero. It has to be reinitialized if new elements shall be appended.
Definition at line 78 of file BoundedQueue.h.
|
inline |
Destruction.
Definition at line 87 of file BoundedQueue.h.
|
inline |
Adds x at the end of queue.
Definition at line 179 of file BoundedQueue.h.
|
inline |
Returns back element.
Definition at line 119 of file BoundedQueue.h.
|
inline |
Returns back element.
Definition at line 126 of file BoundedQueue.h.
|
inline |
Returns the capacity of the bounded queue.
Definition at line 140 of file BoundedQueue.h.
|
inline |
Makes the queue empty.
Definition at line 194 of file BoundedQueue.h.
|
inlineprivate |
Definition at line 207 of file BoundedQueue.h.
|
inline |
Returns true iff the queue is empty.
Definition at line 143 of file BoundedQueue.h.
|
inline |
Returns true iff the queue is full.
Definition at line 146 of file BoundedQueue.h.
|
inline |
Reinitializes the bounded queue to a non-valid bounded queue.
Definition at line 90 of file BoundedQueue.h.
|
inline |
Reinitializes the bounded queue to a bounded queue for at most n elements.
Definition at line 96 of file BoundedQueue.h.
|
inline |
Assignment operator.
Definition at line 154 of file BoundedQueue.h.
|
inline |
Assignment operator (move semantics).
The queue Q is non valid afterwards, i.e., its capacity is zero. It has to be reinitialized if new elements shall be appended.
Definition at line 165 of file BoundedQueue.h.
|
inline |
Removes front element and returns it.
Definition at line 186 of file BoundedQueue.h.
|
inline |
Prints the queue to output stream os with the seperator delim.
Definition at line 197 of file BoundedQueue.h.
|
inline |
Returns current size of the queue.
Definition at line 133 of file BoundedQueue.h.
|
inline |
Returns front element.
Definition at line 107 of file BoundedQueue.h.
|
inline |
Returns front element.
Definition at line 113 of file BoundedQueue.h.
|
private |
Pointer to first element of current sequence.
Definition at line 49 of file BoundedQueue.h.
|
private |
Pointer to one past last element of total array.
Definition at line 51 of file BoundedQueue.h.
|
private |
Definition at line 48 of file BoundedQueue.h.
|
private |
Pointer to one past last element of current sequence.
Definition at line 50 of file BoundedQueue.h.