13 #ifndef STXXL_MNG_BUF_OSTREAM_HEADER
14 #define STXXL_MNG_BUF_OSTREAM_HEADER
28 template <
typename BlockType,
typename B
idIteratorType>
50 : writer(nbuffers, nbuffers / 2), current_bid(first_bid),
53 current_blk = writer.get_free_block();
61 current_blk->elem[current_elem++] = record;
62 if (
UNLIKELY(current_elem >= block_type::size))
65 current_blk = writer.write(current_blk, *(current_bid++));
74 return current_blk->elem[current_elem];
81 return current_blk->elem[current_elem];
89 if (
UNLIKELY(current_elem >= block_type::size))
92 current_blk = writer.write(current_blk, *(current_bid++));
100 while (current_elem != 0)
112 current_blk = writer.write(current_blk, *(current_bid++));
119 assert(current_elem == 0);
127 #endif // !STXXL_MNG_BUF_OSTREAM_HEADER
BidIteratorType bid_iterator_type
friend std::ostream & operator<<(std::ostream &os, const uint_pair &a)
make a uint_pair outputtable via iostreams, using unsigned long long.
~buf_ostream()
Deallocates internal objects.
self_type & flush()
Force flush of current block, for finishing writing within a block.
uint_pair & operator++()
prefix increment operator (directly manipulates the integer parts)
self_type & fill(const_reference record)
Fill current block with padding and flush.
bid_iterator_type current_bid
choose_int_types< my_pointer_size >::int_type int_type
reference current()
Returns reference to the current record.
buf_ostream< block_type, bid_iterator_type > self_type
#define STXXL_BEGIN_NAMESPACE
block_type::reference reference
buffered_writer< block_type > writer
buf_ostream(bid_iterator_type first_bid, int_type nbuffers)
Constructs output stream object.
block_type::const_reference const_reference
#define STXXL_END_NAMESPACE