STXXL
1.4.0
|
Encapsulates asynchronous buffered block writing engine.
buffered_writer
overlaps I/Os with filling of output buffer.
Definition at line 38 of file buf_writer.h.
Classes | |
struct | batch_entry |
struct | batch_entry_cmp |
Public Member Functions | |
buffered_writer (unsigned_type write_buf_size, unsigned_type write_batch_size) | |
Constructs an object. More... | |
virtual | ~buffered_writer () |
Flushes not yet written buffers and frees used memory. More... | |
void | flush () |
Flushes not yet written buffers. More... | |
block_type * | get_free_block () |
Returns free block from the internal buffer pool. More... | |
block_type * | write (block_type *filled_block, const bid_type &bid) |
Submits block for writing. More... | |
Protected Types | |
typedef std::priority_queue < batch_entry, std::vector < batch_entry > , batch_entry_cmp > | batch_type |
typedef block_type::bid_type | bid_type |
Protected Attributes | |
batch_type | batch_write_blocks |
std::vector< int_type > | busy_write_blocks |
std::vector< int_type > | free_write_blocks |
const unsigned_type | nwriteblocks |
bid_type * | write_bids |
block_type * | write_buffers |
request_ptr * | write_reqs |
const unsigned_type | writebatchsize |
Additional Inherited Members | |
Private Member Functions inherited from stxxl::noncopyable | |
noncopyable () | |
|
protected |
Definition at line 67 of file buf_writer.h.
|
protected |
Definition at line 41 of file buf_writer.h.
|
inline |
Constructs an object.
write_buf_size | number of write buffers to use |
write_batch_size | number of blocks to accumulate in order to flush write requests (bulk buffered writing) |
Definition at line 75 of file buf_writer.h.
|
inlinevirtual |
Flushes not yet written buffers and frees used memory.
Definition at line 189 of file buf_writer.h.
|
inline |
Flushes not yet written buffers.
Definition at line 157 of file buf_writer.h.
|
inline |
Returns free block from the internal buffer pool.
Definition at line 90 of file buf_writer.h.
|
inline |
Submits block for writing.
filled_block | pointer to the block |
filled_block
must be value returned by get_free_block()
or write()
methods bid | block identifier, a place to write data of the filled_block |
Definition at line 130 of file buf_writer.h.
|
protected |
Definition at line 68 of file buf_writer.h.
|
protected |
Definition at line 50 of file buf_writer.h.
|
protected |
Definition at line 49 of file buf_writer.h.
|
protected |
Definition at line 43 of file buf_writer.h.
|
protected |
Definition at line 45 of file buf_writer.h.
|
protected |
Definition at line 44 of file buf_writer.h.
|
protected |
Definition at line 46 of file buf_writer.h.
|
protected |
Definition at line 47 of file buf_writer.h.