// File: genstack.h // // A generic stack class derived from the generic queue class. #ifndef _genstack_h #define _genstack_h #include "genq.h" class GenStack : private GenQ { // private derivation of GenQ public: GenStack(GenQ::GQcmp, GenQ::GQprt) ; // constructor ~GenStack() ; // destructor void push(void *) ; // add item to top of stack // remove & return item from top of stack void *pop() { return dequeue() ; } // look at item at top of stack void *top() { return peek() ; } // make these functions from GenQ class visible GenQ::print ; GenQ::length ; } ; #endif