Stxxl  1.3.2
Public Types | Public Member Functions | List of all members
queue< ValTp, BlkSz, AllocStr, SzTp > Class Template Reference

External FIFO queue container. More...

#include <queue.h>

Inherits noncopyable.

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 (unsigned_type w_pool_size=3, unsigned_type p_pool_size=1, int blocks2prefetch_=-1)
 Constructs empty queue with own write and prefetch block pool. More...
 
 _STXXL_DEPRECATED (queue(write_pool< block_type > &w_pool, prefetch_pool< block_type > &p_pool, int blocks2prefetch_=-1))
 Constructs empty queue. More...
 
 queue (pool_type &pool_, int blocks2prefetch_=-1)
 Constructs empty queue. More...
 
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. More...
 
unsigned_type get_prefetch_aggr () const
 Returns the number of blocks prefetched from the front side. More...
 
void push (const value_type &val)
 Adds an element in the queue. More...
 
void pop ()
 Removes element from the queue. More...
 
size_type size () const
 Returns the size of the queue. More...
 
bool empty () const
 Returns true if queue is empty. More...
 
value_type & back ()
 Returns a mutable reference at the back of the queue. More...
 
const value_type & back () const
 Returns a const reference at the back of the queue. More...
 
value_type & front ()
 Returns a mutable reference at the front of the queue. More...
 
const value_type & front () const
 Returns a const reference at the front of the queue. More...
 

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
ValTptype of the contained objects (POD with no references to internal memory)
BlkSzsize of the external memory block in bytes, default is STXXL_DEFAULT_BLOCK_SIZE(ValTp)
AllocStrparallel disk allocation strategy, default is STXXL_DEFAULT_ALLOC_STRATEGY
SzTpsize data type, default is stxxl::uint64

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 = 3,
unsigned_type  p_pool_size = 1,
int  blocks2prefetch_ = -1 
)
inlineexplicit

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, recommended at least 3
p_pool_sizenumber 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
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 ( pool_type pool_,
int  blocks2prefetch_ = -1 
)
inline

Constructs empty queue.

Parameters
pool_block write/prefetch pool
blocks2prefetch_defines the number of blocks to prefetch (front side), default is number of blocks in the prefetch pool
Warning
Number of blocks in the write pool must be at least 2, recommended at least 3
Number of blocks in the prefetch pool recommended at least 1

Member Function 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 >::_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.

Parameters
w_poolwrite pool
p_poolprefetch pool
blocks2prefetch_defines the number of blocks to prefetch (front side), default is number of blocks in the prefetch pool
Warning
Number of blocks in the write pool must be at least 2, recommended at least 3
Number of blocks in the prefetch pool recommended at least 1
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 ( int_type  blocks2prefetch_)
inline

Defines the number of blocks to prefetch (front side) This method should be called whenever the prefetch pool is resized.

Parameters
blocks2prefetch_defines the number of blocks to prefetch (front side), a negative value means to use the number of blocks in the prefetch pool

References read_write_pool< BlockType >::size_prefetch().

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: