Stxxl
1.4.0
|
External deque container without random access. More...
#include <deque2.h>
Classes | |
class | reverse_stream |
class | stream |
Public Types | |
enum | { block_size = BlockSize } |
typedef ValueType | value_type |
typedef AllocStrategy | alloc_strategy_type |
typedef SizeType | size_type |
typedef typed_block < block_size, value_type > | block_type |
typedef BID< block_size > | bid_type |
typedef std::deque< bid_type > | bid_deque_type |
Public Member Functions | |
deque2 (int D=-1) | |
Constructs empty deque with own write and prefetch block pool. | |
deque2 (unsigned_type w_pool_size, unsigned_type p_pool_size, int blocks2prefetch=-1) | |
Constructs empty deque2 with own write and prefetch block pool. | |
deque2 (pool_type &pool, int blocks2prefetch=-1) | |
Constructs empty deque. | |
void | swap (deque2 &obj) |
void | set_prefetch_aggr (int_type blocks2prefetch) |
Defines the number of blocks to prefetch (front side) This method should be called whenever the prefetch pool is resized. | |
unsigned_type | get_prefetch_aggr () const |
Returns the number of blocks prefetched from the front side. | |
void | push_front (const value_type &val) |
Adds an element to the front of the deque. | |
void | push_back (const value_type &val) |
Adds an element to the end of the deque. | |
void | pop_front () |
Removes element from the front of the deque. | |
void | pop_back () |
Removes element from the back of the deque. | |
size_type | size () const |
Returns the size of the deque. | |
bool | empty () const |
Returns true if deque is empty. | |
value_type & | back () |
Returns a mutable reference at the back of the deque. | |
const value_type & | back () const |
Returns a const reference at the back of the deque. | |
value_type & | front () |
Returns a mutable reference at the front of the deque. | |
const value_type & | front () const |
Returns a const reference at the front of the deque. | |
~deque2 () | |
stream | get_stream () |
reverse_stream | get_reverse_stream () |
Private Types | |
typedef read_write_pool < block_type > | pool_type |
Private Member Functions | |
void | init (int blocks2prefetch=-1) |
Private Attributes | |
size_type | m_size |
current number of items in the deque | |
bool | m_owns_pool |
whether the m_pool object is own and should be deleted. | |
pool_type * | m_pool |
read_write_pool of blocks | |
block_type * | m_front_block |
current front block of deque | |
block_type * | m_back_block |
current back block of deque | |
value_type * | m_front_element |
pointer to current front element in m_front_block | |
value_type * | m_back_element |
pointer to current back element in m_back_block | |
alloc_strategy_type | m_alloc_strategy |
block allocation strategy | |
unsigned_type | m_alloc_count |
block allocation counter | |
bid_deque_type | m_bids |
allocated block identifiers | |
block_manager * | m_bm |
block manager used | |
unsigned_type | m_blocks2prefetch |
number of blocks to prefetch |
External deque container without random access.
ValueType | type of the contained objects (POD with no references to internal memory) |
BlockSize | size of the external memory block in bytes, default is STXXL_DEFAULT_BLOCK_SIZE(ValTp) |
AllocStrategy | parallel disk allocation strategy, default is STXXL_DEFAULT_ALLOC_STRATEGY |
SizeType | size data type, default is stxxl::uint64 |
typedef AllocStrategy stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::alloc_strategy_type |
typedef std::deque<bid_type> stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::bid_deque_type |
typedef BID<block_size> stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::bid_type |
typedef typed_block<block_size, value_type> stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::block_type |
typedef read_write_pool<block_type> stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::pool_type [private] |
typedef SizeType stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::size_type |
typedef ValueType stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::value_type |
anonymous enum |
stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::deque2 | ( | int | D = -1 | ) | [inline, explicit] |
Constructs empty deque with own write and prefetch block pool.
D | number of parallel disks, defaulting to the configured number of scratch disks, memory consumption will be 2 * D + 2 blocks (first and last block, D blocks as write cache, D block for prefetching) |
Definition at line 107 of file deque2.h.
References D(), init(), and STXXL_VERBOSE_DEQUE2.
stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::deque2 | ( | unsigned_type | w_pool_size, |
unsigned_type | p_pool_size, | ||
int | blocks2prefetch = -1 |
||
) | [inline, explicit] |
Constructs empty deque2 with own write and prefetch block pool.
w_pool_size | number of blocks in the write pool, must be at least 2, recommended at least 3 |
p_pool_size | number of blocks in the prefetch pool, recommended at least 1 |
blocks2prefetch | defines the number of blocks to prefetch (front side), default is number of block in the prefetch pool |
Definition at line 125 of file deque2.h.
References init(), and STXXL_VERBOSE_DEQUE2.
stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::deque2 | ( | pool_type & | pool, |
int | blocks2prefetch = -1 |
||
) | [inline] |
Constructs empty deque.
pool_ | block write/prefetch pool |
blocks2prefetch | defines the number of blocks to prefetch (front side), default is number of blocks in the prefetch pool |
Definition at line 143 of file deque2.h.
References init(), and STXXL_VERBOSE_DEQUE2.
stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::~deque2 | ( | ) | [inline] |
value_type& stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::back | ( | ) | [inline] |
const value_type& stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::back | ( | ) | const [inline] |
bool stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::empty | ( | ) | const [inline] |
value_type& stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::front | ( | ) | [inline] |
const value_type& stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::front | ( | ) | const [inline] |
unsigned_type stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::get_prefetch_aggr | ( | ) | const [inline] |
reverse_stream stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::get_reverse_stream | ( | ) | [inline] |
stream stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::get_stream | ( | ) | [inline] |
void stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::init | ( | int | blocks2prefetch = -1 | ) | [inline, private] |
void stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::pop_back | ( | ) | [inline] |
void stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::pop_front | ( | ) | [inline] |
void stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::push_back | ( | const value_type & | val | ) | [inline] |
void stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::push_front | ( | const value_type & | val | ) | [inline] |
void stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::set_prefetch_aggr | ( | int_type | blocks2prefetch | ) | [inline] |
Defines the number of blocks to prefetch (front
side) This method should be called whenever the prefetch pool is resized.
blocks2prefetch | defines the number of blocks to prefetch (front side), a negative value means to use the number of blocks in the prefetch pool |
size_type stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::size | ( | ) | const [inline] |
void stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::swap | ( | deque2< ValueType, BlockSize, AllocStrategy, SizeType > & | obj | ) | [inline] |
Definition at line 154 of file deque2.h.
References stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::m_alloc_count, stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::m_alloc_strategy, stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::m_back_block, stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::m_back_element, stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::m_bids, stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::m_blocks2prefetch, stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::m_bm, stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::m_front_block, stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::m_front_element, stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::m_owns_pool, stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::m_pool, stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::m_size, and std::swap().
unsigned_type stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::m_alloc_count [private] |
block allocation counter
Definition at line 90 of file deque2.h.
Referenced by stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::swap().
alloc_strategy_type stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::m_alloc_strategy [private] |
block allocation strategy
Definition at line 87 of file deque2.h.
Referenced by stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::swap().
block_type* stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::m_back_block [private] |
current back block of deque
Definition at line 78 of file deque2.h.
Referenced by stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::reverse_stream::reverse_stream(), and stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::swap().
value_type* stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::m_back_element [private] |
pointer to current back element in m_back_block
Definition at line 84 of file deque2.h.
Referenced by stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::reverse_stream::reverse_stream(), and stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::swap().
bid_deque_type stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::m_bids [private] |
allocated block identifiers
Definition at line 93 of file deque2.h.
Referenced by stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::reverse_stream::reverse_stream(), stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::stream::stream(), and stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::swap().
unsigned_type stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::m_blocks2prefetch [private] |
number of blocks to prefetch
Definition at line 99 of file deque2.h.
Referenced by stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::swap().
block_manager* stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::m_bm [private] |
block manager used
Definition at line 96 of file deque2.h.
Referenced by stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::swap().
block_type* stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::m_front_block [private] |
current front block of deque
Definition at line 75 of file deque2.h.
Referenced by stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::stream::stream(), and stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::swap().
value_type* stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::m_front_element [private] |
pointer to current front element in m_front_block
Definition at line 81 of file deque2.h.
Referenced by stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::stream::stream(), and stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::swap().
bool stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::m_owns_pool [private] |
whether the m_pool object is own and should be deleted.
Definition at line 69 of file deque2.h.
Referenced by stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::swap().
pool_type* stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::m_pool [private] |
read_write_pool of blocks
Definition at line 72 of file deque2.h.
Referenced by stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::swap().
size_type stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::m_size [private] |
current number of items in the deque
Definition at line 66 of file deque2.h.
Referenced by stxxl::deque2< ValueType, BlockSize, AllocStrategy, SizeType >::swap().