STXXL  1.4-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stxxl::buf_ostream< BlockType, BidIteratorType > Class Template Reference

Detailed Description

template<typename BlockType, typename BidIteratorType>
class stxxl::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 29 of file buf_ostream.h.

+ Inheritance diagram for stxxl::buf_ostream< BlockType, BidIteratorType >:
+ Collaboration diagram for stxxl::buf_ostream< BlockType, BidIteratorType >:

Public Types

typedef BidIteratorType bid_iterator_type
 
typedef BlockType block_type
 
typedef block_type::const_reference const_reference
 
typedef block_type::reference reference
 
typedef buf_ostream
< block_type,
bid_iterator_type
self_type
 

Public Member Functions

 buf_ostream (bid_iterator_type first_bid, int_type nbuffers)
 Constructs output stream object. More...
 
 ~buf_ostream ()
 Deallocates internal objects. More...
 
reference current ()
 Returns reference to the current record. More...
 
self_typefill (const_reference record)
 Fill current block with padding and flush. More...
 
self_typeflush ()
 Force flush of current block, for finishing writing within a block. More...
 
reference operator* ()
 Returns reference to the current record. More...
 
self_typeoperator++ ()
 Moves to the next record in the stream. More...
 
self_typeoperator<< (const_reference record)
 Output stream operator, writes out record. More...
 

Protected Attributes

bid_iterator_type current_bid
 
block_typecurrent_blk
 
int_type current_elem
 
buffered_writer< block_typewriter
 

Additional Inherited Members

- Private Member Functions inherited from stxxl::noncopyable
 noncopyable ()
 

Member Typedef Documentation

template<typename BlockType, typename BidIteratorType>
typedef BidIteratorType stxxl::buf_ostream< BlockType, BidIteratorType >::bid_iterator_type

Definition at line 33 of file buf_ostream.h.

template<typename BlockType, typename BidIteratorType>
typedef BlockType stxxl::buf_ostream< BlockType, BidIteratorType >::block_type

Definition at line 32 of file buf_ostream.h.

template<typename BlockType, typename BidIteratorType>
typedef block_type::const_reference stxxl::buf_ostream< BlockType, BidIteratorType >::const_reference

Definition at line 42 of file buf_ostream.h.

template<typename BlockType, typename BidIteratorType>
typedef block_type::reference stxxl::buf_ostream< BlockType, BidIteratorType >::reference

Definition at line 43 of file buf_ostream.h.

template<typename BlockType, typename BidIteratorType>
typedef buf_ostream<block_type, bid_iterator_type> stxxl::buf_ostream< BlockType, BidIteratorType >::self_type

Definition at line 44 of file buf_ostream.h.

Constructor & Destructor Documentation

template<typename BlockType, typename BidIteratorType>
stxxl::buf_ostream< BlockType, BidIteratorType >::buf_ostream ( bid_iterator_type  first_bid,
int_type  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 49 of file buf_ostream.h.

template<typename BlockType, typename BidIteratorType>
stxxl::buf_ostream< BlockType, BidIteratorType >::~buf_ostream ( )
inline

Deallocates internal objects.

Definition at line 117 of file buf_ostream.h.

Member Function Documentation

template<typename BlockType, typename BidIteratorType>
reference stxxl::buf_ostream< BlockType, BidIteratorType >::current ( )
inline

Returns reference to the current record.

Returns
reference to the current record

Definition at line 72 of file buf_ostream.h.

template<typename BlockType, typename BidIteratorType>
self_type& stxxl::buf_ostream< BlockType, BidIteratorType >::fill ( const_reference  record)
inline

Fill current block with padding and flush.

Definition at line 98 of file buf_ostream.h.

References operator<<().

template<typename BlockType, typename BidIteratorType>
self_type& stxxl::buf_ostream< BlockType, BidIteratorType >::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 109 of file buf_ostream.h.

Referenced by stxxl::for_each_m(), stxxl::stream::materialize(), and stxxl::random_shuffle().

template<typename BlockType, typename BidIteratorType>
reference stxxl::buf_ostream< BlockType, BidIteratorType >::operator* ( )
inline

Returns reference to the current record.

Returns
reference to the current record

Definition at line 79 of file buf_ostream.h.

template<typename BlockType, typename BidIteratorType>
self_type& stxxl::buf_ostream< BlockType, BidIteratorType >::operator++ ( )
inline

Moves to the next record in the stream.

Returns
reference to itself after the advance

Definition at line 86 of file buf_ostream.h.

References UNLIKELY.

template<typename BlockType, typename BidIteratorType>
self_type& stxxl::buf_ostream< BlockType, BidIteratorType >::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 59 of file buf_ostream.h.

References UNLIKELY.

Member Data Documentation

template<typename BlockType, typename BidIteratorType>
bid_iterator_type stxxl::buf_ostream< BlockType, BidIteratorType >::current_bid
protected

Definition at line 37 of file buf_ostream.h.

template<typename BlockType, typename BidIteratorType>
block_type* stxxl::buf_ostream< BlockType, BidIteratorType >::current_blk
protected

Definition at line 39 of file buf_ostream.h.

template<typename BlockType, typename BidIteratorType>
int_type stxxl::buf_ostream< BlockType, BidIteratorType >::current_elem
protected

Definition at line 38 of file buf_ostream.h.

template<typename BlockType, typename BidIteratorType>
buffered_writer<block_type> stxxl::buf_ostream< BlockType, BidIteratorType >::writer
protected

Definition at line 36 of file buf_ostream.h.


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