Stxxl
1.2.1
|
External FIFO queue container. More...
#include <queue.h>
Inherits noncopyable.
Public Member Functions | |
queue (unsigned_type w_pool_size, unsigned_type p_pool_size, unsigned_type blocks2prefetch_=1) | |
Constructs empty queue with own write and prefetch block pool. | |
queue (write_pool< block_type > &w_pool_, prefetch_pool< block_type > &p_pool_, unsigned blocks2prefetch_=1) | |
Constructs empty queue. | |
void | set_prefetch_aggr (unsigned_type blocks2prefetch_) |
Defines the number of blocks to prefetch (front side) | |
unsigned_type | get_prefetch_aggr () const |
Returns the number of blocks prefetched from the front side. | |
void | push (const value_type &val) |
Adds an element in the queue. | |
void | pop () |
Removes element from the queue. | |
size_type | size () const |
Returns the size of the queue. | |
bool | empty () const |
Returns true if queue is empty. | |
value_type & | back () |
Returns a mutable reference at the back of the queue. | |
const value_type & | back () const |
Returns a const reference at the back of the queue. | |
value_type & | front () |
Returns a mutable reference at the front of the queue. | |
const value_type & | front () const |
Returns a const reference at the front of the queue. |
External FIFO queue container.
Template parameters:
STXXL_DEFAULT_BLOCK_SIZE(ValTp)
STXXL_DEFAULT_ALLOC_STRATEGY
stxxl::uint64
|
inline |
Constructs empty queue with own write and prefetch block pool.
w_pool_size | number of blocks in the write pool, must be at least 2 |
p_pool_size | number of blocks in the prefetch pool, must be at least 1 |
blocks2prefetch_ | defines the number of blocks to prefetch (front side) , default is 1 |
References element_block< T, Size_ >::elem, and write_pool< BlockType >::steal().
|
inline |
Constructs empty queue.
w_pool_ | write pool |
p_pool_ | prefetch pool |
blocks2prefetch_ | defines the number of blocks to prefetch (front side) , default is 1 |
References element_block< T, Size_ >::elem, prefetch_pool< BlockType >::resize(), write_pool< BlockType >::size(), prefetch_pool< BlockType >::size(), and write_pool< BlockType >::steal().
|
inline |
Returns a mutable reference at the back of the queue.
References queue< ValTp, BlkSz, AllocStr, SzTp >::empty().
|
inline |
Returns a const reference at the back of the queue.
References queue< ValTp, BlkSz, AllocStr, SzTp >::empty().
|
inline |
Returns true
if queue is empty.
Referenced by queue< ValTp, BlkSz, AllocStr, SzTp >::back(), queue< ValTp, BlkSz, AllocStr, SzTp >::front(), and queue< ValTp, BlkSz, AllocStr, SzTp >::pop().
|
inline |
Returns a mutable reference at the front of the queue.
References queue< ValTp, BlkSz, AllocStr, SzTp >::empty().
|
inline |
Returns a const reference at the front of the queue.
References queue< ValTp, BlkSz, AllocStr, SzTp >::empty().
|
inline |
Returns the number of blocks prefetched from the front
side.
|
inline |
Removes element from the queue.
References block_manager::delete_block(), element_block< T, Size_ >::elem, queue< ValTp, BlkSz, AllocStr, SzTp >::empty(), prefetch_pool< BlockType >::hint(), prefetch_pool< BlockType >::read(), queue< ValTp, BlkSz, AllocStr, SzTp >::size(), and typed_block< RawSize_, T_, NRef_, InfoType_ >::size.
|
inline |
Adds an element in the queue.
References element_block< T, Size_ >::elem, block_manager::new_blocks(), typed_block< RawSize_, T_, NRef_, InfoType_ >::size, write_pool< BlockType >::steal(), and write_pool< BlockType >::write().
|
inline |
Defines the number of blocks to prefetch (front
side)
|
inline |
Returns the size of the queue.
Referenced by queue< ValTp, BlkSz, AllocStr, SzTp >::pop().