|
STXXL
1.4-dev
|
External stack container. Introduction to stack container: see STXXL Stack tutorial.
Design and Internals of stack container: see Stack 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 StackConfig::BlocksPerPage must >= number of disks
Inheritance diagram for stxxl::normal_stack< StackConfig >:
Collaboration diagram for stxxl::normal_stack< StackConfig >:Public Types | |
| enum | { blocks_per_page = cfg::blocks_per_page, block_size = cfg::block_size } |
| typedef cfg::alloc_strategy | alloc_strategy_type |
| typedef BID< block_size > | bid_type |
| typedef typed_block < block_size, value_type > | block_type |
| type of block used in disk-memory transfers More... | |
| typedef StackConfig | cfg |
| typedef cfg::size_type | size_type |
| type for sizes (64-bit) More... | |
| typedef cfg::value_type | value_type |
| type of the elements stored in the stack More... | |
Public Member Functions | |
Constructors/Destructors | |
| normal_stack () | |
| Default constructor: creates empty stack. More... | |
| template<class StackType > | |
| normal_stack (const StackType &stack_) | |
| Copy-construction from a another stack of any type. More... | |
| virtual | ~normal_stack () |
Accessor Functions | |
| void | swap (normal_stack &obj) |
| value_type & | top () |
| Return mutable reference to the element at the top of the stack. Precondition: stack is not empty(). More... | |
| const value_type & | top () const |
| Return constant reference to the element at the top of the stack. Precondition: stack is not empty(). More... | |
| void | push (const value_type &val) |
| Inserts an element at the top of the stack. Postconditions: size() is incremented by 1, and top() is the inserted element. More... | |
| void | pop () |
| Removes the element at the top of the stack. Precondition: stack is not empty(). Postcondition: size() is decremented. More... | |
Capacity | |
| size_type | size () const |
| Returns the number of elements contained in the stack. More... | |
| bool | empty () const |
| Returns true if the stack is empty. More... | |
Private Member Functions | |
| value_type * | element (unsigned_type offset) |
Private Member Functions inherited from stxxl::noncopyable | |
| noncopyable () | |
Private Attributes | |
| alloc_strategy_type | alloc_strategy |
| simple_vector< block_type > ::iterator | back_page |
| std::vector< bid_type > | bids |
| simple_vector< block_type > | cache |
| unsigned_type | cache_offset |
| value_type * | current_element |
| simple_vector< block_type > ::iterator | front_page |
| size_type | m_size |
| typedef cfg::alloc_strategy stxxl::normal_stack< StackConfig >::alloc_strategy_type |
| typedef BID<block_size> stxxl::normal_stack< StackConfig >::bid_type |
| typedef typed_block<block_size, value_type> stxxl::normal_stack< StackConfig >::block_type |
| typedef StackConfig stxxl::normal_stack< StackConfig >::cfg |
| typedef cfg::size_type stxxl::normal_stack< StackConfig >::size_type |
| typedef cfg::value_type stxxl::normal_stack< StackConfig >::value_type |
| anonymous enum |
|
inline |
|
inline |
|
inlinevirtual |
Definition at line 155 of file stack.h.
References STXXL_PRETTY_FUNCTION_NAME, and STXXL_VERBOSE.
|
inlineprivate |
|
inline |
|
inline |
Removes the element at the top of the stack. Precondition: stack is not empty(). Postcondition: size() is decremented.
Definition at line 244 of file stack.h.
References stxxl::simple_vector< ValueType >::begin(), STXXL_VERBOSE2, UNLIKELY, and stxxl::wait_all().
|
inline |
Inserts an element at the top of the stack. Postconditions: size() is incremented by 1, and top() is the inserted element.
Definition at line 201 of file stack.h.
References stxxl::simple_vector< ValueType >::begin(), STXXL_VERBOSE2, UNLIKELY, and stxxl::wait_all().
|
inline |
|
inline |
Definition at line 109 of file stack.h.
References stxxl::normal_stack< StackConfig >::alloc_strategy, stxxl::normal_stack< StackConfig >::back_page, stxxl::normal_stack< StackConfig >::bids, stxxl::normal_stack< StackConfig >::cache, stxxl::normal_stack< StackConfig >::cache_offset, stxxl::normal_stack< StackConfig >::current_element, stxxl::normal_stack< StackConfig >::front_page, and stxxl::normal_stack< StackConfig >::m_size.
|
inline |
|
inline |
|
private |
Definition at line 87 of file stack.h.
Referenced by stxxl::normal_stack< StackConfig >::swap().
|
private |
Definition at line 85 of file stack.h.
Referenced by stxxl::normal_stack< StackConfig >::swap().
|
private |
Definition at line 86 of file stack.h.
Referenced by stxxl::normal_stack< StackConfig >::swap().
|
private |
Definition at line 83 of file stack.h.
Referenced by stxxl::normal_stack< StackConfig >::swap().
|
private |
Definition at line 81 of file stack.h.
Referenced by stxxl::normal_stack< StackConfig >::swap().
|
private |
Definition at line 82 of file stack.h.
Referenced by stxxl::normal_stack< StackConfig >::swap().
|
private |
Definition at line 84 of file stack.h.
Referenced by stxxl::normal_stack< StackConfig >::swap().
|
private |
Definition at line 80 of file stack.h.
Referenced by stxxl::normal_stack< StackConfig >::swap().