STXXL
1.4.1
|
Buffered sequential reverse reader from a vector using overlapped I/O.
This buffered reader can be used to read a large sequential region of a vector in_reverse using overlapped I/O. The object is created from an iterator range, which can then be read to using operator<<(), or with operator*() and operator++(), where ++ actually goes to the preceding element.
The interface also fulfills all requirements of a stream. Actually most of the code is identical to stream::vector_iterator2stream.
Note that this buffered reader is inefficient for reading small ranges. This is intentional, as one can just use operator[] on the vector for that.
Public Types | |
typedef vector_iterator::bids_container_iterator | bids_container_iterator |
block identifier iterator of the vector More... | |
typedef vector_iterator::block_type | block_type |
block type used in the vector More... | |
typedef buf_istream_reverse < block_type, bids_container_iterator > | buf_istream_type |
construct output buffered stream used for overlapped reading More... | |
typedef vector_type::size_type | size_type |
size of remaining data More... | |
typedef vector_iterator::value_type | value_type |
value type of the output vector More... | |
typedef VectorIterator | vector_iterator |
template parameter: the vector iterator type More... | |
typedef vector_iterator::vector_type | vector_type |
type of the input vector More... | |
Public Member Functions | |
vector_bufreader_reverse (vector_iterator begin, vector_iterator end, unsigned_type nbuffers=0) | |
Create overlapped reader for the given iterator range. More... | |
vector_bufreader_reverse (const vector_type &vec, unsigned_type nbuffers=0) | |
Create overlapped reader for the whole vector's content. More... | |
~vector_bufreader_reverse () | |
Finish reading and free buffered reader. More... | |
bool | empty () const |
Returns true once the whole range has been read. More... | |
const value_type & | operator* () const |
Return constant reference to current item. More... | |
vector_bufreader_reverse & | operator++ () |
Advance to next item (asserts if !empty()). More... | |
const value_type * | operator-> () const |
Return constant pointer to current item. More... | |
vector_bufreader_reverse & | operator>> (value_type &v) |
Read current item into variable and advance to next one. More... | |
void | rewind () |
Rewind stream back to begin. Note that this recreates the buffered reader and is thus not cheap. More... | |
size_type | size () const |
Return remaining size. More... | |
Protected Attributes | |
vector_iterator | m_begin |
iterator to the beginning of the range. More... | |
buf_istream_type * | m_bufin |
buffered input stream used to overlapped I/O. More... | |
vector_iterator | m_end |
iterator to the end of the range. More... | |
vector_iterator | m_iter |
internal "current" iterator into the vector. More... | |
unsigned_type | m_nbuffers |
number of blocks to use as buffers. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from stxxl::noncopyable | |
noncopyable () | |
typedef vector_iterator::bids_container_iterator stxxl::vector_bufreader_reverse< VectorIteratorType >::bids_container_iterator |
typedef vector_iterator::block_type stxxl::vector_bufreader_reverse< VectorIteratorType >::block_type |
typedef buf_istream_reverse<block_type, bids_container_iterator> stxxl::vector_bufreader_reverse< VectorIteratorType >::buf_istream_type |
typedef vector_type::size_type stxxl::vector_bufreader_reverse< VectorIteratorType >::size_type |
typedef vector_iterator::value_type stxxl::vector_bufreader_reverse< VectorIteratorType >::value_type |
typedef VectorIterator stxxl::vector_bufreader_reverse< VectorIteratorType >::vector_iterator |
typedef vector_iterator::vector_type stxxl::vector_bufreader_reverse< VectorIteratorType >::vector_type |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Read current item into variable and advance to next one.
Definition at line 2328 of file vector.h.
References operator++().
|
inline |
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |