#ifndef _PQUEUE #define _PQUEUE #include #include "funcs.h" using namespace std; class PQueue { friend ostream & operator<<(ostream &, PQueue *); protected: valueFunc *valfn; // Function which determines the "value" of an object displayFunc *dispfn; void **objects; // Array of pointers to objects long size, tail; // The size of the array and index of its last object public: PQueue(int, valueFunc*, displayFunc*); PQueue(valueFunc*, displayFunc*); PQueue(int, valueFunc*); // Constructor takes size and "value" // function as arguments PQueue(valueFunc*); // Constructor takes "value" function as // argument ~PQueue(); // Destructor bool empty(); // Returns "true" iff no objects are stored void insert(void*); // Inserts an object into the priority queue void *remove(); // Removes lowest valued object and returns // a pointer to it void printTree(); }; #endif