STXXL  1.4.0
 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 31 of file buf_ostream.h.

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

Public Types

typedef buf_ostream
< block_type,
bid_iterator_type
_Self
 
typedef BIDIteratorType bid_iterator_type
 
typedef BlockType block_type
 
typedef block_type::const_reference const_reference
 
typedef block_type::reference reference
 

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...
 
_Selffill (const_reference record)
 Fill current block with padding and flush. More...
 
_Selfflush ()
 Force flush of current block, for finishing writing within a block. More...
 
reference operator* ()
 Returns reference to the current record. More...
 
_Selfoperator++ ()
 Moves to the next record in the stream. More...
 
_Selfoperator<< (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 buf_ostream<block_type, bid_iterator_type> stxxl::buf_ostream< BlockType, BIDIteratorType >::_Self

Definition at line 46 of file buf_ostream.h.

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

Definition at line 35 of file buf_ostream.h.

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

Definition at line 34 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 44 of file buf_ostream.h.

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

Definition at line 45 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 51 of file buf_ostream.h.

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

Deallocates internal objects.

Definition at line 119 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 74 of file buf_ostream.h.

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

Fill current block with padding and flush.

Definition at line 100 of file buf_ostream.h.

References operator<<().

template<typename BlockType, typename BIDIteratorType>
_Self& 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 111 of file buf_ostream.h.

Referenced by stxxl::for_each_m(), 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 81 of file buf_ostream.h.

template<typename BlockType, typename BIDIteratorType>
_Self& 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 88 of file buf_ostream.h.

References UNLIKELY.

template<typename BlockType, typename BIDIteratorType>
_Self& 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 61 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 39 of file buf_ostream.h.

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

Definition at line 41 of file buf_ostream.h.

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

Definition at line 40 of file buf_ostream.h.

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

Definition at line 38 of file buf_ostream.h.


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