Thrill  0.1

Detailed Description

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

Buffered output stream.

Writes data records to the stream of blocks.

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

Definition at line 30 of file buf_ostream.hpp.

+ Collaboration diagram for buf_ostream< BlockType, BidIteratorType >:

#include <buf_ostream.hpp>

Public Types

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

Public Member Functions

 buf_ostream (bid_iterator_type first_bid, size_t nbuffers)
 
 buf_ostream (const buf_ostream &)=delete
 non-copyable: delete copy-constructor More...
 
 ~buf_ostream ()
 Deallocates internal objects. More...
 
reference current ()
 
self_typefill (const_reference record)
 Fill current block with padding and flush. More...
 
self_typeflush ()
 
reference operator* ()
 
self_typeoperator++ ()
 
self_typeoperator<< (const_reference record)
 
buf_ostreamoperator= (const buf_ostream &)=delete
 non-copyable: delete assignment operator More...
 

Protected Attributes

bid_iterator_type current_bid
 
block_typecurrent_blk
 
size_t current_elem
 
buffered_writer< block_typewriter
 

Member Typedef Documentation

◆ bid_iterator_type

using bid_iterator_type = BidIteratorType

Definition at line 34 of file buf_ostream.hpp.

◆ block_type

using block_type = BlockType

Definition at line 33 of file buf_ostream.hpp.

◆ const_reference

using const_reference = typename block_type::const_reference

Definition at line 43 of file buf_ostream.hpp.

◆ reference

using reference = typename block_type::reference

Definition at line 44 of file buf_ostream.hpp.

◆ self_type

Definition at line 45 of file buf_ostream.hpp.

Constructor & Destructor Documentation

◆ buf_ostream() [1/2]

buf_ostream ( bid_iterator_type  first_bid,
size_t  nbuffers 
)
inline

Constructs output stream object.

Parameters
first_bidbid_iterator pointing to the first block of the stream
nbuffersnumber of buffers for internal use

Definition at line 50 of file buf_ostream.hpp.

References buffered_writer< BlockType >::get_free_block(), and buf_ostream< BlockType, BidIteratorType >::operator=().

◆ buf_ostream() [2/2]

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

non-copyable: delete copy-constructor

◆ ~buf_ostream()

~buf_ostream ( )
inline

Deallocates internal objects.

Definition at line 123 of file buf_ostream.hpp.

Member Function Documentation

◆ current()

reference current ( )
inline

Returns reference to the current record.

Returns
reference to the current record

Definition at line 78 of file buf_ostream.hpp.

References buf_ostream< BlockType, BidIteratorType >::current_elem.

◆ fill()

self_type& fill ( const_reference  record)
inline

Fill current block with padding and flush.

Definition at line 104 of file buf_ostream.hpp.

References buf_ostream< BlockType, BidIteratorType >::operator<<().

◆ flush()

self_type& flush ( )
inline

Force flush of current block, for finishing writing within a block.

Warning
Use with caution as the block may contain uninitialized data

Definition at line 115 of file buf_ostream.hpp.

References buffered_writer< BlockType >::write().

◆ operator*()

reference operator* ( )
inline

Returns reference to the current record.

Returns
reference to the current record

Definition at line 85 of file buf_ostream.hpp.

References buf_ostream< BlockType, BidIteratorType >::current_elem.

◆ operator++()

self_type& operator++ ( )
inline

Moves to the next record in the stream.

Returns
reference to itself after the advance

Definition at line 92 of file buf_ostream.hpp.

References buf_ostream< BlockType, BidIteratorType >::current_elem, TLX_UNLIKELY, and buffered_writer< BlockType >::write().

◆ operator<<()

self_type& operator<< ( const_reference  record)
inline

Output stream operator, writes out record.

Parameters
recordconst reference to block record type, containing a value of record to write to the stream
Returns
reference to itself (stream object)

Definition at line 65 of file buf_ostream.hpp.

References TLX_UNLIKELY, and buffered_writer< BlockType >::write().

Referenced by buf_ostream< BlockType, BidIteratorType >::fill().

◆ operator=()

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

non-copyable: delete assignment operator

Referenced by buf_ostream< BlockType, BidIteratorType >::buf_ostream().

Member Data Documentation

◆ current_bid

bid_iterator_type current_bid
protected

Definition at line 38 of file buf_ostream.hpp.

◆ current_blk

block_type* current_blk
protected

Definition at line 40 of file buf_ostream.hpp.

◆ current_elem

◆ writer

buffered_writer<block_type> writer
protected

Definition at line 37 of file buf_ostream.hpp.


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