Stxxl
1.3.1
|
Encapsulates asynchronous buffered block writing engine. More...
#include <buf_writer.h>
Public Member Functions | |
buffered_writer (unsigned_type write_buf_size, unsigned_type write_batch_size) | |
Constructs an object. 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... | |
void | flush () |
Flushes not yet written buffers. More... | |
virtual | ~buffered_writer () |
Flushes not yet written buffers and frees used memory. More... | |
Protected Types | |
typedef block_type::bid_type | bid_type |
typedef std::priority_queue< batch_entry, std::vector< batch_entry >, batch_entry_cmp > | batch_type |
Protected Attributes | |
const unsigned_type | nwriteblocks |
block_type * | write_buffers |
bid_type * | write_bids |
request_ptr * | write_reqs |
const unsigned_type | writebatchsize |
std::vector< int_type > | free_write_blocks |
std::vector< int_type > | busy_write_blocks |
batch_type | batch_write_blocks |
Encapsulates asynchronous buffered block writing engine.
buffered_writer
overlaps I/Os with filling of output buffer.
|
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) |
|
inlinevirtual |
Flushes not yet written buffers and frees used memory.
|
inline |
Flushes not yet written buffers.
Referenced by stream::runs_creator< from_sorted_sequences< ValueType_ >, Cmp_, BlockSize_, AllocStr_ >::result().
|
inline |
Returns free block from the internal buffer pool.
Referenced by buf_ostream< BlkTp_, BIDIteratorTp_ >::buf_ostream(), and buffered_writer< typed_block >::write().
|
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 |
Referenced by stream::runs_creator< from_sorted_sequences< ValueType_ >, Cmp_, BlockSize_, AllocStr_ >::finish(), buf_ostream< BlkTp_, BIDIteratorTp_ >::operator++(), buf_ostream< BlkTp_, BIDIteratorTp_ >::operator<<(), and stream::runs_creator< from_sorted_sequences< ValueType_ >, Cmp_, BlockSize_, AllocStr_ >::push().