Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
buf_istream< BlockType, BidIteratorType > Class Template Reference

Detailed Description

template<typename BlockType, typename BidIteratorType>
class foxxll::buf_istream< BlockType, BidIteratorType >

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

Definition at line 35 of file buf_istream.hpp.

+ Collaboration diagram for buf_istream< BlockType, BidIteratorType >:

#include <buf_istream.hpp>

Public Types

using bid_iterator_type = BidIteratorType
 
using block_type = BlockType
 
using reference = typename block_type::reference
 
using self_type = buf_istream< block_type, bid_iterator_type >
 

Public Member Functions

 buf_istream (bid_iterator_type begin, bid_iterator_type end, size_t nbuffers)
 
 buf_istream (const buf_istream &)=delete
 non-copyable: delete copy-constructor More...
 
 ~buf_istream ()
 Frees used internal objects. 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...
 
self_typeoperator++ ()
 
buf_istreamoperator= (const buf_istream &)=delete
 non-copyable: delete assignment operator More...
 
self_typeoperator>> (reference record)
 

Protected Types

using prefetcher_type = block_prefetcher< block_type, bid_iterator_type >
 

Protected Attributes

block_typecurrent_blk
 
size_t current_elem
 
bool not_finished
 
size_t * prefetch_seq
 
prefetcher_typeprefetcher
 

Private Member Functions

 buf_istream ()
 

Member Typedef Documentation

using bid_iterator_type = BidIteratorType

Definition at line 39 of file buf_istream.hpp.

using block_type = BlockType

Definition at line 38 of file buf_istream.hpp.

Definition at line 45 of file buf_istream.hpp.

using reference = typename block_type::reference

Definition at line 55 of file buf_istream.hpp.

Definition at line 56 of file buf_istream.hpp.

Constructor & Destructor Documentation

buf_istream ( )
inlineprivate

Definition at line 42 of file buf_istream.hpp.

buf_istream ( bid_iterator_type  begin,
bid_iterator_type  end,
size_t  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

Definition at line 62 of file buf_istream.hpp.

References foxxll::compute_prefetch_schedule(), buf_istream< BlockType, BidIteratorType >::current_blk, config::disks_number(), singleton< config >::get_instance(), max(), config::max_device_id(), buf_istream< BlockType, BidIteratorType >::prefetch_seq, buf_istream< BlockType, BidIteratorType >::prefetcher, and block_prefetcher< BlockType, BidIteratorType >::pull_block().

buf_istream ( const buf_istream< BlockType, BidIteratorType > &  )
delete

non-copyable: delete copy-constructor

~buf_istream ( )
inline

Member Function Documentation

reference current ( )
inline

Returns reference to the current record in the stream.

Definition at line 120 of file buf_istream.hpp.

References buf_istream< BlockType, BidIteratorType >::current_blk, and buf_istream< BlockType, BidIteratorType >::current_elem.

reference operator* ( )
inline

Returns reference to the current record in the stream.

Definition at line 126 of file buf_istream.hpp.

References buf_istream< BlockType, BidIteratorType >::current_blk, and buf_istream< BlockType, BidIteratorType >::current_elem.

buf_istream& operator= ( const buf_istream< BlockType, BidIteratorType > &  )
delete

non-copyable: delete assignment operator

self_type& 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)

Definition at line 98 of file buf_istream.hpp.

References block_prefetcher< BlockType, BidIteratorType >::block_consumed(), buf_istream< BlockType, BidIteratorType >::current_blk, buf_istream< BlockType, BidIteratorType >::current_elem, buf_istream< BlockType, BidIteratorType >::not_finished, buf_istream< BlockType, BidIteratorType >::prefetcher, and UNLIKELY.

Member Data Documentation


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