Basic Implementation of I/O Efficient FIFO queue. More...
#include <tpie/queue.h>
Public Member Functions | |
queue (cache_hint cacheHint=access_sequential, compression_flags compressionFlags=compression_normal) | |
Constructor for Temporary Queue. More... | |
bool | empty () |
Check if the queue is empty. More... | |
stream_size_type | size () |
Returns the number of items currently on the queue. More... | |
void | push (const T &t) |
Enqueue an item. More... | |
const T & | pop () |
Dequeues an item. More... | |
const T & | front () |
Returns at the frontmost item in the queue. More... | |
Static Public Member Functions | |
static memory_size_type | memory_usage (double blockFactor=1.0) |
Compute the memory used by the queue. More... | |
Basic Implementation of I/O Efficient FIFO queue.
The queue uses a pop stream, a center queue, and a push stream, to model a queue. The front elements of the queue are the pop stream items, followed by the center queue items, followed by the push stream items.
Elements are pushed to the center queue. When the center queue is full, subsequent pushed elements are written to the push stream.
Elements are popped from the pop stream. When this is empty, the center queue is used instead. When the center queue is also empty, the push stream and the pop stream are swapped.
|
inline |
|
inline |
|
inline |
Returns at the frontmost item in the queue.
|
inlinestatic |
|
inline |
|
inline |
Enqueue an item.
t | The item to be enqueued |
Definition at line 86 of file queue.h.
References tpie::queue< T >::size().
|
inline |
Returns the number of items currently on the queue.
Definition at line 80 of file queue.h.
Referenced by tpie::queue< T >::push().