25 #ifndef _TPIE_PRIORITY_QUEUE_H_
26 #define _TPIE_PRIORITY_QUEUE_H_
28 #include <tpie/config.h>
44 #include <boost/filesystem.hpp>
76 template<
typename T,
typename Comparator = std::less<T>,
typename OPQType = pq_overflow_heap<T, Comparator> >
78 typedef memory_size_type group_type;
79 typedef memory_size_type slot_type;
110 void push(
const T& x);
135 stream_size_type
size()
const;
191 memory_size_type setting_k;
193 memory_size_type current_r;
195 memory_size_type setting_m;
197 memory_size_type setting_mmark;
199 memory_size_type slot_data_id;
201 stream_size_type m_size;
202 memory_size_type buffer_size;
203 memory_size_type buffer_start;
207 void init(memory_size_type mm_avail);
209 void slot_start_set(slot_type slot, memory_size_type n);
210 memory_size_type slot_start(slot_type slot)
const;
211 void slot_size_set(slot_type slot, memory_size_type n);
212 memory_size_type slot_size(slot_type slot)
const;
213 void group_start_set(group_type group, memory_size_type n);
214 memory_size_type group_start(group_type group)
const;
215 void group_size_set(group_type group, memory_size_type n);
216 memory_size_type group_size(group_type group)
const;
222 void slot_data_set(slot_type slotid, memory_size_type n);
223 temp_file & group_data(group_type groupid);
224 memory_size_type slot_max_size(slot_type slotid);
225 void write_slot(slot_type slotid, T* arr, memory_size_type len);
226 slot_type free_slot(group_type group);
227 void empty_group(group_type group);
229 void fill_group_buffer(group_type group);
230 void compact(slot_type slot);
232 void remove_group_buffer(group_type group);
236 #include "priority_queue.inl"
External memory priority queue implementation.
Priority queue overflow heap.
Priority queue merge heap.
This file contains a few deprecated definitions for legacy code.
Logging functionality and log_level codes for different priorities of log messages.
Generic internal array with known memory requirements.
priority_queue(double f=1.0, float b=0.0625)
Constructor.
bool empty() const
Return true if queue is empty otherwise false.
Class representing the existence of a temporary file.
F pop_equals(F f)
Pop all elements with priority equal to that of the top element, and process each by invoking f's cal...
stream_size_type size() const
Returns the size of the queue.
~priority_queue()
Destructor.
const T & top()
See what's on the top of the priority queue.
void pop()
Remove the top element from the priority queue.
void push(const T &x)
Insert an element into the priority queue.