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

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 28 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

using bid_iterator_type = BidIteratorType

Definition at line 32 of file buf_ostream.hpp.

using block_type = BlockType

Definition at line 31 of file buf_ostream.hpp.

using const_reference = typename block_type::const_reference

Definition at line 41 of file buf_ostream.hpp.

using reference = typename block_type::reference

Definition at line 42 of file buf_ostream.hpp.

Definition at line 43 of file buf_ostream.hpp.

Constructor & Destructor Documentation

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 48 of file buf_ostream.hpp.

References buf_ostream< BlockType, BidIteratorType >::current_blk, buffered_writer< BlockType >::get_free_block(), and buf_ostream< BlockType, BidIteratorType >::writer.

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

non-copyable: delete copy-constructor

~buf_ostream ( )
inline

Deallocates internal objects.

Definition at line 121 of file buf_ostream.hpp.

References buf_ostream< BlockType, BidIteratorType >::current_elem.

Member Function Documentation

reference current ( )
inline

Returns reference to the current record.

Returns
reference to the current record

Definition at line 76 of file buf_ostream.hpp.

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

self_type& fill ( const_reference  record)
inline

Fill current block with padding and flush.

Definition at line 102 of file buf_ostream.hpp.

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

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 113 of file buf_ostream.hpp.

References buf_ostream< BlockType, BidIteratorType >::current_bid, buf_ostream< BlockType, BidIteratorType >::current_blk, buf_ostream< BlockType, BidIteratorType >::current_elem, buffered_writer< BlockType >::write(), and buf_ostream< BlockType, BidIteratorType >::writer.

reference operator* ( )
inline

Returns reference to the current record.

Returns
reference to the current record

Definition at line 83 of file buf_ostream.hpp.

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

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 63 of file buf_ostream.hpp.

References buf_ostream< BlockType, BidIteratorType >::current_bid, buf_ostream< BlockType, BidIteratorType >::current_blk, buf_ostream< BlockType, BidIteratorType >::current_elem, UNLIKELY, buffered_writer< BlockType >::write(), and buf_ostream< BlockType, BidIteratorType >::writer.

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

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

non-copyable: delete assignment operator

Member Data Documentation


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