|
STXXL
1.4-dev
|
Efficient implementation that uses prefetching and overlapping using (shared) buffers pools.
Inheritance diagram for stxxl::grow_shrink_stack2< StackConfig >:
Collaboration diagram for stxxl::grow_shrink_stack2< 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 | |
| grow_shrink_stack2 (pool_type &pool_, unsigned_type prefetch_aggressiveness=0) | |
| Default constructor: creates empty stack. The stack will use the read_write_pool for prefetching and buffered writing. More... | |
| grow_shrink_stack2 (prefetch_pool< block_type > &p_pool_, write_pool< block_type > &w_pool_, unsigned_type prefetch_aggressiveness=0) | |
| Default constructor: creates empty stack. The stack will use the pair of prefetch_pool and write_pool for prefetching and buffered writing. This constructor is deprecated in favor of the read_write_pool constructor. More... | |
| virtual | ~grow_shrink_stack2 () |
Accessor Functions | |
| void | swap (grow_shrink_stack2 &obj) |
| 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... | |
| 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 | 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... | |
Miscellaneous | |
| 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... | |
Private Types | |
| typedef read_write_pool < block_type > | pool_type |
Private Member Functions | |
| void | rehint () |
| hint the last pref_aggr external blocks. More... | |
Private Member Functions inherited from stxxl::noncopyable | |
| noncopyable () | |
Private Attributes | |
| alloc_strategy_type | alloc_strategy |
| std::vector< bid_type > | bids |
| block_type * | cache |
| unsigned_type | cache_offset |
| size_type | m_size |
| pool_type * | owned_pool |
| pool_type * | pool |
| unsigned_type | pref_aggr |
| typedef cfg::alloc_strategy stxxl::grow_shrink_stack2< StackConfig >::alloc_strategy_type |
| typedef BID<block_size> stxxl::grow_shrink_stack2< StackConfig >::bid_type |
| typedef typed_block<block_size, value_type> stxxl::grow_shrink_stack2< StackConfig >::block_type |
| typedef StackConfig stxxl::grow_shrink_stack2< StackConfig >::cfg |
|
private |
| typedef cfg::size_type stxxl::grow_shrink_stack2< StackConfig >::size_type |
| typedef cfg::value_type stxxl::grow_shrink_stack2< StackConfig >::value_type |
| anonymous enum |
|
inline |
Default constructor: creates empty stack. The stack will use the read_write_pool for prefetching and buffered writing.
| pool_ | block write/prefetch pool |
| prefetch_aggressiveness | number of blocks that will be used from prefetch pool |
Definition at line 578 of file stack.h.
References STXXL_VERBOSE2.
|
inline |
Default constructor: creates empty stack. The stack will use the pair of prefetch_pool and write_pool for prefetching and buffered writing. This constructor is deprecated in favor of the read_write_pool constructor.
| p_pool_ | prefetch pool, that will be used for block prefetching |
| w_pool_ | write pool, that will be used for block writing |
| prefetch_aggressiveness | number of blocks that will be used from prefetch pool |
Definition at line 602 of file stack.h.
References STXXL_VERBOSE2.
|
inlinevirtual |
Definition at line 635 of file stack.h.
References stxxl::STXXL_MAX(), and STXXL_VERBOSE2.
|
inline |
|
inline |
|
inline |
Removes the element at the top of the stack. Precondition: stack is not empty(). Postcondition: size() is decremented.
Definition at line 744 of file stack.h.
References STXXL_VERBOSE2, STXXL_VERBOSE3, and UNLIKELY.
|
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 691 of file stack.h.
References stxxl::STXXL_MAX(), STXXL_VERBOSE2, STXXL_VERBOSE3, and UNLIKELY.
|
inlineprivate |
hint the last pref_aggr external blocks.
Definition at line 800 of file stack.h.
References stxxl::STXXL_MAX().
|
inline |
Sets level of prefetch aggressiveness (number of blocks from the prefetch pool used for prefetching).
| new_p | new value for the prefetch aggressiveness |
Definition at line 774 of file stack.h.
References stxxl::STXXL_MAX().
|
inline |
|
inline |
Definition at line 618 of file stack.h.
References stxxl::grow_shrink_stack2< StackConfig >::alloc_strategy, stxxl::grow_shrink_stack2< StackConfig >::bids, stxxl::grow_shrink_stack2< StackConfig >::cache, stxxl::grow_shrink_stack2< StackConfig >::cache_offset, stxxl::grow_shrink_stack2< StackConfig >::m_size, stxxl::grow_shrink_stack2< StackConfig >::owned_pool, stxxl::grow_shrink_stack2< StackConfig >::pool, and stxxl::grow_shrink_stack2< StackConfig >::pref_aggr.
|
inline |
|
inline |
|
private |
Definition at line 565 of file stack.h.
Referenced by stxxl::grow_shrink_stack2< StackConfig >::swap().
|
private |
Definition at line 564 of file stack.h.
Referenced by stxxl::grow_shrink_stack2< StackConfig >::swap().
|
private |
Definition at line 563 of file stack.h.
Referenced by stxxl::grow_shrink_stack2< StackConfig >::swap().
|
private |
Definition at line 562 of file stack.h.
Referenced by stxxl::grow_shrink_stack2< StackConfig >::swap().
|
private |
Definition at line 561 of file stack.h.
Referenced by stxxl::grow_shrink_stack2< StackConfig >::swap().
|
private |
Definition at line 567 of file stack.h.
Referenced by stxxl::grow_shrink_stack2< StackConfig >::swap().
|
private |
Definition at line 568 of file stack.h.
Referenced by stxxl::grow_shrink_stack2< StackConfig >::swap().
|
private |
Definition at line 566 of file stack.h.
Referenced by stxxl::grow_shrink_stack2< StackConfig >::swap().