Stxxl
1.3.1
|
Implements dynamically resizable buffered writing pool. More...
#include <write_pool.h>
Inherits noncopyable.
Public Member Functions | |
write_pool (unsigned_type init_size=1) | |
Constructs pool. | |
void | swap (write_pool &obj) |
virtual | ~write_pool () |
Waits for completion of all ongoing write requests and frees memory. | |
unsigned_type | size () const |
Returns number of owned blocks. | |
request_ptr | write (block_type *&block, bid_type bid) |
Passes a block to the pool for writing. | |
block_type * | steal () |
Take out a block from the pool. | |
request_ptr | steal_request (bid_type bid) |
void | add (block_type *&block) |
Protected Member Functions | |
void | check_all_busy () |
Protected Attributes | |
std::list< block_type * > | free_blocks |
std::list< busy_entry > | busy_blocks |
unsigned_type | free_blocks_size |
unsigned_type | busy_blocks_size |
Implements dynamically resizable buffered writing pool.
|
inlineexplicit |
Constructs pool.
init_size | initial number of blocks in the pool |
|
inlinevirtual |
Waits for completion of all ongoing write requests and frees memory.
|
inline |
Returns number of owned blocks.
Referenced by read_write_pool< BlockType >::size_write(), and write_pool< BlockType >::steal().
|
inline |
Take out a block from the pool.
References write_pool< BlockType >::size(), and wait_any().
Referenced by read_write_pool< BlockType >::steal().
|
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
. Referenced by read_write_pool< BlockType >::write().