GemaMesh
The GeMA Mesh Plugin
Loading...
Searching...
No Matches
UibhmQueue< T > Class Template Reference

A helper queue class implemented over a QVector with amortized O(1) enqueue and dequeue operations. Never shrinks the storage. More...

#include <uibhmQueue.h>

Collaboration diagram for UibhmQueue< T >:

Public Member Functions

bool empty () const
 
int size () const
 
void enqueue (const T &value)
 
dequeue ()
 

Private Member Functions

void grow ()
 

Private Attributes

QVector< T > _data
 The underlying vector.
 
int _head
 Index of the front of the queue (first used)
 
int _tail
 Index of the first empty in the back after used entries (wraps around the vector border).
 
int _size
 Number of elements in the queue.
 

Detailed Description

template<class T>
class UibhmQueue< T >

A helper queue class implemented over a QVector with amortized O(1) enqueue and dequeue operations. Never shrinks the storage.

Notice that std:queue uses a deque as its base, which is much more complicated than what we really need: a simple queue over a circular vector


The documentation for this class was generated from the following file: