Stxxl
1.4.0
|
External FIFO queue container. More...
#include <queue.h>
Public Types | |
enum | { block_size = BlkSz } |
typedef ValTp | value_type |
typedef AllocStr | alloc_strategy_type |
typedef SzTp | size_type |
typedef typed_block < block_size, value_type > | block_type |
typedef BID< block_size > | bid_type |
Public Member Functions | |
queue (int D=-1) | |
Constructs empty queue with own write and prefetch block pool. | |
queue (unsigned_type w_pool_size, unsigned_type p_pool_size, int blocks2prefetch_=-1) | |
Constructs empty queue with own write and prefetch block pool. | |
_STXXL_DEPRECATED (queue(write_pool< block_type > &w_pool, prefetch_pool< block_type > &p_pool, int blocks2prefetch_=-1)) | |
Constructs empty queue. | |
queue (pool_type &pool_, int blocks2prefetch_=-1) | |
Constructs empty queue. | |
void | swap (queue &obj) |
void | set_prefetch_aggr (int_type blocks2prefetch_) |
Defines the number of blocks to prefetch (front side) This method should be called whenever the prefetch pool is resized. | |
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. | |
~queue () | |
Private Types | |
typedef read_write_pool < block_type > | pool_type |
Private Member Functions | |
void | init (int blocks2prefetch_=-1) |
Private Attributes | |
size_type | size_ |
bool | delete_pool |
pool_type * | pool |
block_type * | front_block |
block_type * | back_block |
value_type * | front_element |
value_type * | back_element |
alloc_strategy_type | alloc_strategy |
unsigned_type | alloc_count |
std::deque< bid_type > | bids |
block_manager * | bm |
unsigned_type | blocks2prefetch |
External FIFO queue container.
ValTp | type of the contained objects (POD with no references to internal memory) |
BlkSz | size of the external memory block in bytes, default is STXXL_DEFAULT_BLOCK_SIZE(ValTp) |
AllocStr | parallel disk allocation strategy, default is STXXL_DEFAULT_ALLOC_STRATEGY |
SzTp | size data type, default is stxxl::uint64 |
typedef AllocStr stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::alloc_strategy_type |
typedef BID<block_size> stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::bid_type |
typedef typed_block<block_size, value_type> stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::block_type |
typedef read_write_pool<block_type> stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::pool_type [private] |
typedef SzTp stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::size_type |
typedef ValTp stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::value_type |
anonymous enum |
stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::queue | ( | int | D = -1 | ) | [inline, explicit] |
Constructs empty queue with own write and prefetch block pool.
D | number of parallel disks, defaulting to the configured number of scratch disks, memory consumption will be 2 * D + 2 blocks (first and last block, D blocks as write cache, D block for prefetching) |
Definition at line 86 of file queue.h.
References D(), init(), and STXXL_VERBOSE_QUEUE.
stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::queue | ( | unsigned_type | w_pool_size, |
unsigned_type | p_pool_size, | ||
int | blocks2prefetch_ = -1 |
||
) | [inline, explicit] |
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, recommended at least 3 |
p_pool_size | number of blocks in the prefetch pool, recommended at least 1 |
blocks2prefetch_ | defines the number of blocks to prefetch (front side), default is number of block in the prefetch pool |
Definition at line 105 of file queue.h.
References init(), and STXXL_VERBOSE_QUEUE.
stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::queue | ( | pool_type & | pool_, |
int | blocks2prefetch_ = -1 |
||
) | [inline] |
Constructs empty queue.
pool_ | block write/prefetch pool |
blocks2prefetch_ | defines the number of blocks to prefetch (front side), default is number of blocks in the prefetch pool |
Definition at line 143 of file queue.h.
References init(), and STXXL_VERBOSE_QUEUE.
stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::~queue | ( | ) | [inline] |
stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::_STXXL_DEPRECATED | ( | queue< ValTp, BlkSz, AllocStr, SzTp >(write_pool< block_type > &w_pool, prefetch_pool< block_type > &p_pool, int blocks2prefetch_=-1) | ) | [inline] |
Constructs empty queue.
w_pool | write pool |
p_pool | prefetch pool |
blocks2prefetch_ | defines the number of blocks to prefetch (front side), default is number of blocks in the prefetch pool |
Definition at line 124 of file queue.h.
References init(), and STXXL_VERBOSE_QUEUE.
value_type& stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::back | ( | ) | [inline] |
const value_type& stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::back | ( | ) | const [inline] |
bool stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::empty | ( | ) | const [inline] |
value_type& stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::front | ( | ) | [inline] |
const value_type& stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::front | ( | ) | const [inline] |
unsigned_type stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::get_prefetch_aggr | ( | ) | const [inline] |
void stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::init | ( | int | blocks2prefetch_ = -1 | ) | [inline, private] |
void stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::pop | ( | ) | [inline] |
void stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::push | ( | const value_type & | val | ) | [inline] |
void stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::set_prefetch_aggr | ( | int_type | blocks2prefetch_ | ) | [inline] |
Defines the number of blocks to prefetch (front
side) This method should be called whenever the prefetch pool is resized.
blocks2prefetch_ | defines the number of blocks to prefetch (front side), a negative value means to use the number of blocks in the prefetch pool |
size_type stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::size | ( | ) | const [inline] |
void stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::swap | ( | queue< ValTp, BlkSz, AllocStr, SzTp > & | obj | ) | [inline] |
Definition at line 154 of file queue.h.
References stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::alloc_count, stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::alloc_strategy, stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::back_block, stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::back_element, stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::bids, stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::blocks2prefetch, stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::bm, stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::delete_pool, stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::front_block, stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::front_element, stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::pool, stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::size_, and std::swap().
unsigned_type stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::alloc_count [private] |
Definition at line 75 of file queue.h.
Referenced by stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::swap().
alloc_strategy_type stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::alloc_strategy [private] |
Definition at line 74 of file queue.h.
Referenced by stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::swap().
block_type* stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::back_block [private] |
Definition at line 71 of file queue.h.
Referenced by stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::swap().
value_type* stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::back_element [private] |
Definition at line 73 of file queue.h.
Referenced by stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::swap().
std::deque<bid_type> stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::bids [private] |
Definition at line 76 of file queue.h.
Referenced by stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::swap().
unsigned_type stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::blocks2prefetch [private] |
Definition at line 78 of file queue.h.
Referenced by stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::swap().
block_manager* stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::bm [private] |
Definition at line 77 of file queue.h.
Referenced by stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::swap().
bool stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::delete_pool [private] |
Definition at line 68 of file queue.h.
Referenced by stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::swap().
block_type* stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::front_block [private] |
Definition at line 70 of file queue.h.
Referenced by stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::swap().
value_type* stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::front_element [private] |
Definition at line 72 of file queue.h.
Referenced by stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::swap().
pool_type* stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::pool [private] |
Definition at line 69 of file queue.h.
Referenced by stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::swap().
size_type stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::size_ [private] |
Definition at line 67 of file queue.h.
Referenced by stxxl::queue< ValTp, BlkSz, AllocStr, SzTp >::swap().