![]() |
Data Abstraction and Problem Solving with C++Walls and Mirrorsby Frank M. Carrano |
![]() |
PQ.cppGo to the documentation of this file.00001 00019 #include "PQ.h" // header file for priority queue 00020 00021 bool PriorityQueue::pqIsEmpty() const 00022 { 00023 return h.heapIsEmpty(); 00024 } // end pqIsEmpty 00025 00026 void PriorityQueue::pqInsert(const PQueueItemType& newItem) 00027 throw(PQueueException) 00028 { 00029 try 00030 { 00031 h.heapInsert(newItem); 00032 } // end try 00033 catch (HeapException e) 00034 { throw PQueueException("PQueueException: Priority queue full"); 00035 } // end catch 00036 } // end pqInsert 00037 00038 void PriorityQueue::pqDelete(PQueueItemType& priorityItem) 00039 throw(PQueueException) 00040 { 00041 try 00042 { 00043 h.heapDelete(priorityItem); 00044 } // end try 00045 catch (HeapException e) 00046 { throw PQueueException("PQueueException: Priority queue empty"); 00047 } // end catch 00048 } // end pqDelete 00049 // End of implementation file. |