STXXL
1.4.1
|
Implements dynamically resizable buffered writing and prefetched reading pool.
Definition at line 26 of file read_write_pool.h.
Public Types | |
typedef block_type::bid_type | bid_type |
typedef BlockType | block_type |
typedef unsigned_type | size_type |
Public Member Functions | |
read_write_pool (size_type init_size_prefetch=1, size_type init_size_write=1) | |
Constructs pool. More... | |
read_write_pool (prefetch_pool_type &p_pool, write_pool_type &w_pool) | |
~read_write_pool () | |
Waits for completion of all ongoing requests and frees memory. More... | |
void | add (block_type *&block) |
bool | hint (bid_type bid) |
Gives a hint for prefetching a block. More... | |
bool | invalidate (bid_type bid) |
request_ptr | read (block_type *&block, bid_type bid) |
Reads block. If this block is cached block is not read but passed from the cache. More... | |
void | resize_prefetch (size_type new_size) |
Resizes size of the pool. More... | |
void | resize_write (size_type new_size) |
Resizes size of the pool. More... | |
size_type | size_prefetch () const |
Returns number of blocks owned by the prefetch_pool. More... | |
size_type | size_write () const |
Returns number of blocks owned by the write_pool. More... | |
block_type * | steal () |
Take out a block from the pool. More... | |
void | swap (read_write_pool &obj) |
request_ptr | write (block_type *&block, bid_type bid) |
Passes a block to the pool for writing. More... | |
Protected Types | |
typedef prefetch_pool< block_type > | prefetch_pool_type |
typedef write_pool< block_type > | write_pool_type |
Protected Attributes | |
bool | delete_pools |
prefetch_pool_type * | p_pool |
write_pool_type * | w_pool |
Additional Inherited Members | |
Private Member Functions inherited from stxxl::noncopyable | |
noncopyable () | |
typedef block_type::bid_type stxxl::read_write_pool< BlockType >::bid_type |
Definition at line 30 of file read_write_pool.h.
typedef BlockType stxxl::read_write_pool< BlockType >::block_type |
Definition at line 29 of file read_write_pool.h.
|
protected |
Definition at line 35 of file read_write_pool.h.
typedef unsigned_type stxxl::read_write_pool< BlockType >::size_type |
Definition at line 31 of file read_write_pool.h.
|
protected |
Definition at line 34 of file read_write_pool.h.
|
inlineexplicit |
Constructs pool.
init_size_prefetch | initial number of blocks in the prefetch pool |
init_size_write | initial number of blocks in the write pool |
Definition at line 45 of file read_write_pool.h.
|
inline |
Definition at line 52 of file read_write_pool.h.
|
inline |
Waits for completion of all ongoing requests and frees memory.
Definition at line 64 of file read_write_pool.h.
|
inline |
Definition at line 119 of file read_write_pool.h.
|
inline |
Gives a hint for prefetching a block.
bid | address of a block to be prefetched |
true
if there was a free block to do prefetch and prefetching was scheduled, false
otherwise read
method) calling hint
function has no effect Definition at line 133 of file read_write_pool.h.
Referenced by stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::multi_merge().
|
inline |
Definition at line 138 of file read_write_pool.h.
|
inline |
Reads block. If this block is cached block is not read but passed from the cache.
block | block object, where data to be read to. If block was cached block 's ownership goes to the pool and block from cache is returned in block value. |
bid | address of the block |
block
parameter must be allocated dynamically using new
. Definition at line 149 of file read_write_pool.h.
Referenced by stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::multi_merge().
|
inline |
Resizes size of the pool.
new_size | new size of the pool after the call |
Definition at line 87 of file read_write_pool.h.
Referenced by stxxl::random_shuffle().
|
inline |
Resizes size of the pool.
new_size | new size of the pool after the call |
Definition at line 80 of file read_write_pool.h.
Referenced by stxxl::random_shuffle().
|
inline |
Returns number of blocks owned by the prefetch_pool.
Definition at line 76 of file read_write_pool.h.
|
inline |
Returns number of blocks owned by the write_pool.
Definition at line 73 of file read_write_pool.h.
Referenced by stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::insert_segment().
|
inline |
Take out a block from the pool.
Definition at line 114 of file read_write_pool.h.
Referenced by stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::insert_segment().
|
inline |
Definition at line 56 of file read_write_pool.h.
References stxxl::read_write_pool< BlockType >::delete_pools, stxxl::read_write_pool< BlockType >::p_pool, and stxxl::read_write_pool< BlockType >::w_pool.
|
inline |
Passes a block to the pool for writing.
block | block to write. Ownership of the block goes to the pool. block must be allocated dynamically with using new . |
bid | location, where to write |
block
must be allocated dynamically with using new
. Definition at line 100 of file read_write_pool.h.
Referenced by stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::insert_segment().
|
protected |
Definition at line 39 of file read_write_pool.h.
Referenced by stxxl::read_write_pool< BlockType >::swap().
|
protected |
Definition at line 38 of file read_write_pool.h.
Referenced by stxxl::read_write_pool< BlockType >::swap().
|
protected |
Definition at line 37 of file read_write_pool.h.
Referenced by stxxl::read_write_pool< BlockType >::swap().