14 #ifndef STXXL_ALGO_RUN_CURSOR_HEADER
15 #define STXXL_ALGO_RUN_CURSOR_HEADER
22 template <
typename BlockType>
30 inline typename BlockType::const_reference
current()
const
32 return (*buffer)[pos];
40 #ifdef STXXL_SORT_SINGLE_PREFETCHER
42 template <
typename MustBeVo
id =
void>
43 struct have_prefetcher
45 static void* untyped_prefetcher;
50 template <
typename BlockType,
51 typename PrefetcherType>
53 #ifdef STXXL_SORT_SINGLE_PREFETCHER
54 ,
public have_prefetcher<>
65 #ifdef STXXL_SORT_SINGLE_PREFETCHER
70 static void set_prefetcher(prefetcher_type* pfptr)
72 untyped_prefetcher = pfptr;
87 return (pos >= block_type::size);
93 if (
UNLIKELY(pos >= block_type::size))
95 if (prefetcher()->block_consumed(buffer))
101 pos = block_type::size;
105 #ifdef STXXL_SORT_SINGLE_PREFETCHER
106 template <
typename MustBeVo
id>
107 void* have_prefetcher<MustBeVoid>::untyped_prefetcher = NULL;
111 template <
typename block_type>
112 struct run_cursor_cmp
114 typedef run_cursor<block_type> cursor_type;
116 inline bool operator () (
const cursor_type& a,
const cursor_type& b)
118 return !((*a.buffer)[a.pos] < (*b.buffer)[b.pos]);
125 #endif // !STXXL_ALGO_RUN_CURSOR_HEADER
prefetcher_type *& prefetcher()
uint_pair & operator++()
prefix increment operator (directly manipulates the integer parts)
block_type::value_type value_type
prefetcher_type * prefetcher_
PrefetcherType prefetcher_type
run_cursor2< block_type, prefetcher_type > _Self
#define STXXL_BEGIN_NAMESPACE
BlockType::const_reference current() const
choose_int_types< my_pointer_size >::unsigned_type unsigned_type
#define STXXL_END_NAMESPACE
run_cursor2(prefetcher_type *p=NULL)