class Heap_PriorityQueue
1: /** ADT priority queue: Heap-based implementation.
2: Listing 17-3.
3: @file Heap_PriorityQueue.h */
5: #ifndef _HEAP_PRIORITY_QUEUE
6: #define _HEAP_PRIORITY_QUEUE
8: #include "ArrayMaxHeap.h"
9: #include "PriorityQueueInterface.h"
11: template<class ItemType>
12: class Heap_PriorityQueue : public PriorityQueueInterface<ItemType>,
13: private ArrayMaxHeap<ItemType>
14: {
15: public:
16: Heap_PriorityQueue();
17: bool isEmpty() const;
18: bool add(const ItemType& newEntry);
19: bool remove();
20:
21: /** @pre The priority queue is not empty. */
22: ItemType peek() const throw(PrecondViolatedExcep);
23: }; // end Heap_PriorityQueue
25: #include "Heap_PriorityQueue.cpp"
26: #endif