Overflow Priority Queue, based on a simple Heap. More...
#include <tpie/pq_overflow_heap.h>
Public Member Functions | |
| 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 Public Attributes | |
| static const double | sorted_factor = 1.0 |
| The factor of the size, total, which is returned sorted. More... | |
Overflow Priority Queue, based on a simple Heap.
Definition at line 39 of file pq_overflow_heap.h.
| tpie::pq_overflow_heap< T, Comparator >::pq_overflow_heap | ( | memory_size_type | maxsize, |
| Comparator | c = Comparator() |
||
| ) |
Constructor.
| maxsize | Maximal size of queue. |
| bool tpie::pq_overflow_heap< T, Comparator >::empty | ( | ) | const |
Return true if queue is empty otherwise false.
| bool tpie::pq_overflow_heap< T, Comparator >::full | ( | ) | const |
Returns whether the overflow heap is full or not.
| void tpie::pq_overflow_heap< T, Comparator >::pop | ( | ) |
Remove the top element from the priority queue.
| void tpie::pq_overflow_heap< T, Comparator >::push | ( | const T & | x | ) |
Insert an element into the priority queue.
| x | The item. |
| stream_size_type tpie::pq_overflow_heap< T, Comparator >::size | ( | ) | const |
Returns the size of the queue.
| T* tpie::pq_overflow_heap< T, Comparator >::sorted_array | ( | ) |
Sorts the underlying array and returns a pointer to it, this operation invalidates the heap.
| void tpie::pq_overflow_heap< T, Comparator >::sorted_pop | ( | ) |
Remove all elements from queue.
| memory_size_type tpie::pq_overflow_heap< T, Comparator >::sorted_size | ( | ) | const |
Return size of sorted array.
| const T& tpie::pq_overflow_heap< T, Comparator >::top | ( | ) |
See what's on the top of the priority queue.
|
static |
The factor of the size, total, which is returned sorted.
Definition at line 84 of file pq_overflow_heap.h.