Stxxl  1.3.2
Public Types | Public Member Functions | List of all members
grow_shrink_stack2< Config_ > Class Template Reference

Efficient implementation that uses prefetching and overlapping using (shared) buffers pools. More...

#include <stack.h>

Inherits noncopyable.

Public Types

enum  { blocks_per_page = cfg::blocks_per_page, block_size = cfg::block_size }
 
typedef Config_ cfg
 
typedef cfg::value_type value_type
 
typedef cfg::alloc_strategy alloc_strategy_type
 
typedef cfg::size_type size_type
 
typedef typed_block
< block_size, value_type > 
block_type
 
typedef BID< block_size > bid_type
 

Public Member Functions

 grow_shrink_stack2 (pool_type &pool_, unsigned_type prefetch_aggressiveness=0)
 Constructs stack. More...
 
 _STXXL_DEPRECATED (grow_shrink_stack2(prefetch_pool< block_type > &p_pool_, write_pool< block_type > &w_pool_, unsigned_type prefetch_aggressiveness=0))
 Constructs stack. More...
 
void swap (grow_shrink_stack2 &obj)
 
size_type size () const
 
bool empty () const
 
void push (const value_type &val)
 
value_type & top ()
 
const value_type & top () const
 
void pop ()
 
void set_prefetch_aggr (unsigned_type new_p)
 Sets level of prefetch aggressiveness (number of blocks from the prefetch pool used for prefetching) More...
 
unsigned_type get_prefetch_aggr () const
 Returns number of blocks used for prefetching. More...
 

Detailed Description

template<class Config_>
class grow_shrink_stack2< Config_ >

Efficient implementation that uses prefetching and overlapping using (shared) buffers pools.

Warning
This is a single buffer stack! Each direction change (push() followed by pop() or vice versa) may cause one I/O.

Constructor & Destructor Documentation

template<class Config_ >
grow_shrink_stack2< Config_ >::grow_shrink_stack2 ( pool_type pool_,
unsigned_type  prefetch_aggressiveness = 0 
)
inline

Constructs stack.

Parameters
pool_block write/prefetch pool
prefetch_aggressivenessnumber of blocks that will be used from prefetch pool

Member Function Documentation

template<class Config_ >
grow_shrink_stack2< Config_ >::_STXXL_DEPRECATED ( grow_shrink_stack2< Config_ >(prefetch_pool< block_type > &p_pool_,write_pool< block_type > &w_pool_,unsigned_type prefetch_aggressiveness=0)  )
inline

Constructs stack.

Parameters
p_pool_prefetch pool, that will be used for block prefetching
w_pool_write pool, that will be used for block writing
prefetch_aggressivenessnumber of blocks that will be used from prefetch pool
template<class Config_ >
unsigned_type grow_shrink_stack2< Config_ >::get_prefetch_aggr ( ) const
inline

Returns number of blocks used for prefetching.

template<class Config_ >
void grow_shrink_stack2< Config_ >::set_prefetch_aggr ( unsigned_type  new_p)
inline

Sets level of prefetch aggressiveness (number of blocks from the prefetch pool used for prefetching)

Parameters
new_pnew value for the prefetch aggressiveness

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