/*
Name: Anne Dawson
Program: priorityQueue.cpp
Description: This is the implementation of the priority queue class
inherited from the min heap class.
*/

#ifndef _PRIORITYQ_H_
#define _PRIORITYQ_H_

#include "binaryHeap.h"

template< typename type >
class CPriorityQueue : private CBinaryHeap< type >
{
public:
    CPriorityQueue( void )
    // Post: queue is empty and has default capacity MAXHEAPITEMS
    {}

    CPriorityQueue( int maxCapacity ) : CBinaryHeap< type >( maxCapacity )
    // Post: queue is empty and has a capacity of maxCapacity items
    {}

    void push( const type& item )
    // Pre: queue is not full
    // Post: item has been pushed onto priority queue
    {

    insert(item);

    }

    void pop( void )
    // Pre: queue is not empty
    // Post: item has been popped off priority queue
    {

    deleteTop();

    }

    type& front( void )
    // Pre: queue is not empty
    // Post: reference to item at front of queue has been returned
    {

    return getTop();

    }

    const type& front( void ) const
    // Pre: queue is not empty
    // Post: constant reference to item at front of queue has been returned
    {

    return getTop();

    }

    int size( void ) const
    // Post: number of items in queue has been returned
    {

    return CBinaryHeap<type>::size();

    }

    bool isEmpty( void ) const
    // Post: true if queue is empty
    {

    return CBinaryHeap<type>::isEmpty();

    }

    bool isFull( void ) const
    // Post: true if queue is full
    {

    return CBinaryHeap<type>::isFull();

    }

   void print() const
   {
   CBinaryHeap<type>::print();
   }
};

#endif
