STXXL
1.4.1
|
Buffered sequential writer to a vector using overlapped I/O.
This buffered writer can be used to write a large sequential region of a vector using overlapped I/O. The object is created from an iterator range, which can then be written to using operator << (), or with operator * () and operator ++ ().
The buffered writer is given one iterator in the constructor. When writing, this iterator advances in the vector and will enlarge the vector once it reaches the end(). The vector size is doubled each time; nevertheless, it is better to preinitialize the vector's size using stxxl::vector::resize().
Public Types | |
typedef iterator::bids_container_iterator | bids_container_iterator |
block identifier iterator of the vector More... | |
typedef iterator::block_type | block_type |
block type used in the vector More... | |
typedef buf_ostream < block_type, bids_container_iterator > | buf_ostream_type |
construct output buffered stream used for overlapped writing More... | |
typedef VectorIterator | iterator |
template parameter: the vector iterator type More... | |
typedef iterator::value_type | value_type |
value type of the output vector More... | |
typedef iterator::const_iterator | vector_const_iterator |
typedef iterator::iterator | vector_iterator |
iterator type of vector More... | |
typedef iterator::vector_type | vector_type |
type of the output vector More... | |
Public Member Functions | |
vector_bufwriter (vector_iterator begin, unsigned_type nbuffers=0) | |
Create overlapped writer beginning at the given iterator. More... | |
vector_bufwriter (vector_type &vec, unsigned_type nbuffers=0) | |
Create overlapped writer for the vector's beginning. More... | |
~vector_bufwriter () | |
Finish writing and flush output back to vector. More... | |
void | finish () |
Finish writing and flush output back to vector. More... | |
value_type & | operator* () |
Return mutable reference to item at the position of the internal iterator. More... | |
vector_bufwriter & | operator++ () |
Advance internal iterator. More... | |
vector_bufwriter & | operator<< (const value_type &v) |
Write value to the current position and advance the internal iterator. More... | |
Protected Attributes | |
buf_ostream_type * | m_bufout |
buffered output stream used to overlapped I/O. More... | |
vector_const_iterator | m_end |
iterator to the current end of the vector. More... | |
bool | m_grown |
boolean whether the vector was grown, will shorten at finish(). More... | |
vector_iterator | m_iter |
internal iterator into the vector. More... | |
unsigned_type | m_nbuffers |
number of blocks to use as buffers. More... | |
vector_const_iterator | m_prevblk |
iterator into vector of the last block accessed (used to issue updates when the block is switched). More... | |
Additional Inherited Members | |
Protected Member Functions inherited from stxxl::noncopyable | |
noncopyable () | |
typedef iterator::bids_container_iterator stxxl::vector_bufwriter< VectorIteratorType >::bids_container_iterator |
typedef iterator::block_type stxxl::vector_bufwriter< VectorIteratorType >::block_type |
typedef buf_ostream<block_type, bids_container_iterator> stxxl::vector_bufwriter< VectorIteratorType >::buf_ostream_type |
typedef VectorIterator stxxl::vector_bufwriter< VectorIteratorType >::iterator |
typedef iterator::value_type stxxl::vector_bufwriter< VectorIteratorType >::value_type |
typedef iterator::const_iterator stxxl::vector_bufwriter< VectorIteratorType >::vector_const_iterator |
typedef iterator::iterator stxxl::vector_bufwriter< VectorIteratorType >::vector_iterator |
typedef iterator::vector_type stxxl::vector_bufwriter< VectorIteratorType >::vector_type |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Write value to the current position and advance the internal iterator.
Definition at line 2537 of file vector.h.
References operator++().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |