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

External stack container. More...

#include <stack.h>

Inheritance diagram for stxxl::normal_stack< Config_ >:
Inheritance graph
[legend]
Collaboration diagram for stxxl::normal_stack< 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

 normal_stack ()
void swap (normal_stack &obj)
template<class stack_type >
 normal_stack (const stack_type &stack_)
 Construction from a stack.
virtual ~normal_stack ()
size_type size () const
bool empty () const
value_typetop ()
const value_typetop () const
void push (const value_type &val)
void pop ()

Private Member Functions

value_typeelement (unsigned_type offset)

Private Attributes

size_type size_
unsigned_type cache_offset
value_typecurrent_element
simple_vector< block_typecache
simple_vector< block_type >
::iterator 
front_page
simple_vector< block_type >
::iterator 
back_page
std::vector< bid_typebids
alloc_strategy_type alloc_strategy

Detailed Description

template<class Config_>
class stxxl::normal_stack< Config_ >

External stack container.

Conservative implementation. Fits best if your access pattern consists of irregularly mixed push'es and pop's. For semantics of the methods see documentation of the STL std::stack.
To gain full bandwidth of disks Config_::BlocksPerPage must >= number of disks

Definition at line 59 of file stack.h.


Member Typedef Documentation

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

Definition at line 64 of file stack.h.

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

Definition at line 72 of file stack.h.

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

Definition at line 71 of file stack.h.

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

Definition at line 62 of file stack.h.

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

Definition at line 65 of file stack.h.

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

Definition at line 63 of file stack.h.


Member Enumeration Documentation

template<class Config_>
anonymous enum
Enumerator:
blocks_per_page 
block_size 

Definition at line 66 of file stack.h.


Constructor & Destructor Documentation

template<class Config_>
stxxl::normal_stack< Config_ >::normal_stack ( ) [inline]

Definition at line 85 of file stack.h.

template<class Config_>
template<class stack_type >
stxxl::normal_stack< Config_ >::normal_stack ( const stack_type &  stack_) [inline]

Construction from a stack.

Parameters:
stack_stack object (could be external or internal, important is that it must have a copy constructor, top() and pop() methods )

Definition at line 113 of file stack.h.

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

Definition at line 138 of file stack.h.

References STXXL_PRETTY_FUNCTION_NAME.


Member Function Documentation

template<class Config_>
value_type* stxxl::normal_stack< Config_ >::element ( unsigned_type  offset) [inline, private]

Definition at line 242 of file stack.h.

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

Definition at line 147 of file stack.h.

template<class Config_>
void stxxl::normal_stack< Config_ >::pop ( ) [inline]
template<class Config_>
void stxxl::normal_stack< Config_ >::push ( const value_type val) [inline]
template<class Config_>
size_type stxxl::normal_stack< Config_ >::size ( ) const [inline]

Definition at line 143 of file stack.h.

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

Definition at line 151 of file stack.h.

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

Definition at line 156 of file stack.h.


Member Data Documentation

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

Definition at line 82 of file stack.h.

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

template<class Config_>
simple_vector<block_type>::iterator stxxl::normal_stack< Config_ >::back_page [private]

Definition at line 80 of file stack.h.

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

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

Definition at line 81 of file stack.h.

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

template<class Config_>
simple_vector<block_type> stxxl::normal_stack< Config_ >::cache [private]

Definition at line 78 of file stack.h.

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

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

Definition at line 76 of file stack.h.

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

template<class Config_>
value_type* stxxl::normal_stack< Config_ >::current_element [private]

Definition at line 77 of file stack.h.

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

template<class Config_>
simple_vector<block_type>::iterator stxxl::normal_stack< Config_ >::front_page [private]

Definition at line 79 of file stack.h.

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

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

Definition at line 75 of file stack.h.

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


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