13 #ifndef STXXL_MNG_BUF_ISTREAM_HEADER
14 #define STXXL_MNG_BUF_ISTREAM_HEADER
29 #define BUF_ISTREAM_CHECK_END
36 template <
typename BlockType,
typename BIDIteratorType>
52 #ifdef BUF_ISTREAM_CHECK_END
71 const unsigned_type ndisks = config::get_instance()->disks_number();
72 const int_type seq_length = _end - _begin;
73 prefetch_seq =
new int_type[seq_length];
87 current_blk = prefetcher->pull_block();
96 #ifdef BUF_ISTREAM_CHECK_END
100 record = current_blk->elem[current_elem++];
102 if (
UNLIKELY(current_elem >= block_type::size))
105 #ifdef BUF_ISTREAM_CHECK_END
106 not_finished = prefetcher->block_consumed(current_blk);
108 prefetcher->block_consumed(current_blk);
118 return current_blk->elem[current_elem];
124 return current_blk->elem[current_elem];
131 #ifdef BUF_ISTREAM_CHECK_END
132 assert(not_finished);
137 if (
UNLIKELY(current_elem >= block_type::size))
140 #ifdef BUF_ISTREAM_CHECK_END
141 not_finished = prefetcher->block_consumed(current_blk);
143 prefetcher->block_consumed(current_blk);
153 delete[] prefetch_seq;
161 #endif // !STXXL_MNG_BUF_ISTREAM_HEADER
buf_istream< block_type, bid_iterator_type > _Self
BIDIteratorType bid_iterator_type
~buf_istream()
Frees used internal objects.
#define BUF_ISTREAM_CHECK_END
uint_pair & operator++()
prefix increment operator (directly manipulates the integer parts)
reference current()
Returns reference to the current record in the stream.
Encapsulates asynchronous prefetching engine.
const Tp & STXXL_MAX(const Tp &a, const Tp &b)
choose_int_types< my_pointer_size >::int_type int_type
#define STXXL_BEGIN_NAMESPACE
choose_int_types< my_pointer_size >::unsigned_type unsigned_type
void compute_prefetch_schedule(const int_type *first, const int_type *last, int_type *out_first, int_type m, int_type D)
buf_istream(bid_iterator_type _begin, bid_iterator_type _end, int_type nbuffers)
Constructs input stream object.
prefetcher_type * prefetcher
block_type::reference reference
block_prefetcher< block_type, bid_iterator_type > prefetcher_type
#define STXXL_END_NAMESPACE