Stxxl  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Protected Attributes
stxxl::buf_ostream< BlkTp_, BIDIteratorTp_ > Class Template Reference

Buffered output stream. More...

#include <buf_ostream.h>

Collaboration diagram for stxxl::buf_ostream< BlkTp_, BIDIteratorTp_ >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef BlkTp_ block_type
typedef BIDIteratorTp_ bid_iterator_type
typedef block_type::const_reference const_reference
typedef block_type::reference reference
typedef buf_ostream
< block_type,
bid_iterator_type
_Self

Public Member Functions

 buf_ostream (bid_iterator_type first_bid, int_type nbuffers)
 Constructs output stream object.
_Selfoperator<< (const_reference record)
 Output stream operator, writes out record.
reference current ()
 Returns reference to the current record.
reference operator* ()
 Returns reference to the current record.
_Selfoperator++ ()
 Moves to the next record in the stream.
_Selffill (const_reference record)
 fill current block with padding and flush
virtual ~buf_ostream ()
 Deallocates internal objects.

Protected Attributes

buffered_writer< block_typewriter
bid_iterator_type current_bid
int_type current_elem
block_typecurrent_blk

Detailed Description

template<typename BlkTp_, typename BIDIteratorTp_>
class stxxl::buf_ostream< BlkTp_, BIDIteratorTp_ >

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
Examples:
mng/test_buf_streams.cpp.

Definition at line 30 of file buf_ostream.h.


Member Typedef Documentation

template<typename BlkTp_, typename BIDIteratorTp_>
typedef buf_ostream<block_type, bid_iterator_type> stxxl::buf_ostream< BlkTp_, BIDIteratorTp_ >::_Self

Definition at line 45 of file buf_ostream.h.

template<typename BlkTp_, typename BIDIteratorTp_>
typedef BIDIteratorTp_ stxxl::buf_ostream< BlkTp_, BIDIteratorTp_ >::bid_iterator_type

Definition at line 34 of file buf_ostream.h.

template<typename BlkTp_, typename BIDIteratorTp_>
typedef BlkTp_ stxxl::buf_ostream< BlkTp_, BIDIteratorTp_ >::block_type

Definition at line 33 of file buf_ostream.h.

template<typename BlkTp_, typename BIDIteratorTp_>
typedef block_type::const_reference stxxl::buf_ostream< BlkTp_, BIDIteratorTp_ >::const_reference

Definition at line 43 of file buf_ostream.h.

template<typename BlkTp_, typename BIDIteratorTp_>
typedef block_type::reference stxxl::buf_ostream< BlkTp_, BIDIteratorTp_ >::reference

Definition at line 44 of file buf_ostream.h.


Constructor & Destructor Documentation

template<typename BlkTp_, typename BIDIteratorTp_>
stxxl::buf_ostream< BlkTp_, BIDIteratorTp_ >::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 50 of file buf_ostream.h.

template<typename BlkTp_, typename BIDIteratorTp_>
virtual stxxl::buf_ostream< BlkTp_, BIDIteratorTp_ >::~buf_ostream ( ) [inline, virtual]

Deallocates internal objects.

Definition at line 109 of file buf_ostream.h.


Member Function Documentation

template<typename BlkTp_, typename BIDIteratorTp_>
reference stxxl::buf_ostream< BlkTp_, BIDIteratorTp_ >::current ( ) [inline]

Returns reference to the current record.

Returns:
reference to the current record

Definition at line 73 of file buf_ostream.h.

template<typename BlkTp_, typename BIDIteratorTp_>
_Self& stxxl::buf_ostream< BlkTp_, BIDIteratorTp_ >::fill ( const_reference  record) [inline]

fill current block with padding and flush

Definition at line 99 of file buf_ostream.h.

References stxxl::operator<<().

template<typename BlkTp_, typename BIDIteratorTp_>
reference stxxl::buf_ostream< BlkTp_, BIDIteratorTp_ >::operator* ( ) [inline]

Returns reference to the current record.

Returns:
reference to the current record

Definition at line 80 of file buf_ostream.h.

template<typename BlkTp_, typename BIDIteratorTp_>
_Self& stxxl::buf_ostream< BlkTp_, BIDIteratorTp_ >::operator++ ( ) [inline]

Moves to the next record in the stream.

Returns:
reference to itself after the advance

Definition at line 87 of file buf_ostream.h.

References UNLIKELY.

template<typename BlkTp_, typename BIDIteratorTp_>
_Self& stxxl::buf_ostream< BlkTp_, BIDIteratorTp_ >::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 60 of file buf_ostream.h.

References UNLIKELY.


Member Data Documentation

template<typename BlkTp_, typename BIDIteratorTp_>
bid_iterator_type stxxl::buf_ostream< BlkTp_, BIDIteratorTp_ >::current_bid [protected]

Definition at line 38 of file buf_ostream.h.

template<typename BlkTp_, typename BIDIteratorTp_>
block_type* stxxl::buf_ostream< BlkTp_, BIDIteratorTp_ >::current_blk [protected]

Definition at line 40 of file buf_ostream.h.

template<typename BlkTp_, typename BIDIteratorTp_>
int_type stxxl::buf_ostream< BlkTp_, BIDIteratorTp_ >::current_elem [protected]

Definition at line 39 of file buf_ostream.h.

template<typename BlkTp_, typename BIDIteratorTp_>
buffered_writer<block_type> stxxl::buf_ostream< BlkTp_, BIDIteratorTp_ >::writer [protected]

Definition at line 37 of file buf_ostream.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines