Stxxl  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
stxxl::grow_shrink_stack2< Config_ > Class Template Reference

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

#include <stack.h>

Inheritance diagram for stxxl::grow_shrink_stack2< Config_ >:
Inheritance graph
[legend]
Collaboration diagram for stxxl::grow_shrink_stack2< Config_ >:
Collaboration graph
[legend]

List of all members.

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_sizebid_type

Public Member Functions

 grow_shrink_stack2 (pool_type &pool_, unsigned_type prefetch_aggressiveness=0)
 Constructs stack.
 _STXXL_DEPRECATED (grow_shrink_stack2(prefetch_pool< block_type > &p_pool_, write_pool< block_type > &w_pool_, unsigned_type prefetch_aggressiveness=0))
 Constructs stack.
void swap (grow_shrink_stack2 &obj)
virtual ~grow_shrink_stack2 ()
size_type size () const
bool empty () const
void push (const value_type &val)
value_typetop ()
const value_typetop () 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)
unsigned_type get_prefetch_aggr () const
 Returns number of blocks used for prefetching.

Private Types

typedef read_write_pool
< block_type
pool_type

Private Member Functions

void rehint ()
 hint the last pref_aggr external blocks

Private Attributes

size_type size_
unsigned_type cache_offset
block_typecache
std::vector< bid_typebids
alloc_strategy_type alloc_strategy
unsigned_type pref_aggr
pool_typeowned_pool
pool_typepool

Detailed Description

template<class Config_>
class stxxl::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.

Definition at line 455 of file stack.h.


Member Typedef Documentation

template<class Config_>
typedef cfg::alloc_strategy stxxl::grow_shrink_stack2< Config_ >::alloc_strategy_type

Definition at line 460 of file stack.h.

template<class Config_>
typedef BID<block_size> stxxl::grow_shrink_stack2< Config_ >::bid_type

Definition at line 468 of file stack.h.

template<class Config_>
typedef typed_block<block_size, value_type> stxxl::grow_shrink_stack2< Config_ >::block_type

Definition at line 467 of file stack.h.

template<class Config_>
typedef Config_ stxxl::grow_shrink_stack2< Config_ >::cfg

Definition at line 458 of file stack.h.

template<class Config_>
typedef read_write_pool<block_type> stxxl::grow_shrink_stack2< Config_ >::pool_type [private]

Definition at line 471 of file stack.h.

template<class Config_>
typedef cfg::size_type stxxl::grow_shrink_stack2< Config_ >::size_type

Definition at line 461 of file stack.h.

template<class Config_>
typedef cfg::value_type stxxl::grow_shrink_stack2< Config_ >::value_type

Definition at line 459 of file stack.h.


Member Enumeration Documentation

template<class Config_>
anonymous enum
Enumerator:
blocks_per_page 
block_size 

Definition at line 462 of file stack.h.


Constructor & Destructor Documentation

template<class Config_>
stxxl::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

Definition at line 486 of file stack.h.

template<class Config_>
virtual stxxl::grow_shrink_stack2< Config_ >::~grow_shrink_stack2 ( ) [inline, virtual]

Definition at line 529 of file stack.h.

References stxxl::STXXL_MAX().


Member Function Documentation

template<class Config_>
stxxl::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

Definition at line 503 of file stack.h.

template<class Config_>
bool stxxl::grow_shrink_stack2< Config_ >::empty ( ) const [inline]

Definition at line 567 of file stack.h.

template<class Config_>
unsigned_type stxxl::grow_shrink_stack2< Config_ >::get_prefetch_aggr ( ) const [inline]

Returns number of blocks used for prefetching.

Definition at line 661 of file stack.h.

template<class Config_>
void stxxl::grow_shrink_stack2< Config_ >::pop ( ) [inline]

Definition at line 619 of file stack.h.

References UNLIKELY.

template<class Config_>
void stxxl::grow_shrink_stack2< Config_ >::push ( const value_type val) [inline]

Definition at line 572 of file stack.h.

References stxxl::STXXL_MAX(), and UNLIKELY.

template<class Config_>
void stxxl::grow_shrink_stack2< Config_ >::rehint ( ) [inline, private]

hint the last pref_aggr external blocks

Definition at line 668 of file stack.h.

References stxxl::STXXL_MAX().

template<class Config_>
void stxxl::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

Definition at line 644 of file stack.h.

References stxxl::STXXL_MAX().

template<class Config_>
size_type stxxl::grow_shrink_stack2< Config_ >::size ( ) const [inline]

Definition at line 562 of file stack.h.

template<class Config_>
void stxxl::grow_shrink_stack2< Config_ >::swap ( grow_shrink_stack2< Config_ > &  obj) [inline]
template<class Config_>
value_type& stxxl::grow_shrink_stack2< Config_ >::top ( ) [inline]

Definition at line 603 of file stack.h.

template<class Config_>
const value_type& stxxl::grow_shrink_stack2< Config_ >::top ( ) const [inline]

Definition at line 611 of file stack.h.


Member Data Documentation

template<class Config_>
alloc_strategy_type stxxl::grow_shrink_stack2< Config_ >::alloc_strategy [private]

Definition at line 477 of file stack.h.

Referenced by stxxl::grow_shrink_stack2< Config_ >::swap().

template<class Config_>
std::vector<bid_type> stxxl::grow_shrink_stack2< Config_ >::bids [private]

Definition at line 476 of file stack.h.

Referenced by stxxl::grow_shrink_stack2< Config_ >::swap().

template<class Config_>
block_type* stxxl::grow_shrink_stack2< Config_ >::cache [private]

Definition at line 475 of file stack.h.

Referenced by stxxl::grow_shrink_stack2< Config_ >::swap().

template<class Config_>
unsigned_type stxxl::grow_shrink_stack2< Config_ >::cache_offset [private]

Definition at line 474 of file stack.h.

Referenced by stxxl::grow_shrink_stack2< Config_ >::swap().

template<class Config_>
pool_type* stxxl::grow_shrink_stack2< Config_ >::owned_pool [private]

Definition at line 479 of file stack.h.

Referenced by stxxl::grow_shrink_stack2< Config_ >::swap().

template<class Config_>
pool_type* stxxl::grow_shrink_stack2< Config_ >::pool [private]

Definition at line 480 of file stack.h.

Referenced by stxxl::grow_shrink_stack2< Config_ >::swap().

template<class Config_>
unsigned_type stxxl::grow_shrink_stack2< Config_ >::pref_aggr [private]

Definition at line 478 of file stack.h.

Referenced by stxxl::grow_shrink_stack2< Config_ >::swap().

template<class Config_>
size_type stxxl::grow_shrink_stack2< Config_ >::size_ [private]

Definition at line 473 of file stack.h.

Referenced by stxxl::grow_shrink_stack2< Config_ >::swap().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines