Stxxl  1.3.2
Public Types | Public Member Functions | Protected Types | Protected Attributes | List of all members
buf_istream< BlkTp_, BIDIteratorTp_ > Class Template Reference

Buffered input stream. More...

#include <buf_istream.h>

Collaboration diagram for buf_istream< BlkTp_, BIDIteratorTp_ >:
Collaboration graph
[legend]

Public Types

typedef block_type::reference reference
 
typedef buf_istream
< block_type,
bid_iterator_type > 
_Self
 

Public Member Functions

 buf_istream (bid_iterator_type _begin, bid_iterator_type _end, int_type nbuffers)
 Constructs input stream object. More...
 
_Selfoperator>> (reference record)
 Input stream operator, reads in record. More...
 
reference current ()
 Returns reference to the current record in the stream. More...
 
reference operator* ()
 Returns reference to the current record in the stream. More...
 
_Selfoperator++ ()
 Moves to the next record in the stream. More...
 
virtual ~buf_istream ()
 Frees used internal objects. More...
 

Protected Types

typedef block_prefetcher
< block_type,
bid_iterator_type > 
prefetcher_type
 

Protected Attributes

prefetcher_typeprefetcher
 
bid_iterator_type begin_bid
 
bid_iterator_type end_bid
 
int_type current_elem
 
block_type * current_blk
 
int_type * prefetch_seq
 
bool not_finished
 

Detailed Description

template<typename BlkTp_, typename BIDIteratorTp_>
class buf_istream< BlkTp_, BIDIteratorTp_ >

Buffered input stream.

Reads data records from the stream of blocks.

Remarks
Reading performed in the background, i.e. with overlapping of I/O and computation

Constructor & Destructor Documentation

template<typename BlkTp_ , typename BIDIteratorTp_ >
buf_istream< BlkTp_, BIDIteratorTp_ >::buf_istream ( bid_iterator_type  _begin,
bid_iterator_type  _end,
int_type  nbuffers 
)
inline

Constructs input stream object.

Parameters
_beginbid_iterator pointing to the first block of the stream
_endbid_iterator pointing to the ( last + 1 ) block of the stream
nbuffersnumber of buffers for internal use

References block_prefetcher< block_type, bid_iterator_type >::pull_block().

template<typename BlkTp_ , typename BIDIteratorTp_ >
virtual buf_istream< BlkTp_, BIDIteratorTp_ >::~buf_istream ( )
inlinevirtual

Frees used internal objects.

Member Function Documentation

template<typename BlkTp_ , typename BIDIteratorTp_ >
reference buf_istream< BlkTp_, BIDIteratorTp_ >::current ( )
inline

Returns reference to the current record in the stream.

Returns
reference to the current record in the stream
template<typename BlkTp_ , typename BIDIteratorTp_ >
reference buf_istream< BlkTp_, BIDIteratorTp_ >::operator* ( )
inline

Returns reference to the current record in the stream.

Returns
reference to the current record in the stream
template<typename BlkTp_ , typename BIDIteratorTp_ >
_Self& buf_istream< BlkTp_, BIDIteratorTp_ >::operator++ ( )
inline

Moves to the next record in the stream.

Returns
reference to itself after the advance

References block_prefetcher< block_type, bid_iterator_type >::block_consumed().

template<typename BlkTp_ , typename BIDIteratorTp_ >
_Self& buf_istream< BlkTp_, BIDIteratorTp_ >::operator>> ( reference  record)
inline

Input stream operator, reads in record.

Parameters
recordreference to the block record type, contains value of the next record in the stream after the call of the operator
Returns
reference to itself (stream object)

References block_prefetcher< block_type, bid_iterator_type >::block_consumed().


The documentation for this class was generated from the following file: