13 #ifndef STXXL_MNG_BUF_OSTREAM_HEADER
14 #define STXXL_MNG_BUF_OSTREAM_HEADER
30 template <
typename BlockType,
typename BIDIteratorType>
52 writer(nbuffers, nbuffers / 2), current_bid(first_bid),
55 current_blk = writer.get_free_block();
63 current_blk->elem[current_elem++] = record;
64 if (
UNLIKELY(current_elem >= block_type::size))
67 current_blk = writer.write(current_blk, *(current_bid++));
76 return current_blk->elem[current_elem];
83 return current_blk->elem[current_elem];
91 if (
UNLIKELY(current_elem >= block_type::size))
94 current_blk = writer.write(current_blk, *(current_bid++));
102 while (current_elem != 0)
114 current_blk = writer.write(current_blk, *(current_bid++));
121 assert(current_elem == 0);
129 #endif // !STXXL_MNG_BUF_OSTREAM_HEADER
friend std::ostream & operator<<(std::ostream &os, const uint_pair &a)
make a uint_pair outputtable via iostreams, using unsigned long long.
buf_ostream< block_type, bid_iterator_type > _Self
_Self & flush()
Force flush of current block, for finishing writing within a block.
buf_ostream(bid_iterator_type first_bid, int_type nbuffers)
Constructs output stream object.
uint_pair & operator++()
prefix increment operator (directly manipulates the integer parts)
BIDIteratorType bid_iterator_type
block_type::reference reference
choose_int_types< my_pointer_size >::int_type int_type
~buf_ostream()
Deallocates internal objects.
buffered_writer< block_type > writer
#define STXXL_BEGIN_NAMESPACE
block_type::const_reference const_reference
reference current()
Returns reference to the current record.
bid_iterator_type current_bid
_Self & fill(const_reference record)
Fill current block with padding and flush.
Encapsulates asynchronous buffered block writing engine.
#define STXXL_END_NAMESPACE