Stxxl  1.2.1
Public Member Functions
queue< ValTp, BlkSz, AllocStr, SzTp > Class Template Reference

External FIFO queue container. More...

#include <queue.h>

Inherits noncopyable.

List of all members.

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.

Detailed Description

template<class ValTp, unsigned BlkSz = STXXL_DEFAULT_BLOCK_SIZE(ValTp), class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY, class SzTp = stxxl::uint64>
class queue< ValTp, BlkSz, AllocStr, SzTp >

External FIFO queue container.

Template parameters:


Constructor & Destructor Documentation

template<class ValTp , unsigned BlkSz = STXXL_DEFAULT_BLOCK_SIZE(ValTp), class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY, class SzTp = stxxl::uint64>
queue< ValTp, BlkSz, AllocStr, SzTp >::queue ( unsigned_type  w_pool_size,
unsigned_type  p_pool_size,
unsigned_type  blocks2prefetch_ = 1 
)
inline

Constructs empty queue with own write and prefetch block pool.

Parameters:
w_pool_sizenumber of blocks in the write pool, must be at least 2
p_pool_sizenumber 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().

template<class ValTp , unsigned BlkSz = STXXL_DEFAULT_BLOCK_SIZE(ValTp), class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY, class SzTp = stxxl::uint64>
queue< ValTp, BlkSz, AllocStr, SzTp >::queue ( write_pool< block_type > &  w_pool_,
prefetch_pool< block_type > &  p_pool_,
unsigned  blocks2prefetch_ = 1 
)
inline

Constructs empty queue.

Parameters:
w_pool_write pool
p_pool_prefetch pool
blocks2prefetch_defines the number of blocks to prefetch (front side) , default is 1
Warning:
Number of blocks in the write pool must be at least 2
Number of blocks in the prefetch pool must be at least 1

References element_block< T, Size_ >::elem, prefetch_pool< BlockType >::resize(), write_pool< BlockType >::size(), prefetch_pool< BlockType >::size(), and write_pool< BlockType >::steal().


Member Function Documentation

template<class ValTp , unsigned BlkSz = STXXL_DEFAULT_BLOCK_SIZE(ValTp), class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY, class SzTp = stxxl::uint64>
value_type& queue< ValTp, BlkSz, AllocStr, SzTp >::back ( )
inline

Returns a mutable reference at the back of the queue.

References queue< ValTp, BlkSz, AllocStr, SzTp >::empty().

template<class ValTp , unsigned BlkSz = STXXL_DEFAULT_BLOCK_SIZE(ValTp), class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY, class SzTp = stxxl::uint64>
const value_type& queue< ValTp, BlkSz, AllocStr, SzTp >::back ( ) const
inline

Returns a const reference at the back of the queue.

References queue< ValTp, BlkSz, AllocStr, SzTp >::empty().

template<class ValTp , unsigned BlkSz = STXXL_DEFAULT_BLOCK_SIZE(ValTp), class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY, class SzTp = stxxl::uint64>
bool queue< ValTp, BlkSz, AllocStr, SzTp >::empty ( ) const
inline
template<class ValTp , unsigned BlkSz = STXXL_DEFAULT_BLOCK_SIZE(ValTp), class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY, class SzTp = stxxl::uint64>
value_type& queue< ValTp, BlkSz, AllocStr, SzTp >::front ( )
inline

Returns a mutable reference at the front of the queue.

References queue< ValTp, BlkSz, AllocStr, SzTp >::empty().

template<class ValTp , unsigned BlkSz = STXXL_DEFAULT_BLOCK_SIZE(ValTp), class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY, class SzTp = stxxl::uint64>
const value_type& queue< ValTp, BlkSz, AllocStr, SzTp >::front ( ) const
inline

Returns a const reference at the front of the queue.

References queue< ValTp, BlkSz, AllocStr, SzTp >::empty().

template<class ValTp , unsigned BlkSz = STXXL_DEFAULT_BLOCK_SIZE(ValTp), class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY, class SzTp = stxxl::uint64>
unsigned_type queue< ValTp, BlkSz, AllocStr, SzTp >::get_prefetch_aggr ( ) const
inline

Returns the number of blocks prefetched from the front side.

template<class ValTp , unsigned BlkSz = STXXL_DEFAULT_BLOCK_SIZE(ValTp), class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY, class SzTp = stxxl::uint64>
void queue< ValTp, BlkSz, AllocStr, SzTp >::pop ( )
inline
template<class ValTp , unsigned BlkSz = STXXL_DEFAULT_BLOCK_SIZE(ValTp), class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY, class SzTp = stxxl::uint64>
void queue< ValTp, BlkSz, AllocStr, SzTp >::push ( const value_type &  val)
inline
template<class ValTp , unsigned BlkSz = STXXL_DEFAULT_BLOCK_SIZE(ValTp), class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY, class SzTp = stxxl::uint64>
void queue< ValTp, BlkSz, AllocStr, SzTp >::set_prefetch_aggr ( unsigned_type  blocks2prefetch_)
inline

Defines the number of blocks to prefetch (front side)

template<class ValTp , unsigned BlkSz = STXXL_DEFAULT_BLOCK_SIZE(ValTp), class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY, class SzTp = stxxl::uint64>
size_type queue< ValTp, BlkSz, AllocStr, SzTp >::size ( ) const
inline

Returns the size of the queue.

Referenced by queue< ValTp, BlkSz, AllocStr, SzTp >::pop().


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