46template<
class E,
class INDEX =
int>
81 Q.m_pStart =
Q.m_pEnd =
Q.m_pFirst =
Q.m_pStop =
nullptr;
175 Q.m_pStart =
Q.m_pEnd =
Q.m_pFirst =
Q.m_pStop =
nullptr;
217 int n =
Q.size() + 1;
224 for (E*
pX =
Q.m_pStart;
pX !=
Q.m_pEnd;) {
226 if (
pX ==
Q.m_pStop) {
234template<
class E,
class INDEX>
The parameterized class BoundedQueue implements queues with bounded size.
E * m_pFirst
Pointer to one past last element of total array.
bool empty()
Returns true iff the queue is empty.
void append(const E &x)
Adds x at the end of queue.
INDEX size() const
Returns current size of the queue.
void clear()
Makes the queue empty.
BoundedQueue< E > & operator=(BoundedQueue< E > &&Q)
Assignment operator (move semantics).
void copy(const BoundedQueue< E > &Q)
E & bottom()
Returns back element.
void print(std::ostream &os, char delim=' ') const
Prints the queue to output stream os with the seperator delim.
E & top()
Returns front element.
BoundedQueue(BoundedQueue< E > &&Q)
Constructs a bounded queue containing the elements of Q (move semantics).
const E & top() const
Returns front element.
BoundedQueue(const BoundedQueue< E > &Q)
Constructs a bounded queue that is a copy of Q.
~BoundedQueue()
Destruction.
INDEX capacity() const
Returns the capacity of the bounded queue.
const E & bottom() const
Returns back element.
BoundedQueue< E > & operator=(const BoundedQueue< E > &Q)
Assignment operator.
void init(INDEX n)
Reinitializes the bounded queue to a bounded queue for at most n elements.
void init()
Reinitializes the bounded queue to a non-valid bounded queue.
E * m_pEnd
Pointer to first element of current sequence.
BoundedQueue(INDEX n)
Constructs an empty bounded queue for at most n elements.
BoundedQueue()
Pointer to first element of total array.
E * m_pStop
Pointer to one past last element of current sequence.
E pop()
Removes front element and returns it.
bool full()
Returns true iff the queue is full.
Exception thrown when not enough memory is available to execute an algorithm.
Definition of exception classes.
#define OGDF_THROW(CLASS)
Replacement for throw.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.
std::ostream & operator<<(std::ostream &os, const ogdf::Array< E, INDEX > &a)
Prints array a to output stream os.