Overflow Priority Queue, based on a simple Heap.
More...
#include <tpie/pq_overflow_heap.h>
|
| pq_overflow_heap (memory_size_type maxsize, Comparator c=Comparator()) |
| Constructor. More...
|
|
void | push (const T &x) |
| Insert an element into the priority queue. More...
|
|
void | pop () |
| Remove the top element from the priority queue. More...
|
|
const T & | top () |
| See what's on the top of the priority queue. More...
|
|
stream_size_type | size () const |
| Returns the size of the queue. More...
|
|
bool | empty () const |
| Return true if queue is empty otherwise false. More...
|
|
bool | full () const |
| Returns whether the overflow heap is full or not. More...
|
|
T * | sorted_array () |
| Sorts the underlying array and returns a pointer to it, this operation invalidates the heap. More...
|
|
memory_size_type | sorted_size () const |
| Return size of sorted array. More...
|
|
void | sorted_pop () |
| Remove all elements from queue. More...
|
|
|
static const double | sorted_factor = 1.0 |
| The factor of the size, total, which is returned sorted. More...
|
|
template<typename T, typename Comparator = std::less<T>>
class tpie::pq_overflow_heap< T, Comparator >
Overflow Priority Queue, based on a simple Heap.
- Author
- Lars Hvam Petersen
Definition at line 39 of file pq_overflow_heap.h.
template<typename T , typename Comparator >
Constructor.
- Parameters
-
maxsize | Maximal size of queue. |
Definition at line 23 of file pq_overflow_heap.h.
template<typename T , typename Comparator >
Return true if queue is empty otherwise false.
- Returns
- Boolean - empty or not.
Definition at line 77 of file pq_overflow_heap.h.
template<typename T , typename Comparator >
Returns whether the overflow heap is full or not.
- Returns
- Boolean - full or not.
Definition at line 55 of file pq_overflow_heap.h.
template<typename T , typename Comparator >
template<typename T , typename Comparator >
Insert an element into the priority queue.
- Parameters
-
Definition at line 27 of file pq_overflow_heap.h.
template<typename T , typename Comparator >
template<typename T , typename Comparator >
Sorts the underlying array and returns a pointer to it, this operation invalidates the heap.
- Returns
- A pointer to the sorted underlying array.
Definition at line 60 of file pq_overflow_heap.h.
template<typename T , typename Comparator >
template<typename T , typename Comparator >
template<typename T , typename Comparator >
See what's on the top of the priority queue.
- Returns
- Top element.
Definition at line 44 of file pq_overflow_heap.h.
template<typename T , typename Comparator = std::less<T>>
The factor of the size, total, which is returned sorted.
Definition at line 84 of file pq_overflow_heap.h.
The documentation for this class was generated from the following file: